Merged in MBP-273-add-support-for-c6017-ups (pull request #89)

MBP-273 add support for c6017 ups

Approved-by: Alexandre G. Gerk
This commit is contained in:
Federico Rojas
2024-07-16 08:53:08 +00:00
4 changed files with 31 additions and 2 deletions

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<TcPlcObject Version="1.1.0.1" ProductVersion="3.1.4024.11">
<DUT Name="E_CPUType" Id="{78ea3fa6-b103-4c1f-b5a7-d343f24fda9f}">
<Declaration><![CDATA[{attribute 'qualified_only'}
{attribute 'strict'}
TYPE E_CPUType :
(
CX5130 := 0,
C6017_0020 := 1
);
END_TYPE
]]></Declaration>
</DUT>
</TcPlcObject>

View File

@@ -3,6 +3,8 @@
<GVL Name="GVL_APP" Id="{8fe9690c-7907-432e-bedb-6fc99b5ce255}">
<Declaration><![CDATA[{attribute 'qualified_only'}
VAR_GLOBAL
//0 for CX5130 and 1 for c6017-0020
eCPUType: E_CPUType; //:= 1;
END_VAR
VAR_GLOBAL CONSTANT

View File

@@ -10,7 +10,8 @@ VAR
hmiAxisSelection: INT := 1; //Not possible to use local hmi variables for array indexes
hmiPneumaticAxisSelection: INT := 1;
//Startup, Shutdown and UPS
fbUPS: FB_S_UPS_CX51x0;
fbCX5130UPS: FB_S_UPS_CX51x0;
fbC6017UPS: FB_S_UPS_BAPI;
eUpsMode: E_S_UPS_Mode := eSUPS_WrPersistData_Shutdown;
eStartUp: (eColdStart, eReadAxisFeedbackType, eCheckReadDone, eExecuteRestore, eCheckRestore, eFinishRestore);
bPositionRestoreDone: BOOL := FALSE;
@@ -64,7 +65,13 @@ END_FOR
</Action>
<Action Name="CHECK_UPS" Id="{f0f28f50-53b8-4f73-b0f5-6d7ce4c1636f}" FolderPath="POSITION_RECOVERY\">
<Implementation>
<ST><![CDATA[fbUPS(eUpsMode := eUpsMode);
<ST><![CDATA[CASE GVL_APP.eCPUType OF
E_CPUType.CX5130:
fbCX5130UPS(eUpsMode := eUpsMode);
E_CPUType.C6017_0020:
fbC6017UPS(eUPSMode := eUPSMode);
END_CASE
FOR iAxes := 1 TO GVL_APP.nAXIS_NUM DO
//Read encoder position BIAS

View File

@@ -19,6 +19,9 @@
<GenerateTpy>false</GenerateTpy>
</PropertyGroup>
<ItemGroup>
<Compile Include="DUTs\E_CPUType.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="GlobalTextList.TcGTLO">
<SubType>Code</SubType>
</Compile>
@@ -68,6 +71,9 @@
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_GearAxis.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\Axis_Structures\ST_HomingConfig.TcDUT">
<SubType>Code</SubType>
</Compile>
<Compile Include="tc_mca_std_lib\DUTs\E_AxisEngUnit.TcDUT">
<SubType>Code</SubType>
</Compile>