Initialization
Data format
Often, there is a real tool in the spindle when the controller is restarted. The PLC has a possibility of directly communicating this tool to the CNC.
actual_tool : DINT;
PLC example
bWrite: BOOL := FALSE;
ToolWrite : ADSWRITE;
ToolNr : DINT := 4711;
IF bWrite = TRUE THEN
bWrite := FALSE;
ToolWrite(Write := FALSE);
ToolWrite.NETID := '';
ToolWrite.PORT := ADS_PORT_TASK_SDA;
ToolWrite.IDXGRP := ADS_IGRP_DECODER_OF_CHANNEL + 1;
ToolWrite.IDXOFFS := ADS_IOFFS_ACTUAL_T_NUMBER;
ToolWrite.SrcAddr := ADR(ToolNr);
ToolWrite.LEN := SIZEOF(ToolNr);
ToolWrite(Write := TRUE);
END_IF
ToolWrite();