Initial commit

This commit is contained in:
Matthias Heisig
2024-10-22 14:22:54 +02:00
commit 51d6e7e5c4
120 changed files with 24764 additions and 0 deletions

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="FB_CmdDInfo" Id="{e0e28df1-2233-498b-971b-7f8c787db05a}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_CmdDInfo IMPLEMENTS ITF_ToolAction
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
_tool : TC3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<Method Name="Commit" Id="{25561adb-e2c3-4952-8971-6e0bd5714826}">
<Declaration><![CDATA[(* Commits the tool data transfer action if it returns true*)
METHOD Commit : BOOL
VAR_INPUT
t : Tc3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_tool := t;
GVL_ToolMgmt.stCurrentTool := _tool;
Commit := true;]]></ST>
</Implementation>
</Method>
<Property Name="Tool" Id="{55b786a9-d0b6-4eca-9acb-c4eac7ca1a59}">
<Declaration><![CDATA[PROPERTY Tool : Tc3_CNC.ST_CNC_TOOL_DATA_EXT
]]></Declaration>
<Get Name="Get" Id="{0ca7819b-ca71-4950-b112-4e0e7a01037b}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[Tool := _tool;]]></ST>
</Implementation>
</Get>
</Property>
<LineIds Name="FB_CmdDInfo">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="FB_CmdDInfo.Commit">
<LineId Id="8" Count="0" />
<LineId Id="10" Count="0" />
<LineId Id="9" Count="0" />
<LineId Id="12" Count="0" />
<LineId Id="11" Count="0" />
</LineIds>
<LineIds Name="FB_CmdDInfo.Tool.Get">
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="FB_CmdOldDInfo" Id="{a08c7560-7f97-4dff-8602-2d2f0ae3c977}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_CmdOldDInfo IMPLEMENTS ITF_ToolAction
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
_tool : TC3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<Method Name="Commit" Id="{5fb9d6fd-121d-4d04-a478-855a86ce4c09}">
<Declaration><![CDATA[(* Commits the tool data transfer action if it returns true*)
METHOD Commit : BOOL
VAR_INPUT
t : Tc3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_tool := t;
IF _tool.tool_desc.param[9] = 1 THEN
_tool.laenge := LREAL_TO_DINT(_tool.tool_desc.param[10] * 10000);
_tool.tool_desc.param[9] := 0;
END_IF
Commit := TRUE;]]></ST>
</Implementation>
</Method>
<Property Name="Tool" Id="{1a4f8238-9d9a-4932-b866-1ce4c82e67e8}">
<Declaration><![CDATA[PROPERTY Tool : Tc3_CNC.ST_CNC_TOOL_DATA_EXT
]]></Declaration>
<Get Name="Get" Id="{950e7d8b-6a41-4aac-8e65-03f8966c7c3a}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[Tool := _tool;]]></ST>
</Implementation>
</Get>
</Property>
<LineIds Name="FB_CmdOldDInfo">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="FB_CmdOldDInfo.Commit">
<LineId Id="15" Count="0" />
<LineId Id="20" Count="0" />
<LineId Id="18" Count="0" />
<LineId Id="17" Count="0" />
<LineId Id="19" Count="0" />
<LineId Id="21" Count="0" />
<LineId Id="16" Count="0" />
<LineId Id="8" Count="0" />
</LineIds>
<LineIds Name="FB_CmdOldDInfo.Tool.Get">
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<POU Name="FB_CmdTInfo" Id="{adb7b52d-b0cb-47e5-92a4-3d78a8902e46}" SpecialFunc="None">
<Declaration><![CDATA[FUNCTION_BLOCK FB_CmdTInfo IMPLEMENTS ITF_ToolAction
VAR_INPUT
END_VAR
VAR_OUTPUT
END_VAR
VAR
_tool : Tc3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[]]></ST>
</Implementation>
<Method Name="Commit" Id="{fa444163-0c71-4c86-ba1b-725f5723ca12}">
<Declaration><![CDATA[(* Commits the tool data transfer action if it returns true*)
METHOD Commit : BOOL
VAR_INPUT
t : Tc3_CNC.ST_CNC_TOOL_DATA_EXT;
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[_tool := t;
// Wenn das neue Werkzeug das Nullwerkzeug ist, lade die WZW-Position des Nullwerkzeugs
// aus den Remanenten Daten
IF _tool.tool_desc.tool_id.basic = 0 THEN
_tool.pos := GVL_ToolMgmt.diToolZeroPosition;
END_IF
GVL_ToolMgmt.stToolToPrep := _tool;
// Positioniere das Kettenmagazin nur vor, wenn das neue Werkzeug nicht das
// selbe wie das alte ist
IF _tool.tool_desc.tool_id.basic <> GVL_ToolMgmt.diToolInSpindle THEN
GVL_ToolMgmt.bExecuteToolPrep := TRUE;
END_IF
Commit := TRUE;]]></ST>
</Implementation>
</Method>
<Property Name="Tool" Id="{0d967f20-5453-46e3-8feb-60cef128eee6}">
<Declaration><![CDATA[PROPERTY Tool : Tc3_CNC.ST_CNC_TOOL_DATA_EXT
]]></Declaration>
<Get Name="Get" Id="{88ffee38-caad-4c7f-b82c-730b0c67a5e9}">
<Declaration><![CDATA[VAR
END_VAR
]]></Declaration>
<Implementation>
<ST><![CDATA[Tool := _tool;]]></ST>
</Implementation>
</Get>
</Property>
<LineIds Name="FB_CmdTInfo">
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="FB_CmdTInfo.Commit">
<LineId Id="8" Count="0" />
<LineId Id="30" Count="0" />
<LineId Id="32" Count="3" />
<LineId Id="31" Count="0" />
<LineId Id="11" Count="1" />
<LineId Id="22" Count="0" />
<LineId Id="20" Count="0" />
<LineId Id="23" Count="0" />
<LineId Id="19" Count="0" />
<LineId Id="13" Count="0" />
<LineId Id="21" Count="0" />
<LineId Id="10" Count="0" />
<LineId Id="9" Count="0" />
</LineIds>
<LineIds Name="FB_CmdTInfo.Tool.Get">
<LineId Id="2" Count="0" />
</LineIds>
</POU>
</TcPlcObject>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.6">
<GVL Name="GVL_ToolMgmt" Id="{b8b980b7-8782-4a7d-86b6-be4993cff48f}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL PERSISTENT
diToolInSpindle : DINT;
diToolZeroPosition : DINT; // Aktuell = 1
END_VAR
VAR_GLOBAL
stToolToPrep : TC3_CNC.ST_CNC_TOOL_DATA_EXT;
stCurrentTool : TC3_CNC.ST_CNC_TOOL_DATA_EXT;
bExecuteToolPrep : BOOL;
END_VAR]]></Declaration>
</GVL>
</TcPlcObject>

View File

@@ -0,0 +1,71 @@
<?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>