
FANUC Series 16i/18i/21i-MA/MB/TB TOOL MANAGEMENT FUNCTION A-78614EN
2002.08.08 Edition 04
130
13.4 Write Tool management data
Function Name:
cnc_wrtool
Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_wrtool(unsigned short FlibHndl,
short number, IODBTLMNG *tool);
Description:
Writes the specified Tool management data to the Tool management data
table. In case of writing the individual data on the Tool management
data, use cnc_wrtool2 function.
Arguments:
FlibHndl
Specify the library handle.
See "1.1.3 Library handle" of SPECIFICATION MANUAL OF
DATA WINDOW LIBRARY for details.
number
Specify the data number at the Tool management data table.
tool
Specify the pointer to IODBTLMNG structure including the Tool
management data to be written. As for the IODBTLMNG structure,
refer to the explanation of arguments of cnc_regtool function.
Return: EW_OK is returned on successful completion, otherwise any value except
EW_OK is returned. The major error codes are as follows.
(As for the details, see "1.1.5 Return status of Data window function" of
SPECIFICATION MANUAL OF DATA WINDOW LIBRARY.)
--------------------------------------------------------------
Return code Meaning/Error handling
--------------------------------------------------------------
EW_BUSY Other users (such as PMC) have accessed to the same
data window.
Try this function again.
EW_NUMBER The data number for the Tool management data
table(number) is invalid.
EW_DATA The member in the IODBTLMNG structure is invalid.
In order to get more information for this err_no
return value, execute cnc_getdtailerr() function.
The following detail status will be set onto the member,
err_no of OBDERR structure.
0: error except EW_DATA
1: error of tool number
2: error of tool life counter
3: error of maximum of tool life
4: error of predictive tool life
5: error of state of tool life