Files
Adeco_20220119-01/TC3_CNCPLCBase/OEM/Werkzeugverwaltung/PRG_Platztausch.TcPOU
Matthias Heisig 51d6e7e5c4 Initial commit
2024-10-22 14:22:54 +02:00

71 lines
2.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="PRG_Platztausch" Id="{14050e21-b06c-4055-84da-8b2062df95a7}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM PRG_Platztausch
VAR
nState : INT := 0;
diTPos : DINT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[(* Initiate tool pocket change on M106 command *)
IF CNCSystem.Channel[0].M[106].bState_rw AND nState = 0 THEN
nState := 10;
END_IF
CASE nState OF
10: // Change pocket position of tool currently in Spindle to -1
// Save position of tool to change for old tool
diTPos := GVL_ToolMgmt.stToolToPrep.pos;
GVL_ToolMgmt.stToolToPrep.pos := -1;
CNCSystem.Channel[0].ToolData.stOldTool := GVL_ToolMgmt.stToolToPrep;
CNCSystem.Channel[0].ToolData.bOldToolDataExist := TRUE;
nState := 15;
15: // Wait for HMI to be done reading the tool
IF CNCSystem.Channel[0].ToolData.bOldToolDataExist = FALSE THEN
nState := 20;
END_IF
20: // Change pocket of old tool to pocketnumber of new tool
// Wenn das neue Werkzeug das Nullwerkzeug ist,
// Speichere die Position in den Remanenten Daten
IF GVL_ToolMgmt.stCurrentTool.tool_desc.tool_id.basic = 0 THEN
GVL_ToolMgmt.diToolZeroPosition := diTPos;
END_IF
GVL_ToolMgmt.stCurrentTool.pos := diTPos;
CNCSystem.Channel[0].ToolData.stOldTool := GVL_ToolMgmt.stCurrentTool;
CNCSystem.Channel[0].ToolData.bOldToolDataExist := TRUE;
nState := 25;
25: // Wait for HMI to be done reading the tool
IF CNCSystem.Channel[0].ToolData.bOldToolDataExist = FALSE THEN
CNCSystem.Channel[0].M[106].bState_rw := FALSE;
nState := 0;
END_IF
END_CASE]]></ST>
</Implementation>
<LineIds Name="PRG_Platztausch">
<LineId Id="10" Count="0" />
<LineId Id="8" Count="1" />
<LineId Id="5" Count="0" />
<LineId Id="12" Count="0" />
<LineId Id="11" Count="0" />
<LineId Id="13" Count="0" />
<LineId Id="16" Count="0" />
<LineId Id="15" Count="0" />
<LineId Id="17" Count="10" />
<LineId Id="44" Count="0" />
<LineId Id="50" Count="0" />
<LineId Id="45" Count="4" />
<LineId Id="28" Count="1" />
<LineId Id="42" Count="0" />
<LineId Id="30" Count="2" />
<LineId Id="34" Count="2" />
<LineId Id="33" Count="0" />
<LineId Id="14" Count="0" />
</LineIds>
</POU>
</TcPlcObject>