OOP implementation of FB_Axis created with basic functionality

This commit is contained in:
Cooper
2022-07-07 14:36:10 +01:00
parent 2a288d8d21
commit 976ef8dedc
8 changed files with 2639 additions and 40 deletions

View File

@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.21005.1
# TcXaeShell Solution File, Format Version 11.00
VisualStudioVersion = 15.0.28307.1300
MinimumVisualStudioVersion = 10.0.40219.1
Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "solution", "solution\solution.tsproj", "{9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}"
EndProject

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,8 @@
<?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.11">
<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}" Target64Bit="true" ShowHideConfigurations="#x106">
<System>
<Settings MaxCpus="2" NonWinCpus="1" DontCheckTarget="10.0.5.148.1.1">
<Cpu CpuId="1"/>
<Settings MaxCpus="12" DontCheckTarget="10.0.5.148.1.1">
<IoIdleTask Priority="6"/>
</Settings>
<Tasks>

View File

@@ -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">
<GVL Name="GVL_APP" Id="{8fe9690c-7907-432e-bedb-6fc99b5ce255}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL
@@ -7,8 +7,7 @@ VAR_GLOBAL
END_VAR
VAR_GLOBAL CONSTANT
nAXIS_NUM: UINT := 0; (*~ (OPC: 1 : available for OPC-clients)
(OPC_PROP[0005]: 1 : OPC_PROP_RIGHTS, here read only) *)
nAXIS_NUM: UINT := 1; (*~ (OPC: 1 : available for OPC-clients)(OPC_PROP[0005]: 1 : OPC_PROP_RIGHTS, here read only)*)
nPNEUMATIC_AXIS_NUM: UINT := 0;
END_VAR
]]></Declaration>

View File

@@ -1,10 +1,12 @@
<?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="MAIN" Id="{33eb6f49-7781-4211-a70b-87ada6d80cb7}" SpecialFunc="None">
<Declaration><![CDATA[PROGRAM MAIN
VAR
sVersion: STRING := '1.0.0';
aIAxes : ARRAY [1..GVL_APP.nAXIS_NUM] OF I_Axis;
afbAxes: ARRAY [1..GVL_APP.nAXIS_NUM] OF FB_Axis;
afbAxesV2: ARRAY [1..GVL_APP.nAXIS_NUM] OF FB_Axis_V2;
afbPneumaticAxes: ARRAY [1..GVL_APP.nPNEUMATIC_AXIS_NUM] OF FB_PneumaticAxis;
hmiAxisSelection: INT := 1; //Not possible to use local hmi variables for array indexes
hmiPneumaticAxisSelection: INT := 1;
@@ -36,11 +38,23 @@ PROG();]]></ST>
<ST><![CDATA[//Get task index for Axes parameters initialization.
GVL.fbGetCurTaskIndex();
//Create an stAxisStruct for every axis in the project.
IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
afbAxesV2[GVL.iAxis].stAxis REF= astAxes[GVL.iAxis];
aIAxes[GVL.iAxis] := afbAxesV2[GVL.iAxis];
END_FOR
END_IF
FOR GVL.iAxis := 1 TO GVL_APP.nAXIS_NUM DO
afbAxes[GVL.iAxis](stAxisStruct := GVL.astAxes[GVL.iAxis]);
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*)
FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO
afbPneumaticAxes[GVL.iPneumaticAxis](stPneumaticAxisStruct := GVL.astPneumaticAxes[GVL.iPneumaticAxis]);
END_FOR
@@ -218,6 +232,15 @@ END_FOR]]></ST>
</LineIds>
<LineIds Name="MAIN.AXES">
<LineId Id="11" Count="1" />
<LineId Id="22" Count="0" />
<LineId Id="25" Count="0" />
<LineId Id="30" Count="2" />
<LineId Id="29" Count="0" />
<LineId Id="23" Count="0" />
<LineId Id="34" 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" />

View File

@@ -40,6 +40,33 @@
<Compile Include="POUs\MAIN.TcPOU">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisConfig.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisControl.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisDescription.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisError.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisInputs.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisPersistent.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisStatus.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_AxisStruct.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_GearAxis.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\E_AxisParameters.TcTLEO">
<SubType>Code</SubType>
</Compile>
@@ -61,6 +88,9 @@
<Compile Include="tc_mca_std_lib\DUTs\E_RestorePosition.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\I_Axis.TcIO">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Pneumatics\E_PneumaticAxisErrors.TcDUT">
<SubType>Code</SubType>
</Compile>
@@ -88,34 +118,10 @@
<Compile Include="tc_mca_std_lib\DUTs\E_SlitPairStates.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisConfig.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisControl.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\E_MotionFunctions.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisDescription.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisError.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisInputs.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisPersistent.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_GearAxis.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisStatus.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\ST_AxisStruct.TcDUT">
<Compile Include="tc_mca_std_lib\DUTs\ST_McStatus.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\GVLs\GVL.TcGVL">
@@ -124,6 +130,9 @@
<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>
@@ -154,6 +163,7 @@
<Folder Include="POUs\Application_Specific" />
<Folder Include="POUs\Application_Specific\Applications" />
<Folder Include="POUs\Application_Specific\Axes" />
<Folder Include="tc_mca_std_lib\DUTs\Axis_Structures" />
<Folder Include="tc_mca_std_lib\DUTs\Pneumatics" />
<Folder Include="POUs\Application_Specific\Applications" />
<Folder Include="POUs\Application_Specific\Axes" />