Tool life data

Tool life time, tool life distance

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

The transferred data can be saved and further processed in the PLC. The PLC must acknowledge receipt by returning a blank message.

The following data is transferred by 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)

Transferring tool life parameters to the PLC
Transferring tool life parameters to the PLC

Programing Example

prg_example

Tool manager in the PLC program

...

(* CNC updates tool life data after selecting

a different 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 response *)

RRes.LEN := 0;

RRes.DATAADDR := 0;

IF BasicToolId <= MAX_TOOLS THEN

(* update tool 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;

(* Check validity of response*)

RRes.RESULT := ADS_RDWRT_IND_NO_ERROR;

ELSE

RRes.RESULT := WZV_TOOL_ID_BASIC_INVALID;

END_IF