include TMC and TPY, remove axes from test

This commit is contained in:
SCooper
2022-07-27 15:34:28 +01:00
parent 2222e7539e
commit 387a662d19
8 changed files with 22 additions and 1643 deletions
File diff suppressed because it is too large Load Diff
-12
View File
@@ -1052,16 +1052,4 @@ External Setpoint Generation:
</TaskPouOids>
</Instance>
</Project>
<Mappings>
<OwnerA Name="tc_project_app Instance">
<OwnerB Name="TINC^NC-Task 1 SAF^Axes^Axis 1">
<Link VarA="PlcTask Inputs^GVL.astAxes[1].Axis.NcToPlc" VarB="Outputs^ToPlc"/>
<Link VarA="PlcTask Outputs^GVL.astAxes[1].Axis.PlcToNc" VarB="Inputs^FromPlc"/>
</OwnerB>
<OwnerB Name="TINC^NC-Task 1 SAF^Axes^Axis 2">
<Link VarA="PlcTask Inputs^GVL.astAxes[2].Axis.NcToPlc" VarB="Outputs^ToPlc"/>
<Link VarA="PlcTask Outputs^GVL.astAxes[2].Axis.PlcToNc" VarB="Inputs^FromPlc"/>
</OwnerB>
</OwnerA>
</Mappings>
</TcSmItem>
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<TcSmProject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2012/07/TcSmProject" TcSmVersion="1.0" TcVersion="3.1.4024.32">
<Project ProjectGUID="{9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}" TargetNetId="5.65.74.200.1.1" Target64Bit="true" ShowHideConfigurations="#x106">
<Project ProjectGUID="{9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}" Target64Bit="true" ShowHideConfigurations="#x106">
<System>
<Settings MaxCpus="2">
<IoIdleTask Priority="6"/>
+2 -4
View File
@@ -3,13 +3,11 @@
<GVL Name="GVL_APP" Id="{8fe9690c-7907-432e-bedb-6fc99b5ce255}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL
END_VAR
VAR_GLOBAL CONSTANT
nAXIS_NUM: UINT := 2; (*~ (OPC: 1 : available for OPC-clients)(OPC_PROP[0005]: 1 : OPC_PROP_RIGHTS, here read only)*)
nAXIS_NUM: UINT := 0; (*~ (OPC: 1 : available for OPC-clients)(OPC_PROP[0005]: 1 : OPC_PROP_RIGHTS, here read only)*)
nPNEUMATIC_AXIS_NUM: UINT := 0;
END_VAR
]]></Declaration>
END_VAR]]></Declaration>
</GVL>
</TcPlcObject>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.5">
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<POU Name="Axis_Template" Id="{1a43acb4-bd2e-4637-97fb-9976d47292b6}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM Axis_Template
VAR
@@ -8,8 +8,7 @@ VAR
//Hardware interlocks
//bInterlockFwdOK AT %I*: BOOL;
END_VAR
]]></Declaration>
END_VAR]]></Declaration>
<Implementation>
<ST><![CDATA[//Initial parameters of an Axis
(*IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
@@ -21,8 +20,7 @@ END_IF*)
//Define ACTIONS() or write exclusive code for an specific axis.
(*Eg. Stop when temperature reaches certain values, reduce speed if a signal is activated, etc.
Eg. GVL.astAxes[x].stControl.bInterlockFwd := NOT bInterlockFwdOK;*)
]]></ST>
Eg. GVL.astAxes[x].stControl.bInterlockFwd := NOT bInterlockFwdOK;*)]]></ST>
</Implementation>
<LineIds Name="Axis_Template">
<LineId Id="20" Count="0" />
@@ -34,7 +32,6 @@ Eg. GVL.astAxes[x].stControl.bInterlockFwd := NOT bInterlockFwdOK;*)
<LineId Id="21" Count="0" />
<LineId Id="24" Count="0" />
<LineId Id="33" Count="0" />
<LineId Id="23" Count="0" />
</LineIds>
</POU>
</TcPlcObject>
+15 -39
View File
@@ -38,35 +38,32 @@ AXES_EndOfCycle();]]></ST>
<ST><![CDATA[//Get task index for Axes parameters initialization.
GVL.fbGetCurTaskIndex();
//First cycle, assign FB_axis to interface array
IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
afbAxes[GVL.iAxis].stAxis REF= astAxes[GVL.iAxis];
aIAxes[GVL.iAxis] := afbAxes[GVL.iAxis];
END_FOR
//Custom axis types defined and linked to aiAxes here
END_IF
//Execute FB_Axis logic
FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
aIAxes[GVL.iAxis].Run();
END_FOR
//Create an stAxisStruct for every axis in the project.
(*FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
afbAxes[GVL.iAxis](stAxisStruct := GVL.astAxes[GVL.iAxis]);
END_FOR*)
//Execute Pneumatic Axis logic
FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO
afbPneumaticAxes[GVL.iPneumaticAxis](stPneumaticAxisStruct := GVL.astPneumaticAxes[GVL.iPneumaticAxis]);
END_FOR
]]></ST>
END_FOR]]></ST>
</Implementation>
</Action>
<Action Name="AXES_EndOfCycle" Id="{1d0c47cf-5c32-4a53-bfaa-da9593fd6c0d}">
<Implementation>
<ST><![CDATA[FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
<ST><![CDATA[//Clear control signals at end of each cycle
FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
aIAxes[GVL.iAxis].EndOfCycle();
END_FOR
]]></ST>
END_FOR]]></ST>
</Implementation>
</Action>
<Action Name="CHECK_UPS" Id="{f0f28f50-53b8-4f73-b0f5-6d7ce4c1636f}" FolderPath="POSITION_RECOVERY\">
@@ -101,23 +98,11 @@ END_IF]]></ST>
//Create as many programs in that folder as axes and applications you have or need
//Axes initial parameters and program
Axis_Template();
//Axis_Template();
//Pneumatics_Template();
//Application program calls
//Application_Template();
IF astAxes[1].stStatus.fActPosition > 50 THEN
astAxes[1].stInputs.bLimitFwd := FALSE;
ELSE
astAxes[1].stInputs.bLimitFwd := TRUE;
END_IF
IF astAxes[1].stStatus.fActPosition < -5 THEN
astAxes[1].stInputs.bLimitBwd := FALSE;
ELSE
astAxes[1].stInputs.bLimitBwd := TRUE;
END_IF]]></ST>
//Application_Template();]]></ST>
</Implementation>
</Action>
<Action Name="RESTORE_POSITIONS" Id="{0c7ee537-7bd9-4833-b428-c17cbb57e893}" FolderPath="POSITION_RECOVERY\">
@@ -252,25 +237,23 @@ END_FOR]]></ST>
</LineIds>
<LineIds Name="MAIN.AXES">
<LineId Id="11" Count="1" />
<LineId Id="38" Count="0" />
<LineId Id="22" Count="0" />
<LineId Id="25" Count="0" />
<LineId Id="30" Count="2" />
<LineId Id="29" Count="0" />
<LineId Id="39" Count="0" />
<LineId Id="23" Count="0" />
<LineId Id="34" Count="0" />
<LineId Id="37" Count="0" />
<LineId Id="33" Count="0" />
<LineId Id="35" Count="1" />
<LineId Id="24" Count="0" />
<LineId Id="14" Count="1" />
<LineId Id="1" Count="0" />
<LineId Id="4" Count="0" />
<LineId Id="10" Count="0" />
<LineId Id="40" Count="0" />
<LineId Id="18" Count="3" />
<LineId Id="17" Count="0" />
</LineIds>
<LineIds Name="MAIN.AXES_EndOfCycle">
<LineId Id="5" Count="0" />
<LineId Id="2" Count="2" />
<LineId Id="1" Count="0" />
</LineIds>
<LineIds Name="MAIN.CHECK_UPS">
<LineId Id="2" Count="11" />
@@ -289,13 +272,6 @@ END_FOR]]></ST>
<LineId Id="10" Count="0" />
<LineId Id="9" Count="0" />
<LineId Id="3" Count="0" />
<LineId Id="14" Count="0" />
<LineId Id="13" Count="0" />
<LineId Id="15" Count="0" />
<LineId Id="17" Count="1" />
<LineId Id="16" Count="0" />
<LineId Id="20" Count="4" />
<LineId Id="19" Count="0" />
</LineIds>
<LineIds Name="MAIN.RESTORE_POSITIONS">
<LineId Id="567" Count="105" />
@@ -130,9 +130,6 @@
<Compile Include="tc_mca_std_lib\POUs\Motion\FB_Axis.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\POUs\Motion\FB_Axis_V2.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\POUs\Motion\FB_SlitPair.TcPOU">
<SubType>Code</SubType>
</Compile>
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Refactors>
<Renames>
<RenamedType>
<Type guid="ade71f2f-2325-4792-8103-f7cd9c07d44a">FB_AXIS_V2</Type>
<From>FB_Axis_V2</From>
<To>FB_Axis</To>
</RenamedType>
<RenamedSymbol>
<Type guid="33eb6f49-7781-4211-a70b-87ada6d80cb7">MAIN</Type>
<From>afbAxesV2</From>
<To>afbAxes</To>
</RenamedSymbol>
</Renames>
</Refactors>