From 6dc8d31bbd5a93874d634d2d749bc3804cb31d47 Mon Sep 17 00:00:00 2001 From: Paul Barron Date: Fri, 24 Apr 2020 10:16:36 +0200 Subject: [PATCH 1/2] MBP-131: Update advanced homing Update pointer to tc_mca_std_lib Fix reference to MC2 library: changed to 3.3.28.0 instead of 3.3.31.0 There may be some changes to the TcUnit tests but these were not intended to be part of the commit. As I am halfway through the merge I will commit what is there and then fix later on if required. These should be part of another ticket. --- solution.sln | 16 -- solution/solution.tsproj | 23 +- solution/tc_project_app/GlobalTextList.TcGTLO | 210 ++++++++++++++++++ solution/tc_project_app/POUs/MAIN.TcPOU | 12 +- .../Test/common/FB_tcUNIT_common.TcPOU | 103 +++++++++ .../Test/common/tcUNIT_GVL.TcGVL | 1 + .../standard_library_tests/E_TestStates.TcDUT | 22 ++ solution/tc_project_app/tc_mca_std_lib | 2 +- .../tc_project_app/tc_project_app.plcproj | 8 +- 9 files changed, 371 insertions(+), 26 deletions(-) create mode 100644 solution/tc_project_app/Test/standard_library_tests/E_TestStates.TcDUT diff --git a/solution.sln b/solution.sln index 9459e68..be04ac6 100644 --- a/solution.sln +++ b/solution.sln @@ -33,22 +33,6 @@ Global {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86) - {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86) {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7) {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7) {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index a883408..2a8b590 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1,8 +1,7 @@ - + - {3EBB9639-5FF3-42B6-8847-35C70DC013C8} @@ -29,6 +28,26 @@ BOOL + + MAIN.bOutput5 + BOOL + + + MAIN.bOutput13 + BOOL + + + MAIN.bOutput17 + BOOL + + + MAIN.bOutput21 + BOOL + + + MAIN.bOutput24 + BOOL + diff --git a/solution/tc_project_app/GlobalTextList.TcGTLO b/solution/tc_project_app/GlobalTextList.TcGTLO index 21a3034..d1dec51 100644 --- a/solution/tc_project_app/GlobalTextList.TcGTLO +++ b/solution/tc_project_app/GlobalTextList.TcGTLO @@ -115,6 +115,191 @@ "Clear All" + + "712" + "eHomeBwdLimit" + + + + "530" + "eHomeBwdToEncRef" + + + + "386" + "eHomeBwdToEncRef2speed" + + + + "341" + "eHomeBwdToEncRef2speeds" + + + + "387" + "eHomeBwdToLimit2speeds" + + + + "964" + "eHomeBwdToRef" + + + + "35" + "eHomeBwdToRef2speeds" + + + + "650" + "eHomeBwdToReference" + + + + "480" + "eHomeBwdToReference2speed" + + + + "339" + "eHomeBwdToReference2speeds" + + + + "986" + "ehomeDirect" + + + + "328" + "eHomeFwdToEncRef" + + + + "125" + "eHomeFwdToEncRef2speeds" + + + + "484" + "eHomeFwdToEncRef_viaFwdLimit" + + + + "374" + "eHomeFwdToLimit" + + + + "851" + "eHomeFwdToLimit2speeds" + + + + "693" + "eHomeBwdToLimit" + + + + "489" + "eHomeBwdToLimit2speeds" + + + + "445" + "eHomeBwdToLimitspeeds" + + + + "637" + "eHomeFwdToLimit" + + + + "351" + "eHomeFwdToLimit2speeds" + + + + "198" + "eHomeToEncPulse_Bwd" + + + + "510" + "eHomeToEncPulse_Fwd" + + + + "287" + "eHomeToEncPulse_viaBwdLimit" + + + + "683" + "eHomeToEncPulse_viaFwdLimit" + + + + "535" + "eHomeToEncRefBwd" + + + + "367" + "eHomeToEncRefFwd" + + + + "358" + "eHomeToEncRef_viaBwdLimi" + + + + "740" + "eHomeToEncRef_viaBwdLimit" + + + + "689" + "eHomeToLimitBwd" + + + + "504" + "eHomeToLimitFwd" + + + + "312" + "eHomeToLimit_Bwd" + + + + "635" + "eHomeToLimit_Fwd" + + + + "432" + "eHomeToRefBwd" + + + + "285" + "eHomeToRefFwd" + + + + "150" + "eHomeToRef_Bwd" + + + + "861" + "eHomeToRef_Fwd" + + "104" "ENABLE" @@ -170,6 +355,21 @@ "fDeceleration" + + "531" + "fHomeFinishDistance" + + + + "613" + "fHomePosition" + + + + "157" + "fHomePositions" + + "957" "fPosition" @@ -205,6 +405,11 @@ "gearOut" + + "169" + "homeDirect" + + "566" "homeSensorNeg" @@ -270,6 +475,11 @@ "reset" + + "611" + "shomeDirect" + + "115" "stop" diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index c0a18e8..1404f21 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -9,11 +9,11 @@ VAR //Outputs: Power for Limit switches and Home Sensors (every 4th output) bOutput1 AT %Q*: BOOL := TRUE; - //bOutput5 AT %Q*: BOOL:= TRUE; - //bOutput13 AT %Q*: BOOL:= TRUE; - //bOutput17 AT %Q*: BOOL:= TRUE; - //bOutput21 AT %Q*: BOOL:= TRUE; - //bOutput24 AT %Q*: BOOL:= TRUE; + bOutput5 AT %Q*: BOOL:= TRUE; + bOutput13 AT %Q*: BOOL:= TRUE; + bOutput17 AT %Q*: BOOL:= TRUE; + bOutput21 AT %Q*: BOOL:= TRUE; + bOutput24 AT %Q*: BOOL:= TRUE; //bOutput28 AT %Q*: BOOL:= TRUE; //Startup, Shutdown and UPS @@ -131,7 +131,7 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN eCheckReadDone: //Check the encoder reference system has been read for all axis -> if busy then continue with PLC cycle and check again next time. //If afbReadEncRefSys not started then go back a step. - //If any axes result in an error the code will get stuck here, this happens if GVL_APP.nAxisNum is not set correctly + //If any axes result in an error the code will get stuck here, this happens if GVL_APP.nAXIS_NUM is not set correctly FOR iAxes := 1 TO GVL_APP.nAXIS_NUM DO IF afbReadEncRefSys[iAxes].Valid = FALSE THEN IF afbReadEncRefSys[iAxes].Busy = TRUE THEN diff --git a/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU index 14c9f5f..5c7c306 100644 --- a/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU +++ b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU @@ -10,6 +10,15 @@ END_VAR]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL index e80baa0..b88fff9 100644 --- a/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL +++ b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL @@ -14,6 +14,7 @@ fDEFAULT_TARGET_ACCELERATION: LREAL := 0.5; fDEFAULT_TARGET_DECCELERATION: LREAL := 0.5; fDEFAULT_TARGET_POSITION: LREAL := 10.0; fDEFAULT_TARGET_OVERRIDE: LREAL := 100; +nMAX_MASTERS : UINT := 4; END_VAR VAR_GLOBAL diff --git a/solution/tc_project_app/Test/standard_library_tests/E_TestStates.TcDUT b/solution/tc_project_app/Test/standard_library_tests/E_TestStates.TcDUT new file mode 100644 index 0000000..a280ecb --- /dev/null +++ b/solution/tc_project_app/Test/standard_library_tests/E_TestStates.TcDUT @@ -0,0 +1,22 @@ + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 08a5fd1..5759b66 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 08a5fd1399ee7f333765229a2737919377ea0e6e +Subproject commit 5759b662a1372e758f90b46f0c3142996dc0430b diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 23aa3e4..3f40c4c 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -90,7 +90,7 @@ Code - + Code @@ -112,9 +112,15 @@ Code + + Code + Code + + Code + Code From 29b9b5e959ceda030fec99f830c5780fc3113794 Mon Sep 17 00:00:00 2001 From: Paul Barron Date: Fri, 24 Apr 2020 10:54:17 +0200 Subject: [PATCH 2/2] Comment out bOutputs --- solution/tc_project_app/POUs/MAIN.TcPOU | 10 +++++----- solution/tc_project_app/tc_mca_std_lib | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 1404f21..23f225b 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -9,11 +9,11 @@ VAR //Outputs: Power for Limit switches and Home Sensors (every 4th output) bOutput1 AT %Q*: BOOL := TRUE; - bOutput5 AT %Q*: BOOL:= TRUE; - bOutput13 AT %Q*: BOOL:= TRUE; - bOutput17 AT %Q*: BOOL:= TRUE; - bOutput21 AT %Q*: BOOL:= TRUE; - bOutput24 AT %Q*: BOOL:= TRUE; + //bOutput5 AT %Q*: BOOL:= TRUE; + //bOutput13 AT %Q*: BOOL:= TRUE; + //bOutput17 AT %Q*: BOOL:= TRUE; + //bOutput21 AT %Q*: BOOL:= TRUE; + //bOutput24 AT %Q*: BOOL:= TRUE; //bOutput28 AT %Q*: BOOL:= TRUE; //Startup, Shutdown and UPS diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 5759b66..50f3bf8 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 5759b662a1372e758f90b46f0c3142996dc0430b +Subproject commit 50f3bf804385ffb3afd987829f28e0e698804054