From 6a79f654f16f1a3a70cd1c16e314d9dc656f5b89 Mon Sep 17 00:00:00 2001 From: SCooper Date: Tue, 27 Jul 2021 09:22:14 +0100 Subject: [PATCH] Add test program for implementing slit set, add hardware for testing slit set implementation. Update solution to point at new tc_mca_Std_lib files --- solution/_Config/NC/NC.xti | 208 ++++++++++++++++-- solution/_Config/PLC/tc_project_app.xti | 38 ++++ solution/solution.tsproj | 12 +- .../Application_Specific/Axes/testProg.TcPOU | 8 +- solution/tc_project_app/POUs/MAIN.TcPOU | 57 ++++- solution/tc_project_app/tc_mca_std_lib | 2 +- 6 files changed, 300 insertions(+), 25 deletions(-) diff --git a/solution/_Config/NC/NC.xti b/solution/_Config/NC/NC.xti index 8f756c9..df2c56f 100644 --- a/solution/_Config/NC/NC.xti +++ b/solution/_Config/NC/NC.xti @@ -1360,16 +1360,16 @@ External Setpoint Generation: bladeNeg - + - + - - - + + + Inputs @@ -1503,10 +1503,10 @@ External Setpoint Generation: - + - + @@ -1528,14 +1528,17 @@ External Setpoint Generation: bladePos - + - + - + + + + Inputs @@ -1671,7 +1674,7 @@ External Setpoint Generation: - + @@ -1695,9 +1698,16 @@ External Setpoint Generation: gapSize + + + - + + + + + Inputs @@ -1759,6 +1769,7 @@ External Setpoint Generation: + Inputs @@ -1831,6 +1842,8 @@ External Setpoint Generation: + + @@ -1854,9 +1867,16 @@ External Setpoint Generation: gapCentre + + + - + + + + + Inputs @@ -1918,6 +1938,7 @@ External Setpoint Generation: + Inputs @@ -1990,6 +2011,8 @@ External Setpoint Generation: + + @@ -2010,6 +2033,165 @@ External Setpoint Generation: + + Axis 5 + + + + + + Inputs + + In + NCENCODERSTRUCT_IN2B + 7680 + + nDataIn1 + + + nDataIn2 + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + nDataIn7 + + + + + + Outputs + + Out + NCENCODERSTRUCT_OUT2 + 12800 + + nDataOut1 + + + nDataOut2 + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + Inputs + + In + NCDRIVESTRUCT_IN2 + 8000 + + nDataIn1 + + + nDataIn2 + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + + + Outputs + + Out + NCDRIVESTRUCT_OUT2 + 13120 + + nDataOut1 + + + nDataOut2 + + + nCtrl2 + + + + nCtrl3 + + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + + Inputs + + FromPlc + PLCTONC_AXIS_REF + 6656 + + + + Outputs + + ToPlc + NCTOPLC_AXIS_REF + 10752 + + + diff --git a/solution/_Config/PLC/tc_project_app.xti b/solution/_Config/PLC/tc_project_app.xti index 7e94b07..6c673bb 100644 --- a/solution/_Config/PLC/tc_project_app.xti +++ b/solution/_Config/PLC/tc_project_app.xti @@ -905,6 +905,10 @@ External Setpoint Generation: {08500001-0000-0000-F000-000000000064} PlcTask Inputs + + MAIN.axisBladeNeg.NcToPlc + NCTOPLC_AXIS_REF + GVL.astAxes[1].stInputs.bLimitFwd BOOL @@ -973,6 +977,14 @@ External Setpoint Generation: GVL.astAxes[4].Axis.NcToPlc NCTOPLC_AXIS_REF + + MAIN.axisBladePos.NcToPlc + NCTOPLC_AXIS_REF + + + MAIN.axisGap.NcToPlc + NCTOPLC_AXIS_REF + PlcTask Outputs @@ -997,6 +1009,10 @@ External Setpoint Generation: limitsPower.bEnableAxis2Enc BOOL + + MAIN.axisBladeNeg.PlcToNc + PLCTONC_AXIS_REF + GVL.astAxes[1].Axis.PlcToNc PLCTONC_AXIS_REF @@ -1013,6 +1029,22 @@ External Setpoint Generation: GVL.astAxes[4].Axis.PlcToNc PLCTONC_AXIS_REF + + testProg.myFirstSlits.iGapSizePosition + UDINT + + + testProg.myFirstSlits.iGapCentrePosition + UDINT + + + MAIN.axisBladePos.PlcToNc + PLCTONC_AXIS_REF + + + MAIN.axisGap.PlcToNc + PLCTONC_AXIS_REF + @@ -1048,6 +1080,10 @@ External Setpoint Generation: + + + + @@ -1059,10 +1095,12 @@ External Setpoint Generation: + + diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 3d5ac78..c3d9622 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -11,7 +11,7 @@ - ARRAY [0..8] OF BIT + ARRAY [0..8] OF BIT 9 BIT @@ -20,7 +20,7 @@ - ARRAY [0..0] OF BIT + ARRAY [0..0] OF BIT 1 BIT @@ -29,7 +29,7 @@ - ARRAY [0..2] OF BIT + ARRAY [0..2] OF BIT 3 BIT @@ -47,7 +47,7 @@ - ARRAY [0..4] OF BIT + ARRAY [0..4] OF BIT 5 BIT @@ -56,7 +56,7 @@ - ARRAY [0..5] OF BIT + ARRAY [0..5] OF BIT 6 BIT @@ -65,7 +65,7 @@ - ARRAY [0..1] OF BIT + ARRAY [0..1] OF BIT 2 BIT diff --git a/solution/tc_project_app/POUs/Application_Specific/Axes/testProg.TcPOU b/solution/tc_project_app/POUs/Application_Specific/Axes/testProg.TcPOU index 6326633..75161ad 100644 --- a/solution/tc_project_app/POUs/Application_Specific/Axes/testProg.TcPOU +++ b/solution/tc_project_app/POUs/Application_Specific/Axes/testProg.TcPOU @@ -8,11 +8,12 @@ END_VAR ]]> +myFirstSlits(iBladeNegative:=1,iBladePositive:=2, iGapSize:=3, iGapCentre:=4); +]]> @@ -20,6 +21,7 @@ myFirstSlits(iBladeNegative:=2,iBladePositive:=1, iGapSize:=3, iGapCentre:=4);]] + \ 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 0773ba8..0ae9bb8 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -32,11 +32,48 @@ END_VAR VAR PERSISTENT bRestoreOnStartup: BOOL; +END_VAR + + +VAR +//all for testing + +axisBladeNeg : AXIS_REF; +axisBladePos : AXIS_REF; +axisGap : AXIS_REF; +powerBladeNeg : MC_POWER; +powerBladePos : MC_POWER; +powerAxisGap : MC_POWER; + +mcGearIn : MC_GEARIN; +mcGearInMulti : MC_GEARINMULTIMASTER; +mcGearOut : MC_GEAROUT; + +mcMoveAbs : MC_MOVEABSOLUTE; + END_VAR]]> - +PROG(); + +powerBladeNeg.Enable_Negative := GVL.astAxes[1].stInputs.bLimitBwd; +powerBladeNeg.Enable_Positive := GVL.astAxes[1].stInputs.bLimitFwd; +powerBladePos.Enable_Negative := GVL.astAxes[2].stInputs.bLimitBwd; +powerBladePos.Enable_Positive := GVL.astAxes[2].stInputs.bLimitFwd; +powerAxisGap.Enable_Negative:= TRUE; +powerAxisGap.Enable_Positive:= TRUE; + +powerBladeNeg(Axis:=axisBladeNeg); +powerBladePos(Axis:=axisBladePos); +powerAxisGap(Axis:=axisGap); +mcGearIn(Slave:= axisBladeNeg, Master:=axisBladePos); +mcGearInMulti(Master1:=axisBladePos,Master2:=axisGap,Slave:=axisBladeNeg); + +mcGearOut(Slave:=axisBladeNeg); + +mcMoveAbs(Axis:=axisBladeNeg); +]]> @@ -211,6 +248,22 @@ END_FOR]]> + + + + + + + + + + + + + + + + diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 735c9fe..2b22c81 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 735c9fed018b15461215dc17cac36b88494d1c00 +Subproject commit 2b22c8199b139687fe8ba11e4389ee1fdcb6054f