Edit comments in MAIN and update std_lib pointer

modified:   solution/tc_project_app/POUs/MAIN.TcPOU
modified:   solution/tc_project_app/tc_mca_std_lib
This commit is contained in:
Israa Ali
2024-12-04 12:17:33 +01:00
parent d2ca3c9ec9
commit dd25c6f384
3 changed files with 10 additions and 8 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ VAR_GLOBAL
END_VAR
VAR_GLOBAL CONSTANT
nAXIS_NUM: UINT := 0; //Specifies the total of axes in the system
nAXIS_NUM: UINT := 0; //Specifies the total of axes in the system
nPNEUMATIC_AXIS_NUM: UINT := 0; //Specifies the totsl number pf pneumatic axes in the system
END_VAR
]]></Declaration>
+8 -6
View File
@@ -45,7 +45,7 @@ IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN
afbAxes[GVL.iAxis].stAxis REF= astAxes[GVL.iAxis];
aIAxes[GVL.iAxis] := afbAxes[GVL.iAxis];
END_FOR
//Initialize pneumatic axes and link them to their corresponding instances
FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO
afbPneumaticAxes[GVL.iPneumaticAxis].stPneumaticAxis REF= astPneumaticAxes[GVL.iPneumaticAxis];
END_FOR
@@ -71,14 +71,16 @@ END_FOR
<Implementation>
<ST><![CDATA[CASE GVL_APP.eCPUType OF
E_CPUType.CX5130:
//Handle UPS configuration for CX5130 CPU type
fbCX5130UPS(eUpsMode := eUpsMode);
E_CPUType.C6017_0020:
//Handle UPS configuration for C6017-0020 CPU type
fbC6017UPS(eUPSMode := eUPSMode);
END_CASE
FOR iAxes := 1 TO GVL_APP.nAXIS_NUM DO
//Read encoder position BIAS
//Read the encoder position bias for initialized axes
IF astAxes[iAxes].stStatus.bAxisInitialized THEN
afbReadPositionBias[iAxes](Axis := GVL.astAxes[iAxes].Axis,
Enable := TRUE,
@@ -88,14 +90,14 @@ FOR iAxes := 1 TO GVL_APP.nAXIS_NUM DO
END_FOR
IF eGlobalSUpsState = eSUPS_PowerFailure THEN
//first cycle of powerfailure
//execute code that should only be done once with each powerfailure, i.e. increase powerfailure counter
//First cycle of powerfailure
//Execute code that should only be done once with each powerfailure, i.e. increase powerfailure counter
bRestoreOnStartup := TRUE;
STORE_PERSISTENT();
RETURN;
ELSIF eGlobalSUpsState <> eSUPS_PowerOK THEN
//next cycles of powerfailure
//skip regular code execution for the remaining cycles of the powerfailure/writing of persistent data/quick shutdown...
//Next cycles of powerfailure
//Skip regular code execution for the remaining cycles of the powerfailure/writing of persistent data/quick shutdown...
RETURN;
END_IF
]]></ST>