
FANUC Series 16i/18i/21i-MA/MB/TB TOOL MANAGEMENT FUNCTION A-78614EN
2002.08.08 Edition 04
123
13.1 New registration of Tool management data
Function Name:
cnc_regtool
Declaration:
#include "fwlib32.h"
FWLIBAPI short WINAPI cnc_regtool(unsigned short FlibHndl,
short s_number, short *data_num,
IODBTLMNG *tool);
Description:
Registers the Tool management data which is specified by the start data
number and the number of the data to the Tool management data table.
Registration by this function is done sequentially one by one. Once
the error occurs, succeeding registration is aborted.
Arguments:
FlibHndl
Specify the library handle.
See "1.1.3 Library handle" of SPECIFICATION MANUAL OF
DATA WINDOW LIBRARY for details.
s_number
Specify the start data number for the registration to the Tool
management data table.
data_num
Specify the pointer to the number of the registration data for
the registration to the Tool management data table. Set the
number of the registration data(1...) to the pointed data
before calling this function.
This function registers the number of Tool management data
specified by "*data_num", from the index specified by
"s_number". After the execution of this function, *data_num
holds the real registered number of data.
tool
Specify the pointer to IODBTLMNG structure including the Tool
management data to be registered. The IODBTLMNG structure is
as follows.
typedef struct iodbtlmng {
long T_code; /* tool number(T) */
long life_count; /* tool life counter */
long max_life; /* maximum of tool life */
long rest_life; /* predictive tool life */
unsigned char life_stat; /* state of tool life */
unsigned char cust_bits; /* reserved to customize(bit) */
unsigned short tool_info; /* tool info. */
short H_code; /* tool length compensation number (H) */
short D_code; /* cutter compensation number (D) */
long spindle_speed; /* spindle speed(S) */
long feedrate; /* feed rate(F) */