From 7b8e207e87f05225055e996766c218dd06aad61c Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 14:07:59 +0100 Subject: [PATCH 1/8] Add folder for licenses A folder was created for pasting the licenses from the Beckhoff CPU as a backup. A ReadMe file was included explaining where the licenses are located. --- solution/Licenses/ReadMe_licenses.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 solution/Licenses/ReadMe_licenses.txt diff --git a/solution/Licenses/ReadMe_licenses.txt b/solution/Licenses/ReadMe_licenses.txt new file mode 100644 index 0000000..79e6b36 --- /dev/null +++ b/solution/Licenses/ReadMe_licenses.txt @@ -0,0 +1,5 @@ +Copy and paste in this folder the licenses contained inside the Beckhoff CPU in the path: + +C:\TwinCAT\3.1\Target\License + +Thank you \ No newline at end of file From d4874c197cc3c45216aaac54700b238f62248c07 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 14:16:52 +0100 Subject: [PATCH 2/8] Add "Homing" folder in the solution structure A folder called "Homing" containing all the FB required for homing is included --- solution/tc_project_app/tc_mca_std_lib | 2 +- .../tc_project_app/tc_project_app.plcproj | 75 ++++++++++--------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 69e0d49..9587a02 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 69e0d49b48ed70854277161ca56237ea1f1a5d51 +Subproject commit 9587a0273d0f872c5a563da3de43174270c9224c diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 2938caf..1cbdba5 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -295,36 +295,36 @@ Code - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - Code + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + + + Code + Code Visualization Manager.TcVMO @@ -357,6 +357,7 @@ + @@ -433,8 +434,8 @@ - - + + "<ProjectRoot>" {192FAD59-8248-4824-A8DE-9177C94C195A} @@ -482,14 +483,14 @@ - - - System.Collections.Hashtable - System.Int32 - {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} - System.String - - + + + System.Collections.Hashtable + System.Int32 + {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} + System.String + + \ No newline at end of file From 5d1adbccf29c23fef06f63cecb304d664addaad1 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 14:39:36 +0100 Subject: [PATCH 3/8] Delete the FB of hardware not used in error handling Delete all the hardware FB that are not supported by MCAG in the error handling folder --- solution/tc_project_app/tc_mca_std_lib | 2 +- .../tc_project_app/tc_project_app.plcproj | 163 ------------------ 2 files changed, 1 insertion(+), 164 deletions(-) diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 9587a02..a9210c1 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 9587a0273d0f872c5a563da3de43174270c9224c +Subproject commit a9210c1a0ec392025a9f0a80539359705ea66ce3 diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 1cbdba5..ab46038 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -70,159 +70,27 @@ Code - - Code - - - Code - - - Code - - - Code - - - Code - Code - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - Code Code - - Code - Code - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - Code - - Code - - - Code - - - Code - Code - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - Code - - Code - Code @@ -235,36 +103,6 @@ Code - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - - - Code - Code @@ -349,7 +187,6 @@ - From 2ef18dc1ebfcdb831b2345c1ac5046f82f72512a Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 14:46:57 +0100 Subject: [PATCH 4/8] Add error handling variables in MAIN Add the section for error handling variables in the MAIN puo. --- solution/tc_project_app/POUs/MAIN.TcPOU | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 46718c2..8f3f2f8 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -67,6 +67,16 @@ VAR //bOutput21 AT %Q*: BOOL:= TRUE; //bOutput24 AT %Q*: BOOL:= TRUE; //bOutput28 AT %Q*: BOOL:= TRUE; + +(******Error Handling********) + fbErrorList: FB_ErrorList; + // fbEL3214: EL3214; + //fbEL1808: EL1808; + //fbEL2819: EL2819; + //fbEL9410: EL9410; + +(*******New and specific related variables*********) + END_VAR ]]> From 2457083e950c91466acc7935fdd159cb37379d50 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 14:51:07 +0100 Subject: [PATCH 5/8] Add the actions AXES, ERROR and PROG to MAIN Three actions are in the MAIN AXES: contains the FB of each axis en FBD language EROR: Contians the FBs necessary for error handling PROG: space for sequencing, safety or anything else application specific --- solution/tc_project_app/POUs/MAIN.TcPOU | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 8f3f2f8..d5c4635 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -81,9 +81,11 @@ END_VAR ]]> - + - + @@ -1783,8 +1785,25 @@ END_VAR + + + + + + + + + + + + + + + + + \ No newline at end of file From 9442e7d1a27ff6e2ddc06b5b48377b27e14b220c Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 15:16:57 +0100 Subject: [PATCH 6/8] Add default instance call (FB) for the error handling In the action ERROR() the necessary default instances are included an example nin comments is included Build solution without an error --- solution/solution.tsproj | 58 ++++++++++++++++--- solution/tc_project_app/POUs/MAIN.TcPOU | 53 +++++++++++++++-- solution/tc_project_app/tc_mca_std_lib | 2 +- .../tc_project_app/tc_project_app.plcproj | 4 ++ 4 files changed, 102 insertions(+), 15 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 75d2c60..5a083bc 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1143,6 +1143,46 @@ External Setpoint Generation: + + MAIN.fbEL1808.Channel_1_Input + BOOL + + + MAIN.fbEL1808.Channel_2_Input + BOOL + + + MAIN.fbEL1808.Channel_3_Input + BOOL + + + MAIN.fbEL1808.Channel_4_Input + BOOL + + + MAIN.fbEL1808.Channel_5_Input + BOOL + + + MAIN.fbEL1808.Channel_6_Input + BOOL + + + MAIN.fbEL1808.Channel_7_Input + BOOL + + + MAIN.fbEL1808.Channel_8_Input + BOOL + + + MAIN.fbEL1808.WcState_WcState + BOOL + + + MAIN.fbEL1808.InfoData_State + UINT + PlcTask Outputs @@ -1171,15 +1211,6 @@ bHomeSensor8 AT %I*: BOOL; BOOL - - MAIN.bOutput5 - - - - BOOL - MAIN.M1Link.Axis.PlcToNc PLCTONC_AXIS_REF @@ -1196,6 +1227,15 @@ bOutput4 AT %Q*: BOOL:= TRUE;]]> MAIN.M2.MasterAxis.PlcToNc PLCTONC_AXIS_REF + + MAIN.bOutput5 + + + + BOOL + diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index d5c4635..35ae024 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -70,12 +70,12 @@ VAR (******Error Handling********) fbErrorList: FB_ErrorList; - // fbEL3214: EL3214; - //fbEL1808: EL1808; + //fbEL3214: EL3214; + fbEL1808: EL1808; //fbEL2819: EL2819; //fbEL9410: EL9410; -(*******New and specific related variables*********) +(*******New and specific application variables*********) END_VAR @@ -1787,12 +1787,45 @@ ERROR();]]> - + , + nNoError=> , + nNoOverflow=> , + pErrorSystem=> ); + +(*call all the necessary instance (input assistance F2 or right click) according to the terminals that you have in your hardware and + add "TRUE" in the input En, the corresponding number of termianl to the iTerminal_ID and +the variable "fbErrorList.pErrorSystem" to the input ErrorSystem in each FB E. g. : +fbEL1808( + En:= TRUE, + iTerminal_ID:= 1, + ErrorSystem:= fbErrorList.pErrorSystem, + EnO=> , + bDi_1=> , + bDi_2=> , + bDi_3=> , + bDi_4=> , + bDi_5=> , + bDi_6=> , + bDi_7=> , + bDi_8=> , + bError=> ); *) +// +]]> - + @@ -1800,10 +1833,20 @@ ERROR();]]> + + + + + + + + + + \ 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 a9210c1..36db316 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit a9210c1a0ec392025a9f0a80539359705ea66ce3 +Subproject commit 36db316d338167450d1c536e26b551a556f8ad6d diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index ab46038..1fc0c8e 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -242,6 +242,10 @@ true 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae + + Tc2_EtherCAT, * (Beckhoff Automation GmbH) + Tc2_EtherCAT + Tc2_MC2, * (Beckhoff Automation GmbH) Tc2_MC2 From e42fca65aa74260c79432ce0672c06b87bdfaaff Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 15:25:47 +0100 Subject: [PATCH 7/8] Submodule std_lib updated Update to new master branch --- solution/tc_project_app/tc_mca_std_lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 36db316..69e0d49 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 36db316d338167450d1c536e26b551a556f8ad6d +Subproject commit 69e0d49b48ed70854277161ca56237ea1f1a5d51 From 88141fd42acc8af739b30840d7fb271f0e25ee76 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Tue, 30 Oct 2018 15:36:17 +0100 Subject: [PATCH 8/8] Updated my solution to use latest submodule mca_std_lib --- solution/tc_project_app/tc_mca_std_lib | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib index 69e0d49..c22aa9e 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 69e0d49b48ed70854277161ca56237ea1f1a5d51 +Subproject commit c22aa9e56dda5c55ba6e85bb6e1121a87d9ae404