From 93585de489c4c58167de81dbe5265f592ab1fc10 Mon Sep 17 00:00:00 2001 From: Markus Kristensson Date: Tue, 10 Sep 2024 11:18:34 +0200 Subject: [PATCH] Use reference to Pneumatic Axes Restructure the call to the pneumatic axes according to FB_Axes: 1. Link the axis structure for the pneumatic axes by calling the new stPneumaticAxis property. 2. Execute the pneumatic axes. --- solution/tc_project_app/POUs/MAIN.TcPOU | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index eb06b93..1686557 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -45,6 +45,10 @@ IF _TaskInfo[fbGetCurTaskIndex.index].FirstCycle THEN afbAxes[GVL.iAxis].stAxis REF= astAxes[GVL.iAxis]; aIAxes[GVL.iAxis] := afbAxes[GVL.iAxis]; END_FOR + + FOR GVL.iPneumaticAxis := 1 TO GVL_APP.nPNEUMATIC_AXIS_NUM DO + afbPneumaticAxes[GVL.iPneumaticAxis].stPneumaticAxis REF= astPneumaticAxes[GVL.iPneumaticAxis]; + END_FOR //Custom axis types defined and linked to aiAxes here //FB_CustomAxis extends FB_axis //fbCustomAxis.stAxis REF= astAxes[x]; @@ -58,7 +62,7 @@ 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]); + afbPneumaticAxes[GVL.iPneumaticAxis](); END_FOR ]]>