Tool life quantities

Tool life, Tool life distance

With every programmed T<i> or #TOOL PREP and when P-CHAN-00076 is set, the complete tool ID, the tool life and the tool life distance are sent automatically from the CNC to the PLC and are stored there.

The following data is transferred from the CNC to the PLC:

CNC_TOOL_DATA_IN (Tool life data sent from CNC)

tool_id : CNC_TOOL_ID; (Tool id from CNC)

time_used : LREAL; (Usage time of tool in seconds)

dist_used : LREAL; (Usage distance in mm)

Tool life quantities 1:
Figure1-3: Transferring tool life quantities to the PLC

Programming example: Tool manager in PLC-program, Tool information

...
(* CNC updates tool life data after deselection of another
tool T<i> *)
ELSIF RInd.IDXGRP = ADS_IGRP_TOOL_LIFE_DATA_WRITE THEN
(* CNC writes tool life data *)
pToolLife := RInd.DATAADDR;
BasicToolId := pToolLife^.tool_id.basic;
(* no data transmitted in the reposnse *)
RRes.LEN := 0;
RRes.DATAADDR := 0;
IF BasicToolId <= MAX_TOOLS THEN
(* actualize tooll life data *)
tool[BasicToolId].cnc.tool_life.dist_used := tool[BasicToolId].cnc.tool_life.dist_used
+ pToolLife^.dist_used;
tool[BasicToolId].cnc.tool_life.time_used := tool[BasicToolId].cnc.tool_life.time_used
+ pToolLife^.time_used;
(* Tool id in valid range *)
RRes.RESULT := ADS_RDWRT_IND_NO_ERROR;
ELSE
RRes.RESULT := WZV_TOOL_ID_BASIC_INVALID;
END_IF