diff --git a/solution/_Config/NC/Axes/VC.xti b/solution/_Config/NC/Axes/VC.xti index 41f52e4..e7c59f5 100644 --- a/solution/_Config/NC/Axes/VC.xti +++ b/solution/_Config/NC/Axes/VC.xti @@ -1485,7 +1485,6 @@ External Setpoint Generation: - diff --git a/solution/_Config/NC/Axes/VG.xti b/solution/_Config/NC/Axes/VG.xti index ea349e9..5de84ff 100644 --- a/solution/_Config/NC/Axes/VG.xti +++ b/solution/_Config/NC/Axes/VG.xti @@ -1485,7 +1485,7 @@ External Setpoint Generation: - + diff --git a/solution/_Config/PLC/tc_project_app.xti b/solution/_Config/PLC/tc_project_app.xti index c1bf9f0..65a1187 100644 --- a/solution/_Config/PLC/tc_project_app.xti +++ b/solution/_Config/PLC/tc_project_app.xti @@ -1094,6 +1094,14 @@ External Setpoint Generation: GVL.astAxes[6].Axis.PlcToNc PLCTONC_AXIS_REF + + MAIN.slit1Vertical.GapSizeEncoder + UDINT + + + MAIN.slit1Vertical.GapCentreEncoder + UDINT + limitsPower.bEnableAxis1Limits BOOL @@ -1110,14 +1118,6 @@ External Setpoint Generation: limitsPower.bEnableAxis2Enc BOOL - - testSlitApp.iGapSizePosition - UDINT - - - testSlitApp.iGapCentrePosition - UDINT - @@ -1172,12 +1172,12 @@ External Setpoint Generation: - + - + diff --git a/solution/tc_project_app/POUs/Application_Specific/Applications/FB_SlitPairV2.TcPOU b/solution/tc_project_app/POUs/Application_Specific/Applications/FB_SlitPairV2.TcPOU index 911f27e..14cd000 100644 --- a/solution/tc_project_app/POUs/Application_Specific/Applications/FB_SlitPairV2.TcPOU +++ b/solution/tc_project_app/POUs/Application_Specific/Applications/FB_SlitPairV2.TcPOU @@ -3,10 +3,10 @@ - + + + + 0 THEN + dir_positiveAxis := 1; //moving forward +ELSIF veloSetpoint_positiveAxis <0 THEN + dir_positiveAxis := -1; //moving backward +ELSE + dir_positiveAxis := 0; //stationary +END_IF + +IF veloSetpoint_negativeAxis >0 THEN + dir_negativeAxis := 1; //moving forward +ELSIF veloSetpoint_negativeAxis <0 THEN + dir_negativeAxis := -1; //moving backward +ELSE + dir_negativeAxis := 0; //stationary +END_IF + +IF veloSetpoint_gapSizeAxis >0 THEN + dir_gapSizeAxis := 1; //moving forward +ELSIF veloSetpoint_gapSizeAxis <0 THEN + dir_gapSizeAxis := -1; //moving backward +ELSE + dir_gapSizeAxis := 0; //stationary +END_IF + +IF veloSetpoint_gapCentreAxis >0 THEN + dir_gapCentreAxis := 1; //moving forward +ELSIF veloSetpoint_gapCentreAxis <0 THEN + dir_gapCentreAxis := -1; //moving backward +ELSE + dir_gapCentreAxis := 0; //stationary +END_IF]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index a1b8dd9..0b828b3 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -20,6 +20,8 @@ VAR afbReadEncRefSys: ARRAY [1..GVL_APP.nAXIS_NUM] OF MC_ReadParameter; afbRestorePosition: ARRAY [1..GVL_APP.nAXIS_NUM] OF MC_SetPosition; fbGetDeviceIdentification: FB_GetDeviceIdentification; + + slit1Vertical : FB_SlitPairV2; END_VAR VAR PERSISTENT @@ -28,7 +30,10 @@ END_VAR]]> +PROG(); + +slit1Vertical(ID_positiveAxis:=1, ID_negativeAxis:=2, ID_gapSizeAxis:=3, ID_gapCentreAxis:=4); +]]> @@ -76,8 +81,7 @@ END_IF]]> +limitsPower();]]> @@ -208,6 +212,9 @@ END_FOR]]> + + + @@ -228,7 +235,6 @@ END_FOR]]> - diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index f0e0565..5a67b6e 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -28,6 +28,9 @@ Code + + Code + Code @@ -61,6 +64,9 @@ Code + + Code + Code