From 6e723594b562583b6eb6e7caa98258d6bac580e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 9 Dec 2019 10:30:41 +0100 Subject: [PATCH 01/42] bitbucket-pipelines.yml: Don't run git submodule The command `git submodule update --init` already shows us the versions of the submodules. There is no need to run `git submodule` after that - renove it. --- bitbucket-pipelines.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml index d47cd1d..873f48c 100644 --- a/bitbucket-pipelines.yml +++ b/bitbucket-pipelines.yml @@ -6,6 +6,5 @@ pipelines: - step: script: - git submodule update --init - - git submodule - python twincat_version_manager.py - python check_fix_white_space.py From a57ae08ebe526bf7ac1233f9dabae839414b0e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 9 Dec 2019 11:00:50 +0100 Subject: [PATCH 02/42] check_fix_white_space.py: Hint the user about --fix When the script detects whitespace damage, hint the user that the same script can fix it. --- check_fix_white_space.py | 1 + 1 file changed, 1 insertion(+) diff --git a/check_fix_white_space.py b/check_fix_white_space.py index cf6fe3c..c03a737 100755 --- a/check_fix_white_space.py +++ b/check_fix_white_space.py @@ -90,6 +90,7 @@ if __name__ == "__main__": for file in incorrect_files: print("ERROR: '{}' has white space damage".format(file)) if incorrect_files: + print('run %s --fix' % sys.argv[0]) exit(1) except IOError as e: print(e) # Likely no files found From 608f6c03357cf2b0446cfcd53a6b990844965cfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 9 Dec 2019 11:10:07 +0100 Subject: [PATCH 03/42] check_fix_white_space.py: Tell user about TAB and/or trailing WS Make the output of the script more descriptive: Tell user what was wrong, either TAB or trailing WS (or both) --- check_fix_white_space.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/check_fix_white_space.py b/check_fix_white_space.py index c03a737..854e5e2 100755 --- a/check_fix_white_space.py +++ b/check_fix_white_space.py @@ -26,6 +26,8 @@ def fix_white_space(debug, fix_files): for pathname in found_files: dirty = False + had_TAB = False + had_trailing_WS = False new_lines = [] if debug >= 1: print("tab_with=%d pathname=%s" % (tab_width, pathname)) @@ -41,8 +43,16 @@ def fix_white_space(debug, fix_files): had_crlf = 1 # LF # Convert all TAB into SPACE new_line = old_line.expandtabs(tabsize=tab_width) - # Strip of all trailing white space, including the CRLF - new_line = new_line.rstrip("\r\n ") + if new_line != old_line: + had_TAB = True + # Strip the CRLF + new_line = new_line.rstrip("\r\n") + # Strip trailing WS + tmp_line = new_line.rstrip(" ") + if tmp_line != new_line: + had_trailing_WS = True + new_line = tmp_line + if had_crlf == 2: new_line = new_line + '\r\n' elif had_crlf == 1: @@ -61,7 +71,12 @@ def fix_white_space(debug, fix_files): if debug >= 1: print("pathname=%s dirty=%d" % (pathname, dirty)) if dirty: - incorrect_files[pathname] = True + if had_TAB and had_trailing_WS: + incorrect_files[pathname] = 'has white space damage' + elif had_TAB: + incorrect_files[pathname] = 'has TAB' + elif had_trailing_WS: + incorrect_files[pathname] = 'has trailing whitespace' if fix_files: file = open(pathname, 'w', newline='', encoding="iso-8859-1") file.writelines(new_lines) @@ -88,7 +103,8 @@ if __name__ == "__main__": incorrect_files = fix_white_space(debug, fix_files) if not fix_files: for file in incorrect_files: - print("ERROR: '{}' has white space damage".format(file)) + message = incorrect_files[file] + print("ERROR: '{}' {}".format(file,message)) if incorrect_files: print('run %s --fix' % sys.argv[0]) exit(1) From 3edb9fd098fdd09002d60594147ba47790179f26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 9 Dec 2019 11:21:05 +0100 Subject: [PATCH 04/42] check_fix_white_space.py: Fix whitespace damage --- check_fix_white_space.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_fix_white_space.py b/check_fix_white_space.py index 854e5e2..6597e58 100755 --- a/check_fix_white_space.py +++ b/check_fix_white_space.py @@ -44,7 +44,7 @@ def fix_white_space(debug, fix_files): # Convert all TAB into SPACE new_line = old_line.expandtabs(tabsize=tab_width) if new_line != old_line: - had_TAB = True + had_TAB = True # Strip the CRLF new_line = new_line.rstrip("\r\n") # Strip trailing WS @@ -104,7 +104,7 @@ if __name__ == "__main__": if not fix_files: for file in incorrect_files: message = incorrect_files[file] - print("ERROR: '{}' {}".format(file,message)) + print("ERROR: '{}' {}".format(file,message)) if incorrect_files: print('run %s --fix' % sys.argv[0]) exit(1) From 3257c21d12bc5c8b26b7b8cab45797a857669250 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Tue, 24 Dec 2019 10:29:00 +0000 Subject: [PATCH 05/42] Added tcUNIT, including helper functions and app test folder, to generic structure --- .../tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU | 22 ++ .../tcUNIT/common/FB_tcUNIT_common.TcPOU | 193 ++++++++++++++++++ .../tcUNIT/common/tcUNIT_GVL.TcGVL | 28 +++ .../tc_project_app/tc_project_app.tmcRefac | 20 ++ 4 files changed, 263 insertions(+) create mode 100644 solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU create mode 100644 solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU create mode 100644 solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL create mode 100644 solution/tc_project_app/tc_project_app.tmcRefac diff --git a/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU new file mode 100644 index 0000000..b4bdf8c --- /dev/null +++ b/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU @@ -0,0 +1,22 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU b/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU new file mode 100644 index 0000000..3a5cc14 --- /dev/null +++ b/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU @@ -0,0 +1,193 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL new file mode 100644 index 0000000..3b89d11 --- /dev/null +++ b/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL @@ -0,0 +1,28 @@ + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_project_app.tmcRefac b/solution/tc_project_app/tc_project_app.tmcRefac new file mode 100644 index 0000000..595f28a --- /dev/null +++ b/solution/tc_project_app/tc_project_app.tmcRefac @@ -0,0 +1,20 @@ + + + + + TCUNIT_RUN + tcUNIT_STD_LIB_1 + tcUNIT_APP_RUN + + + PrepareMove + motionStrategy + eMotionStrategy + + + TCUNIT_STD_LIB_1 + tcUNIT_STD_LIB_1 + tcUNIT_APP_RUN + + + \ No newline at end of file From 7c1c9eadcf82af4f54a58cfbac3adf57caec1214 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Tue, 24 Dec 2019 10:37:06 +0000 Subject: [PATCH 06/42] Removed trailing CR --- .../tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU | 7 +--- .../tcUNIT/common/FB_tcUNIT_common.TcPOU | 39 ++++++------------- .../tcUNIT/common/tcUNIT_GVL.TcGVL | 3 +- 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU index b4bdf8c..bfdf84b 100644 --- a/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU +++ b/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU @@ -8,15 +8,12 @@ PROGRAM tcUNIT_APP_RUN VAR (* Declare standard library POU tests to be run E.g. fbMoveNonLinearSlits: FB_MoveNonLinearSlits_Test; *) -END_VAR -]]> +END_VAR]]> - + - \ No newline at end of file diff --git a/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU b/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU index 3a5cc14..844227f 100644 --- a/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU +++ b/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU @@ -5,8 +5,7 @@ FUNCTION_BLOCK FB_tcUNIT_common VAR -END_VAR -]]> +END_VAR]]> @@ -18,26 +17,22 @@ END_VAR VAR i: INT := 0; -END_VAR -]]> +END_VAR]]> +END_WHILE]]> +END_VAR]]> +Cycle(1); // Cycle the PLC to ensure the values have been set and results can be taken]]> @@ -48,8 +43,7 @@ END_VAR VAR_INPUT MotionStrategy: MotionFunctions; // The motion strategy to be used in the move -END_VAR -]]> +END_VAR]]> +Cycle(1); // Cycle the PLC to ensure the values have been set and results can be taken]]> @@ -86,8 +79,7 @@ VAR_INPUT fTargetDeceleration: LREAL; fTargetPosition: LREAL; eMotionStrategy: MotionFunctions; -END_VAR -]]> +END_VAR]]> +Cycle(1); // Cycle the PLC to ensure the values have been set and results can be taken]]> +END_VAR]]> +Cycle(1); // Cycle the PLC to ensure the values have been set and results can be taken]]> @@ -144,13 +133,12 @@ Cycle(1); // Cycle the PLC to ensure the values have been set and results can - + - @@ -163,14 +151,12 @@ Cycle(1); // Cycle the PLC to ensure the values have been set and results can - - @@ -187,7 +173,6 @@ Cycle(1); // Cycle the PLC to ensure the values have been set and results can - \ No newline at end of file diff --git a/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL index 3b89d11..ed05340 100644 --- a/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL +++ b/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL @@ -22,7 +22,6 @@ END_VAR VAR_GLOBAL iAxis: INT; -END_VAR -]]> +END_VAR]]> \ No newline at end of file From 30c80940c724060b4073e6a9406412a53bdaa600 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Tue, 24 Dec 2019 11:07:12 +0000 Subject: [PATCH 07/42] Renamed tcUNIT folder to Test --- .../{tcUNIT => Test}/app_tests/tcUNIT_APP_RUN.TcPOU | 0 .../tc_project_app/{tcUNIT => Test}/common/FB_tcUNIT_common.TcPOU | 0 solution/tc_project_app/{tcUNIT => Test}/common/tcUNIT_GVL.TcGVL | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename solution/tc_project_app/{tcUNIT => Test}/app_tests/tcUNIT_APP_RUN.TcPOU (100%) rename solution/tc_project_app/{tcUNIT => Test}/common/FB_tcUNIT_common.TcPOU (100%) rename solution/tc_project_app/{tcUNIT => Test}/common/tcUNIT_GVL.TcGVL (100%) diff --git a/solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU similarity index 100% rename from solution/tc_project_app/tcUNIT/app_tests/tcUNIT_APP_RUN.TcPOU rename to solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU diff --git a/solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU similarity index 100% rename from solution/tc_project_app/tcUNIT/common/FB_tcUNIT_common.TcPOU rename to solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU diff --git a/solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL similarity index 100% rename from solution/tc_project_app/tcUNIT/common/tcUNIT_GVL.TcGVL rename to solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL From f0037bcaba4689ae1588f83b9b47414c478d20b9 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Tue, 24 Dec 2019 11:36:25 +0000 Subject: [PATCH 08/42] Added std_lib unit tests --- .../_Config/NC/Axes/tcUNIT_virtual_axis.xti | 1525 +++++++++++++++++ solution/_Config/NC/NC.xti | 21 + solution/solution.tsproj | 5 +- solution/tc_project_app/PlcTask.TcTTO | 3 + .../standard_library_tests/FB_Axis_TEST.TcPOU | 230 +++ .../tcUNIT_STD_LIB_RUN.TcPOU | 17 + .../tc_project_app/tc_project_app.plcproj | 25 +- .../tc_project_app/tc_project_app.tmcRefac | 20 - 8 files changed, 1824 insertions(+), 22 deletions(-) create mode 100644 solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti create mode 100644 solution/_Config/NC/NC.xti create mode 100644 solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU create mode 100644 solution/tc_project_app/Test/standard_library_tests/tcUNIT_STD_LIB_RUN.TcPOU delete mode 100644 solution/tc_project_app/tc_project_app.tmcRefac diff --git a/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti b/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti new file mode 100644 index 0000000..87ec62b --- /dev/null +++ b/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti @@ -0,0 +1,1525 @@ + + + + + UINTARR2 + 32 + UINT + + 0 + 2 + + + [%u, %u] + [0] + [1] + + + 0x%08x [%u, %u] + . + [0] + [1] + + + 0x%08x (%u) + . + . + + + + NCENCODERSTRUCT_IN2B + 320 + + nDataIn1 + UINTARR2 + 32 + 0 + + + nDataIn2 + UINTARR2 + 32 + 32 + + + nState1 + USINT + 8 + 64 + + + nState2 + USINT + 8 + 72 + + + nState3 + USINT + 8 + 80 + + + nState4 + USINT + + 8 + 88 + + + nDataIn3 + UINTARR2 + 32 + 96 + + + nDataIn4 + UINTARR2 + 32 + 128 + + + nDataIn5 + UINTARR2 + 32 + 160 + + + nDataIn6 + UINTARR2 + 32 + 192 + + + nState5 + USINT + 8 + 224 + + + nState6 + USINT + 8 + 232 + + + nState7 + USINT + 8 + 240 + + + nState8 + USINT + 8 + 248 + + + nDcInputTime + DINT + 32 + 256 + + + nDataIn7 + UINTARR2 + 32 + 288 + + + + NCENCODERSTRUCT_IN + + 96 + + + + + + NCENCODERSTRUCT_OUT2 + 320 + + nDataOut1 + UINTARR2 + 32 + 0 + + + nDataOut2 + UINTARR2 + 32 + 32 + + + nCtrl1 + USINT + 8 + 64 + + + nCtrl2 + USINT + 8 + 72 + + + nCtrl3 + USINT + 8 + 80 + + + nCtrl4 + USINT + 8 + 88 + + + nDataOut3 + UINTARR2 + 32 + 96 + + + nDataOut4 + UINTARR2 + 32 + 128 + + + nDataOut5 + UINTARR2 + 32 + 160 + + + nDataOut6 + UINTARR2 + 32 + 192 + + + nCtrl5 + USINT + 8 + 224 + + + nCtrl6 + USINT + 8 + 232 + + + nCtrl7 + USINT + 8 + 240 + + + nCtrl8 + USINT + 8 + 248 + + + + NCENCODERSTRUCT_OUT + + 96 + + + + + + NCDRIVESTRUCT_IN2 + 320 + + nDataIn1 + UINTARR2 + 32 + 0 + + + nDataIn2 + UINTARR2 + 32 + 32 + + + nState1 + USINT + 8 + 64 + + + nState2 + USINT + 8 + 72 + + + nState3 + USINT + 8 + 80 + + + nState4 + USINT + + 8 + 88 + + + nDataIn3 + UINTARR2 + 32 + 96 + + + nDataIn4 + UINTARR2 + 32 + 128 + + + nDataIn5 + UINTARR2 + 32 + 160 + + + nDataIn6 + UINTARR2 + 32 + 192 + + + nState5 + USINT + 8 + 224 + + + nState6 + USINT + 8 + 232 + + + nState7 + USINT + 8 + 240 + + + nState8 + USINT + 8 + 248 + + + nDcOutputTime + DINT + 32 + 256 + + + + NCDRIVESTRUCT_IN + + 96 + + + + + + NCDRIVESTRUCT_OUT2 + 320 + + nDataOut1 + UINTARR2 + 32 + 0 + + + nDataOut2 + UINTARR2 + 32 + 32 + + + nCtrl1 + USINT + 8 + 64 + + + nCtrl2 + USINT + 8 + 72 + + + nCtrl3 + USINT + 8 + 80 + + + nCtrl4 + USINT + 8 + 88 + + + nDataOut3 + UINTARR2 + 32 + 96 + + + nDataOut4 + UINTARR2 + 32 + 128 + + + nDataOut5 + UINTARR2 + 32 + 160 + + + nDataOut6 + UINTARR2 + 32 + 192 + + + nCtrl5 + USINT + 8 + 224 + + + nCtrl6 + USINT + 8 + 232 + + + nCtrl7 + USINT + 8 + 240 + + + nCtrl8 + USINT + 8 + 248 + + + + NCDRIVESTRUCT_OUT + + 96 + + + + + + PLCTONC_AXIS_REF_CTRL + 32 + + Enable + BIT + 1 + 0 + + + FeedEnablePlus + BIT + 1 + 1 + + + FeedEnableMinus + BIT + 1 + 2 + + + HomingSensor + BIT + 1 + 5 + + + AcceptBlockedDrive + BIT + 1 + 8 + + + PlcDebugFlag + BIT + 1 + 30 + + + NcDebugFlag + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + PLCTONC_AXIS_REF + 1024 + + ControlDWord + PLCTONC_AXIS_REF_CTRL + 32 + 0 + + + Override + UDINT + 32 + 32 + + + AxisModeRequest + UDINT + 32 + 64 + + + AxisModeDWord + UDINT + 32 + 96 + + + AxisModeLReal + LREAL + 64 + 128 + + + PositionCorrection + LREAL + 64 + 192 + + + ExtSetPos + LREAL + 64 + 256 + + + ExtSetVelo + LREAL + 64 + 320 + + + ExtSetAcc + LREAL + 64 + 384 + + + ExtSetDirection + DINT + 32 + 448 + + + ExtControllerOutput + LREAL + 64 + 512 + + + GearRatio1 + LREAL + 64 + 576 + + + GearRatio2 + LREAL + 64 + 640 + + + GearRatio3 + LREAL + 64 + 704 + + + GearRatio4 + LREAL + 64 + 768 + + + MapState + BOOL + 8 + 832 + + + PlcCycleControl + BYTE + 8 + 840 + + + PlcCycleCount + BYTE + 8 + 848 + + + + NcStructType + 1 + + + + + NCAXLESTRUCT_FROMPLC3 + + + + + NCTOPLC_AXIS_REF_STATE + 32 + + Operational + BIT + 1 + 0 + + + Homed + BIT + 1 + 1 + + + NotMoving + BIT + 1 + 2 + + + InPositionArea + BIT + 1 + 3 + + + InTargetPosition + BIT + 1 + 4 + + + Protected + BIT + 1 + 5 + + + ErrorPropagationDelayed + BIT + 1 + 6 + + + HasBeenStopped + BIT + 1 + 7 + + + HasJob + BIT + 1 + 8 + + + PositiveDirection + BIT + 1 + 9 + + + NegativeDirection + BIT + 1 + 10 + + + HomingBusy + BIT + 1 + 11 + + + ConstantVelocity + BIT + 1 + 12 + + + Compensating + BIT + 1 + 13 + + + ExtSetPointGenEnabled + BIT + 1 + 14 + + + PhasingActive + BIT + 1 + 15 + + + ExternalLatchValid + BIT + 1 + 16 + + + NewTargetPos + BIT + 1 + 17 + + + ContinuousMotion + BIT + 1 + 19 + + + ControlLoopClosed + BIT + 1 + 20 + + + CamTableQueued + BIT + 1 + 21 + + + CamDataQueued + BIT + 1 + 22 + + + CamScalingPending + BIT + 1 + 23 + + + CmdBuffered + BIT + 1 + 24 + + + PTPmode + BIT + 1 + 25 + + + SoftLimitMinExceeded + BIT + 1 + 26 + + + SoftLimitMaxExceeded + BIT + 1 + 27 + + + DriveDeviceError + BIT + 1 + 28 + + + MotionCommandsLocked + BIT + 1 + 29 + + + IoDataInvalid + BIT + 1 + 30 + + + Error + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_OPMODE + 32 + + OpModePosAreaMonitoring + BIT + 1 + 0 + + + OpModeTargetPosMonitoring + BIT + 1 + 1 + + + OpModeLoop + BIT + 1 + 2 + + + OpModeMotionMonitoring + BIT + 1 + 3 + + + OpModePEHTimeMonitoring + BIT + 1 + 4 + + + OpModeBacklashCompensation + BIT + 1 + 5 + + + OpModeDelayedErrorReaction + BIT + 1 + 6 + + + OpModeModulo + BIT + 1 + 7 + + + OpModeSimulationAxis + BIT + 1 + 8 + + + OpModePosLagMonitoring + BIT + 1 + 16 + + + OpModeVeloLagMonitoring + BIT + 1 + 17 + + + OpModeSoftLimitMinMonitoring + BIT + 1 + 18 + + + OpModeSoftLimitMaxMonitoring + BIT + 1 + 19 + + + OpModePosCorrection + BIT + 1 + 20 + + + OpModeAllowSlaveCommands + BIT + 1 + 21 + + + OpModeAllowExtSetAxisCommands + BIT + 1 + 22 + + + ApplicationRequest + BIT + 1 + 23 + + + + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + + AvoidingCollision + BIT + 1 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_STATE2 + 32 + + Value + DWORD + 32 + 0 + + + Flags + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + 8 + + CamActivationPending + BIT + 1 + 0 + + + CamDeactivationPending + BIT + 1 + 1 + + + CamActive + BIT + 1 + 2 + + + CamDataQueued + BIT + 1 + 6 + + + CamScalingPending + BIT + 1 + 7 + + + + UINTARR8 + 128 + UINT + + 0 + 8 + + + + NCTOPLC_AXIS_REF + 2048 + + StateDWord + NCTOPLC_AXIS_REF_STATE + 32 + 0 + + + ErrorCode + UDINT + 32 + 32 + + + AxisState + UDINT + + 32 + 64 + + + AxisModeConfirmation + UDINT + 32 + 96 + + + HomingState + UDINT + + 32 + 128 + + + CoupleState + UDINT + + 32 + 160 + + + SvbEntries + UDINT + 32 + 192 + + + SafEntries + UDINT + 32 + 224 + + + AxisId + UDINT + 32 + 256 + + + OpModeDWord + NCTOPLC_AXIS_REF_OPMODE + 32 + 288 + + + ActPos + LREAL + 64 + 320 + + + ModuloActPos + LREAL + 64 + 384 + + + ActiveControlLoopIndex + UINT + 16 + 448 + + + ControlLoopIndex + UINT + 16 + 464 + + + ModuloActTurns + DINT + 32 + 480 + + + ActVelo + LREAL + 64 + 512 + + + PosDiff + LREAL + 64 + 576 + + + SetPos + LREAL + 64 + 640 + + + SetVelo + LREAL + 64 + 704 + + + SetAcc + LREAL + 64 + 768 + + + TargetPos + LREAL + 64 + 832 + + + ModuloSetPos + LREAL + 64 + 896 + + + ModuloSetTurns + DINT + 32 + 960 + + + CmdNo + UINT + 16 + 992 + + + CmdState + UINT + 16 + 1008 + + + SetJerk + LREAL + 64 + 1024 + + + SetTorque + LREAL + 64 + 1088 + + + ActTorque + LREAL + 64 + 1152 + + + StateDWord2 + NCTOPLC_AXIS_REF_STATE2 + 32 + 1216 + + + StateDWord3 + DWORD + 32 + 1248 + + + TouchProbeState + DWORD + 32 + 1280 + + + TouchProbeCounter + DWORD + 32 + 1312 + + + CamCouplingState + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + + 0 + 8 + + 64 + 1344 + + + CamCouplingTableID + UINTARR8 + 128 + 1408 + + + ActTorqueDerivative + LREAL + 64 + 1536 + + + SetTorqueDerivative + LREAL + 64 + 1600 + + + ActPosWithoutPosCorrection + LREAL + 64 + 1792 + + + ActAcc + LREAL + 64 + 1856 + + + DcTimeStamp + UDINT + 32 + 1920 + + + + NcStructType + 2 + + + + + NCAXLESTRUCT_TOPLC + + + NCAXLESTRUCT_TOPLC2 + + + NCAXLESTRUCT_TOPLC3 + + + NCAXLESTRUCT_TOPLC4 + + + + + + + + + + + + + + + __FILENAME__ + + + + + + Inputs + + In + NCENCODERSTRUCT_IN2B + 1024 + + nDataIn1 + + + nDataIn2 + + + nState4 + + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + nDataIn7 + + + + + Outputs + + Out + NCENCODERSTRUCT_OUT2 + 2048 + + nDataOut1 + + + nDataOut2 + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + Inputs + + In + NCDRIVESTRUCT_IN2 + 1344 + + nDataIn1 + + + nDataIn2 + + + nState4 + + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + + + Outputs + + Out + NCDRIVESTRUCT_OUT2 + 2368 + + nDataOut1 + + + nDataOut2 + + + nCtrl2 + + + + nCtrl3 + + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + + Inputs + + FromPlc + PLCTONC_AXIS_REF + + + + Outputs + + ToPlc + NCTOPLC_AXIS_REF + + AxisState + + + + HomingState + + + + CoupleState + + + + + + diff --git a/solution/_Config/NC/NC.xti b/solution/_Config/NC/NC.xti new file mode 100644 index 0000000..2c8f8d7 --- /dev/null +++ b/solution/_Config/NC/NC.xti @@ -0,0 +1,21 @@ + + + + + NC-Task 1 SAF + + Inputs + + + Outputs + + + Image + + + + NC-Task 1 SVB + + + + diff --git a/solution/solution.tsproj b/solution/solution.tsproj index f74cba4..8c3ec91 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -873,7 +873,7 @@ External Setpoint Generation: - + @@ -889,6 +889,9 @@ External Setpoint Generation: + + + diff --git a/solution/tc_project_app/PlcTask.TcTTO b/solution/tc_project_app/PlcTask.TcTTO index b5badec..3be8aea 100644 --- a/solution/tc_project_app/PlcTask.TcTTO +++ b/solution/tc_project_app/PlcTask.TcTTO @@ -7,6 +7,9 @@ MAIN + + tcUNIT_STD_LIB_RUN + {26d89752-95b4-4b52-80c0-c79242bc34d7} {137c4fd1-c794-4dee-a041-b4fea1d22866} {2478772d-357b-433f-886f-15340bef9bdf} diff --git a/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU new file mode 100644 index 0000000..59ff389 --- /dev/null +++ b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU @@ -0,0 +1,230 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/Test/standard_library_tests/tcUNIT_STD_LIB_RUN.TcPOU b/solution/tc_project_app/Test/standard_library_tests/tcUNIT_STD_LIB_RUN.TcPOU new file mode 100644 index 0000000..e7cb079 --- /dev/null +++ b/solution/tc_project_app/Test/standard_library_tests/tcUNIT_STD_LIB_RUN.TcPOU @@ -0,0 +1,17 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index b5d34ae..d880255 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -29,6 +29,15 @@ Code + + Code + + + Code + + + Code + Code @@ -229,6 +238,12 @@ Code + + Code + + + Code + Code @@ -236,6 +251,9 @@ + + + @@ -256,6 +274,7 @@ + @@ -334,6 +353,10 @@ Tc3_Module, * (Beckhoff Automation GmbH) Tc3_Module + + TcUnit, * (www.tcunit.org) + TcUnit + VisuDialogs, * (System) VisuDialogs @@ -346,7 +369,7 @@ - Tc2_MC2, 3.3.28.0 (Beckhoff Automation GmbH) + Tc2_MC2, * (Beckhoff Automation GmbH) diff --git a/solution/tc_project_app/tc_project_app.tmcRefac b/solution/tc_project_app/tc_project_app.tmcRefac deleted file mode 100644 index 595f28a..0000000 --- a/solution/tc_project_app/tc_project_app.tmcRefac +++ /dev/null @@ -1,20 +0,0 @@ - - - - - TCUNIT_RUN - tcUNIT_STD_LIB_1 - tcUNIT_APP_RUN - - - PrepareMove - motionStrategy - eMotionStrategy - - - TCUNIT_STD_LIB_1 - tcUNIT_STD_LIB_1 - tcUNIT_APP_RUN - - - \ No newline at end of file From 1079229ffb7948f452ddd2b3b5515f9300a066db Mon Sep 17 00:00:00 2001 From: Simon-Cooper <39404307+Simon-Cooper@users.noreply.github.com> Date: Fri, 7 Feb 2020 10:17:46 +0000 Subject: [PATCH 09/42] ALLOW LOCAL SIMULATIONS TO BYBASS UPS CHECK Add CHECK_UPS action to house monitoring of the UPS global status Modify RESTORE_POSITIONS state machine to remove numerical enumeration usage Add device identity functionblock to check whether local simulation or CX Add POSITION RECOVERY action to check device type and determine whether to run position restore and ups checking Add solution/_Config/ folder to gitignore to remove NC and IO --- .gitignore | 1 + solution/solution.tsproj | 129 ++++++++---------------- solution/tc_project_app/POUs/MAIN.TcPOU | 73 +++++++++----- 3 files changed, 91 insertions(+), 112 deletions(-) diff --git a/.gitignore b/.gitignore index 8f8c117..cab1dc8 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,4 @@ logs.0* solution/TrialLicense.tclrs tools/linux/ADS/ tools/linux/getADSState/getADSState.bin +_Config/ diff --git a/solution/solution.tsproj b/solution/solution.tsproj index f74cba4..5dd70ed 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1,8 +1,8 @@ - + - NCTOPLC_AXIS_REF_STATE + NCTOPLC_AXIS_REF_STATE 32 Operational @@ -112,6 +112,12 @@ 1 17 + + IsDriveLimitActive + BIT + 1 + 18 + ContinuousMotion BIT @@ -199,6 +205,11 @@ 16#%08X + + + {4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D} + + NCTOPLC_AXIS_REF_OPMODE @@ -394,11 +405,11 @@ - NCTOPLC_AXIS_REF + NCTOPLC_AXIS_REF 2048 StateDWord - NCTOPLC_AXIS_REF_STATE + NCTOPLC_AXIS_REF_STATE 32 0 @@ -646,6 +657,18 @@ External Setpoint Generation: 64 1600 + + AbsPhasingPos + LREAL + 64 + 1664 + + + TorqueOffset + LREAL + 64 + 1728 + ActPosWithoutPosCorrection LREAL @@ -692,6 +715,9 @@ External Setpoint Generation: + + + @@ -873,7 +899,7 @@ External Setpoint Generation: - + @@ -889,6 +915,9 @@ External Setpoint Generation: + + + @@ -927,46 +956,7 @@ External Setpoint Generation: GVL.axes[1].Axis.NcToPlc - NCTOPLC_AXIS_REF - - AxisState - - - - HomingState - - - - CoupleState - - + NCTOPLC_AXIS_REF GVL.axes[2].inputs.bLimitFwd @@ -990,46 +980,7 @@ External Setpoint Generation: GVL.axes[2].Axis.NcToPlc - NCTOPLC_AXIS_REF - - AxisState - - - - HomingState - - - - CoupleState - - + NCTOPLC_AXIS_REF @@ -1055,4 +1006,12 @@ External Setpoint Generation: + + + + + + + + diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index f81cabd..5eebc02 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -1,5 +1,5 @@  - + - + + + + + + + + + + eSUPS_PowerFailure THEN +ELSIF eGlobalSUpsState <> eSUPS_PowerOK THEN (* next cycles of powerfailure *) (* skip regular code execution for the remaining cycles of the powerfailure/writing of persistent data/quick shutdown ... *) RETURN; -END_IF - -RESTORE_POSITIONS(); -PROG(); -AXES(); -ERROR();]]> - - - - +END_IF]]> @@ -121,6 +126,15 @@ fbEL1808( ]]> + + + '0') THEN + CHECK_UPS(); + RESTORE_POSITIONS(); +END_IF]]> + + - + if busy then continue with PLC cycle and check again next time. @@ -199,14 +213,14 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN // .valid=FALSE and .busy=FALSE which indicateds the FB probably hasn't started and thus needs to see a rising edge. // Set execute to low, Exit MAIN.STARTUP and go back a step in the CASE statement. bExecuteReadEncRefSys:=FALSE; - eStartUp:=eStartUp-1; + eStartUp:=ReadAxisFeedbackType; iRetry:=iRetry+1; // counter used for troubleshooting to see how many cycles it takes before fbReadEncRefSys function blocks are read correctly RETURN; END_IF END_IF END_FOR // If the code gets here all axes either have .valid=TRUE for all axes - eStartUp:=eStartUp+1; + eStartUp:= ExecuteRestore; ExecuteRestore: // Execute position restore by setting fbRestorePosition.execute = TRUE @@ -217,7 +231,7 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN END_IF END_IF END_FOR - eStartUp:=eStartUp+1; + eStartUp:= CheckRestore; CheckRestore: // Check the set position fbs are finished @@ -232,7 +246,7 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN END_IF END_IF END_FOR - eStartUp:=eStartUp+1; + eStartUp:= FinishRestore; FinishRestore: // Remove execute = TRUE for fbRestorePosition @@ -245,7 +259,7 @@ IF bRestoreExecute AND NOT bPositionRestoreDone THEN END_IF]]> - + - - - - + @@ -271,6 +282,10 @@ END_FOR]]> + + + + @@ -287,6 +302,10 @@ END_FOR]]> + + + + From bcbc791fe1c96ad5e5ee7d3f89ff0542c5c17f36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:39:51 +0100 Subject: [PATCH 10/42] Add solution/_Config/NC/NC.xti The NC.xti file is needed for the PLC NC task. So we re-add it here. --- solution/_Config/NC/NC.xti | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 solution/_Config/NC/NC.xti diff --git a/solution/_Config/NC/NC.xti b/solution/_Config/NC/NC.xti new file mode 100644 index 0000000..759c7a3 --- /dev/null +++ b/solution/_Config/NC/NC.xti @@ -0,0 +1,20 @@ + + + + + NC-Task 1 SAF + + Inputs + + + Outputs + + + Image + + + + NC-Task 1 SVB + + + From 5c19425abcf8d9d6fa746d0f03b297f059ff987c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:42:26 +0100 Subject: [PATCH 11/42] Partly ignore solution/_Config/ We need NC/nc.xti to be able to run the NC PLC task. So don't ignore it. But ignore all IO and Axes. --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cab1dc8..63a08bd 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,5 @@ logs.0* solution/TrialLicense.tclrs tools/linux/ADS/ tools/linux/getADSState/getADSState.bin -_Config/ +_Config/NC/Axes +_Config/IO From b522fe177e0bbc8d54d67fe57e5bc5ff55bef52d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:44:25 +0100 Subject: [PATCH 12/42] fix whitespace damage --- solution/tc_project_app/POUs/MAIN.TcPOU | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 5eebc02..2c922e6 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -48,7 +48,7 @@ VAR iRetry : INT; fbReadEncRefSys : ARRAY [1..gvl_app.axisNum] OF MC_ReadParameter; fbRestorePosition : ARRAY [1..GVL_app.axisNum] OF MC_SetPosition; - fbGetDeviceIdentification : FB_GetDeviceIdentification; + fbGetDeviceIdentification : FB_GetDeviceIdentification; END_VAR @@ -130,8 +130,8 @@ fbEL1808( '0') THEN - CHECK_UPS(); - RESTORE_POSITIONS(); + CHECK_UPS(); + RESTORE_POSITIONS(); END_IF]]> From b914a2f62ad9b004ad7c9cfb6d2b2e09a4038c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:51:12 +0100 Subject: [PATCH 13/42] Initial number of axes is 0 Change axisNum in GVL_APP to 0 --- solution/tc_project_app/GVLs/GVL_APP.TcGVL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/tc_project_app/GVLs/GVL_APP.TcGVL b/solution/tc_project_app/GVLs/GVL_APP.TcGVL index 9e800ab..e125049 100644 --- a/solution/tc_project_app/GVLs/GVL_APP.TcGVL +++ b/solution/tc_project_app/GVLs/GVL_APP.TcGVL @@ -7,7 +7,7 @@ VAR_GLOBAL END_VAR VAR_GLOBAL CONSTANT - axisNum : UINT:=2; + axisNum : UINT:=0; //axisCoupleMax : UINT:=4; END_VAR]]> From de53c24b1569826149def478bde4d7da1290cafb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:53:57 +0100 Subject: [PATCH 14/42] solution.tsproj: Remove the 2 axes, commit with TC 3.1.4024.0 --- solution/solution.tsproj | 968 +-------------------------------------- 1 file changed, 1 insertion(+), 967 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 5dd70ed..36de82a 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1,904 +1,5 @@ - - - - NCTOPLC_AXIS_REF_STATE - 32 - - Operational - BIT - 1 - 0 - - - Homed - BIT - 1 - 1 - - - NotMoving - BIT - 1 - 2 - - - InPositionArea - BIT - 1 - 3 - - - InTargetPosition - BIT - 1 - 4 - - - Protected - BIT - 1 - 5 - - - ErrorPropagationDelayed - BIT - 1 - 6 - - - HasBeenStopped - BIT - 1 - 7 - - - HasJob - BIT - 1 - 8 - - - PositiveDirection - BIT - 1 - 9 - - - NegativeDirection - BIT - 1 - 10 - - - HomingBusy - BIT - 1 - 11 - - - ConstantVelocity - BIT - 1 - 12 - - - Compensating - BIT - 1 - 13 - - - ExtSetPointGenEnabled - BIT - 1 - 14 - - - PhasingActive - BIT - 1 - 15 - - - ExternalLatchValid - BIT - 1 - 16 - - - NewTargetPos - BIT - 1 - 17 - - - IsDriveLimitActive - BIT - 1 - 18 - - - ContinuousMotion - BIT - 1 - 19 - - - ControlLoopClosed - BIT - 1 - 20 - - - CamTableQueued - BIT - 1 - 21 - - - CamDataQueued - BIT - 1 - 22 - - - CamScalingPending - BIT - 1 - 23 - - - CmdBuffered - BIT - 1 - 24 - - - PTPmode - BIT - 1 - 25 - - - SoftLimitMinExceeded - BIT - 1 - 26 - - - SoftLimitMaxExceeded - BIT - 1 - 27 - - - DriveDeviceError - BIT - 1 - 28 - - - MotionCommandsLocked - BIT - 1 - 29 - - - IoDataInvalid - BIT - 1 - 30 - - - Error - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - {4C3FC5AC-D5AA-44C6-AC5A-159774BA0F6D} - - - - - NCTOPLC_AXIS_REF_OPMODE - 32 - - OpModePosAreaMonitoring - BIT - 1 - 0 - - - OpModeTargetPosMonitoring - BIT - 1 - 1 - - - OpModeLoop - BIT - 1 - 2 - - - OpModeMotionMonitoring - BIT - 1 - 3 - - - OpModePEHTimeMonitoring - BIT - 1 - 4 - - - OpModeBacklashCompensation - BIT - 1 - 5 - - - OpModeDelayedErrorReaction - BIT - 1 - 6 - - - OpModeModulo - BIT - 1 - 7 - - - OpModeSimulationAxis - BIT - 1 - 8 - - - OpModePosLagMonitoring - BIT - 1 - 16 - - - OpModeVeloLagMonitoring - BIT - 1 - 17 - - - OpModeSoftLimitMinMonitoring - BIT - 1 - 18 - - - OpModeSoftLimitMaxMonitoring - BIT - 1 - 19 - - - OpModePosCorrection - BIT - 1 - 20 - - - OpModeAllowSlaveCommands - BIT - 1 - 21 - - - OpModeAllowExtSetAxisCommands - BIT - 1 - 22 - - - ApplicationRequest - BIT - 1 - 23 - - - - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - - AvoidingCollision - BIT - 1 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_STATE2 - 32 - - Value - DWORD - 32 - 0 - - - Flags - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - 8 - - CamActivationPending - BIT - 1 - 0 - - - CamDeactivationPending - BIT - 1 - 1 - - - CamActive - BIT - 1 - 2 - - - CamDataQueued - BIT - 1 - 6 - - - CamScalingPending - BIT - 1 - 7 - - - - UINTARR8 - 128 - UINT - - 0 - 8 - - - - NCTOPLC_AXIS_REF - 2048 - - StateDWord - NCTOPLC_AXIS_REF_STATE - 32 - 0 - - - ErrorCode - UDINT - 32 - 32 - - - AxisState - UDINT - - 32 - 64 - - - AxisModeConfirmation - UDINT - 32 - 96 - - - HomingState - UDINT - - 32 - 128 - - - CoupleState - UDINT - - 32 - 160 - - - SvbEntries - UDINT - 32 - 192 - - - SafEntries - UDINT - 32 - 224 - - - AxisId - UDINT - 32 - 256 - - - OpModeDWord - NCTOPLC_AXIS_REF_OPMODE - 32 - 288 - - - ActPos - LREAL - 64 - 320 - - - ModuloActPos - LREAL - 64 - 384 - - - ActiveControlLoopIndex - UINT - 16 - 448 - - - ControlLoopIndex - UINT - 16 - 464 - - - ModuloActTurns - DINT - 32 - 480 - - - ActVelo - LREAL - 64 - 512 - - - PosDiff - LREAL - 64 - 576 - - - SetPos - LREAL - 64 - 640 - - - SetVelo - LREAL - 64 - 704 - - - SetAcc - LREAL - 64 - 768 - - - TargetPos - LREAL - 64 - 832 - - - ModuloSetPos - LREAL - 64 - 896 - - - ModuloSetTurns - DINT - 32 - 960 - - - CmdNo - UINT - 16 - 992 - - - CmdState - UINT - 16 - 1008 - - - SetJerk - LREAL - 64 - 1024 - - - SetTorque - LREAL - 64 - 1088 - - - ActTorque - LREAL - 64 - 1152 - - - StateDWord2 - NCTOPLC_AXIS_REF_STATE2 - 32 - 1216 - - - StateDWord3 - DWORD - 32 - 1248 - - - TouchProbeState - DWORD - 32 - 1280 - - - TouchProbeCounter - DWORD - 32 - 1312 - - - CamCouplingState - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - - 0 - 8 - - 64 - 1344 - - - CamCouplingTableID - UINTARR8 - 128 - 1408 - - - ActTorqueDerivative - LREAL - 64 - 1536 - - - SetTorqueDerivative - LREAL - 64 - 1600 - - - AbsPhasingPos - LREAL - 64 - 1664 - - - TorqueOffset - LREAL - 64 - 1728 - - - ActPosWithoutPosCorrection - LREAL - 64 - 1792 - - - ActAcc - LREAL - 64 - 1856 - - - DcTimeStamp - UDINT - 32 - 1920 - - - - NcStructType - 2 - - - - - NCAXLESTRUCT_TOPLC - - - NCAXLESTRUCT_TOPLC2 - - - NCAXLESTRUCT_TOPLC3 - - - NCAXLESTRUCT_TOPLC4 - - - - - - - - - - - - - - - - - PLCTONC_AXIS_REF_CTRL - 32 - - Enable - BIT - 1 - 0 - - - FeedEnablePlus - BIT - 1 - 1 - - - FeedEnableMinus - BIT - 1 - 2 - - - HomingSensor - BIT - 1 - 5 - - - AcceptBlockedDrive - BIT - 1 - 8 - - - PlcDebugFlag - BIT - 1 - 30 - - - NcDebugFlag - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - PLCTONC_AXIS_REF - 1024 - - ControlDWord - PLCTONC_AXIS_REF_CTRL - 32 - 0 - - - Override - UDINT - 32 - 32 - - - AxisModeRequest - UDINT - 32 - 64 - - - AxisModeDWord - UDINT - 32 - 96 - - - AxisModeLReal - LREAL - 64 - 128 - - - PositionCorrection - LREAL - 64 - 192 - - - ExtSetPos - LREAL - 64 - 256 - - - ExtSetVelo - LREAL - 64 - 320 - - - ExtSetAcc - LREAL - 64 - 384 - - - ExtSetDirection - DINT - 32 - 448 - - - ExtControllerOutput - LREAL - 64 - 512 - - - GearRatio1 - LREAL - 64 - 576 - - - GearRatio2 - LREAL - 64 - 640 - - - GearRatio3 - LREAL - 64 - 704 - - - GearRatio4 - LREAL - 64 - 768 - - - MapState - BOOL - 8 - 832 - - - PlcCycleControl - BYTE - 8 - 840 - - - PlcCycleCount - BYTE - 8 - 848 - - - - NcStructType - 1 - - - - - NCAXLESTRUCT_FROMPLC3 - - - - + @@ -932,57 +33,6 @@ External Setpoint Generation: tc_project_app Instance {08500001-0000-0000-F000-000000000064} - - PlcTask Inputs - - GVL.axes[1].inputs.bLimitFwd - - BOOL - - - GVL.axes[1].inputs.bLimitBwd - - BOOL - - - GVL.axes[1].inputs.bHomeSensor - - BOOL - - - GVL.axes[1].inputs.bEncLAtch - - BOOL - - - GVL.axes[1].Axis.NcToPlc - NCTOPLC_AXIS_REF - - - GVL.axes[2].inputs.bLimitFwd - - BOOL - - - GVL.axes[2].inputs.bLimitBwd - - BOOL - - - GVL.axes[2].inputs.bHomeSensor - - BOOL - - - GVL.axes[2].inputs.bEncLAtch - - BOOL - - - GVL.axes[2].Axis.NcToPlc - NCTOPLC_AXIS_REF - - PlcTask Outputs @@ -990,14 +40,6 @@ External Setpoint Generation: BOOL - - GVL.axes[1].Axis.PlcToNc - PLCTONC_AXIS_REF - - - GVL.axes[2].Axis.PlcToNc - PLCTONC_AXIS_REF - @@ -1006,12 +48,4 @@ External Setpoint Generation: - - - - - - - - From 06fff58f08fd4e15b51daa0dfad5858785921398 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Mon, 10 Feb 2020 10:58:35 +0100 Subject: [PATCH 15/42] MAIN.TcPOU: Save with TC version 3.1.4024.0 --- solution/tc_project_app/POUs/MAIN.TcPOU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 2c922e6..458ca9d 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -1,5 +1,5 @@  - + Date: Wed, 12 Feb 2020 11:56:26 +0100 Subject: [PATCH 16/42] Add check in MAIN.RESTOR_POSITIONS Add check when resetting bRestoreOnStartup flag to only reset if the UPS is OK. Otherwise during a power loss it is set and then reset before getting to the end of the PLC cycle. This was a result of moving some code that was previously in MAIN to an ACT and the RETURN command does not work the same. I believe it only returns from the current act and not the whole code. Originally it was supposed to prevent the rest of the code from executing in the event of a power failure but this is no longer the case. --- solution/tc_project_app/POUs/MAIN.TcPOU | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 458ca9d..b3bbcc1 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -6,6 +6,7 @@ VAR sVersion: STRING:='1.0.0'; i : UINT; //index variable for AXES() aFbAxes: ARRAY [1..gvl_app.axisNum] OF FB_Axis; + hmiAxisSelection : INT:=1; //Not possible to use local hmi variables for array indexes (******Outputs: Power for Limit switches and Home Sensors (every 4th output)********) @@ -158,7 +159,7 @@ END_IF]]> // Note from Beckhoff: "A maximum of 1 MB persistent data can be reliably saved over the entire service life." ///######################################################### -IF bRestoreOnStartup THEN +IF bRestoreOnStartup AND eGlobalSUpsState = eSUPS_PowerOK THEN bRestoreOnStartup:=FALSE; bRestoreExecute:=TRUE; END_IF @@ -273,7 +274,7 @@ END_FOR]]> - + From 51464ddd8716ac9c8924d2198343911e3c899072 Mon Sep 17 00:00:00 2001 From: Paul Barron Date: Wed, 12 Feb 2020 12:12:10 +0100 Subject: [PATCH 17/42] Fix whitespace damage --- solution/tc_project_app/POUs/MAIN.TcPOU | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index b3bbcc1..2621b5e 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -6,7 +6,7 @@ VAR sVersion: STRING:='1.0.0'; i : UINT; //index variable for AXES() aFbAxes: ARRAY [1..gvl_app.axisNum] OF FB_Axis; - + hmiAxisSelection : INT:=1; //Not possible to use local hmi variables for array indexes (******Outputs: Power for Limit switches and Home Sensors (every 4th output)********) From 741d03da8d35fb1fe2efd7faee2eb693af2c3292 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 19 Feb 2020 14:54:14 +0000 Subject: [PATCH 18/42] Test suite and examples for tc_mca_std_lib solution --- .../_Config/CNC/Axes/tcUNIT_virtual_axis.xti | 302 ++++ solution/_Config/CNC/CNC.xti | 573 +++++++ .../_Config/NC/Axes/tcUNIT_simulated_axis.xti | 1526 +++++++++++++++++ solution/_Config/NC/NC.xti | 1 + solution/solution.tsproj | 83 +- solution/tc_project_app/GVLs/GVL_APP.TcGVL | 2 +- solution/tc_project_app/POUs/MAIN.TcPOU | 2 - .../Test/common/FB_tcUNIT_common.TcPOU | 224 ++- .../Test/common/tcUNIT_GVL.TcGVL | 8 +- .../standard_library_tests/FB_Axis_TEST.TcPOU | 295 ++-- .../tc_project_app/tc_project_app.plcproj | 24 +- .../tc_project_app/tc_project_app.tmcRefac | 25 + 12 files changed, 2778 insertions(+), 287 deletions(-) create mode 100644 solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti create mode 100644 solution/_Config/CNC/CNC.xti create mode 100644 solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti create mode 100644 solution/tc_project_app/tc_project_app.tmcRefac diff --git a/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti b/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti new file mode 100644 index 0000000..65dd9ce --- /dev/null +++ b/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti @@ -0,0 +1,302 @@ + + + + __FILENAME__ + 171 + + Inputs + + + Outputs + + + + diff --git a/solution/_Config/CNC/CNC.xti b/solution/_Config/CNC/CNC.xti new file mode 100644 index 0000000..8e99e26 --- /dev/null +++ b/solution/_Config/CNC/CNC.xti @@ -0,0 +1,573 @@ + + + + CNC + + CNC-Task GEO + + + CNC-Task SDA + + + CNC-Task COM + + ].prg[ ] +# +# prg -> Program path +# log_nr -> logical program path number +# typ -> Programmpfadtyp ( 0x01 Main program path ) +# ( 0x02 Sub program path ) +# ( 0x03 Main- and sub program path ) +# +# prioritaet -> priority of the program path, +# (if there are multible program paths with the same type) +# +# additional program path, customer +pfad[0].prg[0] sub +pfad[0].log_nr[0] 1 # logical path number +pfad[0].typ[0] 0x07 # main- and subprogram path, MSG SAVE +pfad[0].prioritaet[0] 1 # priority +# +# program path for sub programs +pfad[0].prg[1] cycles +pfad[0].log_nr[1] 2 # logical path number +pfad[0].typ[1] 0x03 # main- and subprogram path +pfad[0].prioritaet[1] 2 # priority +# +# program path for cycles +pfad[0].prg[2] customer +pfad[0].log_nr[2] 3 # logical path number +pfad[0].typ[2] 0x03 # main- and subprogram path +pfad[0].prioritaet[2] 3 # priority +# +# ------------------------------------------------------------------------------------------------------ +# Do not change data below this line!!! +# Daten unterhalb dieser Zeile nicht aendern, teilweise werden durch +# den Systemmanager Aenderungen automatisch durchgefuehrt!!! +# ------------------------------------------------------------------------------------------------------ +# +# +kanal_anzahl 0 +ext_var_max 100 +# +# ---------------------------------------- +# Lists for configuration data +# ---------------------------------------- +listen ASCII +# +default_sda_mds tc_virtual_1\default_sda.lis +# +hand_mds tc_virtual_2\hand_mds.lis +# +konf_path . +# +default_achs_mds tc_virtual_3\default_mds.lis +zahl_mds 1 +achs_mds[0] tc_virtual_4\achsmds1.lis +# +zahl_kw 0 +# +Ende + +]]> + + + + + + + + diff --git a/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti b/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti new file mode 100644 index 0000000..6036e30 --- /dev/null +++ b/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti @@ -0,0 +1,1526 @@ + + + + + UINTARR2 + 32 + UINT + + 0 + 2 + + + [%u, %u] + [0] + [1] + + + 0x%08x [%u, %u] + . + [0] + [1] + + + 0x%08x (%u) + . + . + + + + NCENCODERSTRUCT_IN2B + 320 + + nDataIn1 + UINTARR2 + 32 + 0 + + + nDataIn2 + UINTARR2 + 32 + 32 + + + nState1 + USINT + 8 + 64 + + + nState2 + USINT + 8 + 72 + + + nState3 + USINT + 8 + 80 + + + nState4 + USINT + + 8 + 88 + + + nDataIn3 + UINTARR2 + 32 + 96 + + + nDataIn4 + UINTARR2 + 32 + 128 + + + nDataIn5 + UINTARR2 + 32 + 160 + + + nDataIn6 + UINTARR2 + 32 + 192 + + + nState5 + USINT + 8 + 224 + + + nState6 + USINT + 8 + 232 + + + nState7 + USINT + 8 + 240 + + + nState8 + USINT + 8 + 248 + + + nDcInputTime + DINT + 32 + 256 + + + nDataIn7 + UINTARR2 + 32 + 288 + + + + NCENCODERSTRUCT_IN + + 96 + + + + + + NCENCODERSTRUCT_OUT2 + 320 + + nDataOut1 + UINTARR2 + 32 + 0 + + + nDataOut2 + UINTARR2 + 32 + 32 + + + nCtrl1 + USINT + 8 + 64 + + + nCtrl2 + USINT + 8 + 72 + + + nCtrl3 + USINT + 8 + 80 + + + nCtrl4 + USINT + 8 + 88 + + + nDataOut3 + UINTARR2 + 32 + 96 + + + nDataOut4 + UINTARR2 + 32 + 128 + + + nDataOut5 + UINTARR2 + 32 + 160 + + + nDataOut6 + UINTARR2 + 32 + 192 + + + nCtrl5 + USINT + 8 + 224 + + + nCtrl6 + USINT + 8 + 232 + + + nCtrl7 + USINT + 8 + 240 + + + nCtrl8 + USINT + 8 + 248 + + + + NCENCODERSTRUCT_OUT + + 96 + + + + + + NCDRIVESTRUCT_IN2 + 320 + + nDataIn1 + UINTARR2 + 32 + 0 + + + nDataIn2 + UINTARR2 + 32 + 32 + + + nState1 + USINT + 8 + 64 + + + nState2 + USINT + 8 + 72 + + + nState3 + USINT + 8 + 80 + + + nState4 + USINT + + 8 + 88 + + + nDataIn3 + UINTARR2 + 32 + 96 + + + nDataIn4 + UINTARR2 + 32 + 128 + + + nDataIn5 + UINTARR2 + 32 + 160 + + + nDataIn6 + UINTARR2 + 32 + 192 + + + nState5 + USINT + 8 + 224 + + + nState6 + USINT + 8 + 232 + + + nState7 + USINT + 8 + 240 + + + nState8 + USINT + 8 + 248 + + + nDcOutputTime + DINT + 32 + 256 + + + + NCDRIVESTRUCT_IN + + 96 + + + + + + NCDRIVESTRUCT_OUT2 + 320 + + nDataOut1 + UINTARR2 + 32 + 0 + + + nDataOut2 + UINTARR2 + 32 + 32 + + + nCtrl1 + USINT + 8 + 64 + + + nCtrl2 + USINT + 8 + 72 + + + nCtrl3 + USINT + 8 + 80 + + + nCtrl4 + USINT + 8 + 88 + + + nDataOut3 + UINTARR2 + 32 + 96 + + + nDataOut4 + UINTARR2 + 32 + 128 + + + nDataOut5 + UINTARR2 + 32 + 160 + + + nDataOut6 + UINTARR2 + 32 + 192 + + + nCtrl5 + USINT + 8 + 224 + + + nCtrl6 + USINT + 8 + 232 + + + nCtrl7 + USINT + 8 + 240 + + + nCtrl8 + USINT + 8 + 248 + + + + NCDRIVESTRUCT_OUT + + 96 + + + + + + PLCTONC_AXIS_REF_CTRL + 32 + + Enable + BIT + 1 + 0 + + + FeedEnablePlus + BIT + 1 + 1 + + + FeedEnableMinus + BIT + 1 + 2 + + + HomingSensor + BIT + 1 + 5 + + + AcceptBlockedDrive + BIT + 1 + 8 + + + PlcDebugFlag + BIT + 1 + 30 + + + NcDebugFlag + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + PLCTONC_AXIS_REF + 1024 + + ControlDWord + PLCTONC_AXIS_REF_CTRL + 32 + 0 + + + Override + UDINT + 32 + 32 + + + AxisModeRequest + UDINT + 32 + 64 + + + AxisModeDWord + UDINT + 32 + 96 + + + AxisModeLReal + LREAL + 64 + 128 + + + PositionCorrection + LREAL + 64 + 192 + + + ExtSetPos + LREAL + 64 + 256 + + + ExtSetVelo + LREAL + 64 + 320 + + + ExtSetAcc + LREAL + 64 + 384 + + + ExtSetDirection + DINT + 32 + 448 + + + ExtControllerOutput + LREAL + 64 + 512 + + + GearRatio1 + LREAL + 64 + 576 + + + GearRatio2 + LREAL + 64 + 640 + + + GearRatio3 + LREAL + 64 + 704 + + + GearRatio4 + LREAL + 64 + 768 + + + MapState + BOOL + 8 + 832 + + + PlcCycleControl + BYTE + 8 + 840 + + + PlcCycleCount + BYTE + 8 + 848 + + + + NcStructType + 1 + + + + + NCAXLESTRUCT_FROMPLC3 + + + + + NCTOPLC_AXIS_REF_STATE + 32 + + Operational + BIT + 1 + 0 + + + Homed + BIT + 1 + 1 + + + NotMoving + BIT + 1 + 2 + + + InPositionArea + BIT + 1 + 3 + + + InTargetPosition + BIT + 1 + 4 + + + Protected + BIT + 1 + 5 + + + ErrorPropagationDelayed + BIT + 1 + 6 + + + HasBeenStopped + BIT + 1 + 7 + + + HasJob + BIT + 1 + 8 + + + PositiveDirection + BIT + 1 + 9 + + + NegativeDirection + BIT + 1 + 10 + + + HomingBusy + BIT + 1 + 11 + + + ConstantVelocity + BIT + 1 + 12 + + + Compensating + BIT + 1 + 13 + + + ExtSetPointGenEnabled + BIT + 1 + 14 + + + PhasingActive + BIT + 1 + 15 + + + ExternalLatchValid + BIT + 1 + 16 + + + NewTargetPos + BIT + 1 + 17 + + + ContinuousMotion + BIT + 1 + 19 + + + ControlLoopClosed + BIT + 1 + 20 + + + CamTableQueued + BIT + 1 + 21 + + + CamDataQueued + BIT + 1 + 22 + + + CamScalingPending + BIT + 1 + 23 + + + CmdBuffered + BIT + 1 + 24 + + + PTPmode + BIT + 1 + 25 + + + SoftLimitMinExceeded + BIT + 1 + 26 + + + SoftLimitMaxExceeded + BIT + 1 + 27 + + + DriveDeviceError + BIT + 1 + 28 + + + MotionCommandsLocked + BIT + 1 + 29 + + + IoDataInvalid + BIT + 1 + 30 + + + Error + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_OPMODE + 32 + + OpModePosAreaMonitoring + BIT + 1 + 0 + + + OpModeTargetPosMonitoring + BIT + 1 + 1 + + + OpModeLoop + BIT + 1 + 2 + + + OpModeMotionMonitoring + BIT + 1 + 3 + + + OpModePEHTimeMonitoring + BIT + 1 + 4 + + + OpModeBacklashCompensation + BIT + 1 + 5 + + + OpModeDelayedErrorReaction + BIT + 1 + 6 + + + OpModeModulo + BIT + 1 + 7 + + + OpModeSimulationAxis + BIT + 1 + 8 + + + OpModePosLagMonitoring + BIT + 1 + 16 + + + OpModeVeloLagMonitoring + BIT + 1 + 17 + + + OpModeSoftLimitMinMonitoring + BIT + 1 + 18 + + + OpModeSoftLimitMaxMonitoring + BIT + 1 + 19 + + + OpModePosCorrection + BIT + 1 + 20 + + + OpModeAllowSlaveCommands + BIT + 1 + 21 + + + OpModeAllowExtSetAxisCommands + BIT + 1 + 22 + + + ApplicationRequest + BIT + 1 + 23 + + + + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + + AvoidingCollision + BIT + 1 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_STATE2 + 32 + + Value + DWORD + 32 + 0 + + + Flags + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + 8 + + CamActivationPending + BIT + 1 + 0 + + + CamDeactivationPending + BIT + 1 + 1 + + + CamActive + BIT + 1 + 2 + + + CamDataQueued + BIT + 1 + 6 + + + CamScalingPending + BIT + 1 + 7 + + + + UINTARR8 + 128 + UINT + + 0 + 8 + + + + NCTOPLC_AXIS_REF + 2048 + + StateDWord + NCTOPLC_AXIS_REF_STATE + 32 + 0 + + + ErrorCode + UDINT + 32 + 32 + + + AxisState + UDINT + + 32 + 64 + + + AxisModeConfirmation + UDINT + 32 + 96 + + + HomingState + UDINT + + 32 + 128 + + + CoupleState + UDINT + + 32 + 160 + + + SvbEntries + UDINT + 32 + 192 + + + SafEntries + UDINT + 32 + 224 + + + AxisId + UDINT + 32 + 256 + + + OpModeDWord + NCTOPLC_AXIS_REF_OPMODE + 32 + 288 + + + ActPos + LREAL + 64 + 320 + + + ModuloActPos + LREAL + 64 + 384 + + + ActiveControlLoopIndex + UINT + 16 + 448 + + + ControlLoopIndex + UINT + 16 + 464 + + + ModuloActTurns + DINT + 32 + 480 + + + ActVelo + LREAL + 64 + 512 + + + PosDiff + LREAL + 64 + 576 + + + SetPos + LREAL + 64 + 640 + + + SetVelo + LREAL + 64 + 704 + + + SetAcc + LREAL + 64 + 768 + + + TargetPos + LREAL + 64 + 832 + + + ModuloSetPos + LREAL + 64 + 896 + + + ModuloSetTurns + DINT + 32 + 960 + + + CmdNo + UINT + 16 + 992 + + + CmdState + UINT + 16 + 1008 + + + SetJerk + LREAL + 64 + 1024 + + + SetTorque + LREAL + 64 + 1088 + + + ActTorque + LREAL + 64 + 1152 + + + StateDWord2 + NCTOPLC_AXIS_REF_STATE2 + 32 + 1216 + + + StateDWord3 + DWORD + 32 + 1248 + + + TouchProbeState + DWORD + 32 + 1280 + + + TouchProbeCounter + DWORD + 32 + 1312 + + + CamCouplingState + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + + 0 + 8 + + 64 + 1344 + + + CamCouplingTableID + UINTARR8 + 128 + 1408 + + + ActTorqueDerivative + LREAL + 64 + 1536 + + + SetTorqueDerivative + LREAL + 64 + 1600 + + + ActPosWithoutPosCorrection + LREAL + 64 + 1792 + + + ActAcc + LREAL + 64 + 1856 + + + DcTimeStamp + UDINT + 32 + 1920 + + + + NcStructType + 2 + + + + + NCAXLESTRUCT_TOPLC + + + NCAXLESTRUCT_TOPLC2 + + + NCAXLESTRUCT_TOPLC3 + + + NCAXLESTRUCT_TOPLC4 + + + + + + + + + + + + + + + __FILENAME__ + + + + + + Inputs + + In + NCENCODERSTRUCT_IN2B + 1024 + + nDataIn1 + + + nDataIn2 + + + nState4 + + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + nDataIn7 + + + + + Outputs + + Out + NCENCODERSTRUCT_OUT2 + 2048 + + nDataOut1 + + + nDataOut2 + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + + Inputs + + In + NCDRIVESTRUCT_IN2 + 1344 + + nDataIn1 + + + nDataIn2 + + + nState4 + + + + nDataIn3 + + + nDataIn4 + + + nDataIn5 + + + nDataIn6 + + + + + Outputs + + Out + NCDRIVESTRUCT_OUT2 + 2368 + + nDataOut1 + + + nDataOut2 + + + nCtrl2 + + + + nCtrl3 + + + + nDataOut3 + + + nDataOut4 + + + nDataOut5 + + + nDataOut6 + + + + + + + + + + + Inputs + + FromPlc + PLCTONC_AXIS_REF + + + + Outputs + + ToPlc + NCTOPLC_AXIS_REF + + AxisState + + + + HomingState + + + + CoupleState + + + + + + diff --git a/solution/_Config/NC/NC.xti b/solution/_Config/NC/NC.xti index 759c7a3..0347cfe 100644 --- a/solution/_Config/NC/NC.xti +++ b/solution/_Config/NC/NC.xti @@ -16,5 +16,6 @@ NC-Task 1 SVB + diff --git a/solution/solution.tsproj b/solution/solution.tsproj index bcc972e..c5894d3 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -875,6 +875,7 @@ External Setpoint Generation: + {3EBB9639-5FF3-42B6-8847-35C70DC013C8} @@ -893,7 +894,7 @@ External Setpoint Generation: - + tc_epicscommodule Instance {08500001-0000-0000-F000-000000000064} @@ -906,6 +907,72 @@ External Setpoint Generation: tc_project_app Instance {08500001-0000-0000-F000-000000000064} + + PlcTask Inputs + + GVL.axes[1].inputs.bLimitFwd + + BOOL + + + GVL.axes[1].inputs.bLimitBwd + + BOOL + + + GVL.axes[1].inputs.bHomeSensor + + BOOL + + + GVL.axes[1].inputs.bEncLAtch + + BOOL + + + GVL.axes[1].Axis.NcToPlc + NCTOPLC_AXIS_REF + + AxisState + + + + HomingState + + + + CoupleState + + + + PlcTask Outputs @@ -913,6 +980,10 @@ External Setpoint Generation: BOOL + + GVL.axes[1].Axis.PlcToNc + PLCTONC_AXIS_REF + @@ -920,5 +991,15 @@ External Setpoint Generation: + + + + + + + + + + diff --git a/solution/tc_project_app/GVLs/GVL_APP.TcGVL b/solution/tc_project_app/GVLs/GVL_APP.TcGVL index e125049..ecb46e3 100644 --- a/solution/tc_project_app/GVLs/GVL_APP.TcGVL +++ b/solution/tc_project_app/GVLs/GVL_APP.TcGVL @@ -7,7 +7,7 @@ VAR_GLOBAL END_VAR VAR_GLOBAL CONSTANT - axisNum : UINT:=0; + axisNum : UINT:=1; //axisCoupleMax : UINT:=4; END_VAR]]> diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 2621b5e..a07b19d 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -140,7 +140,6 @@ END_IF]]> @@ -310,7 +309,6 @@ END_FOR]]> - 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 844227f..2d569d3 100644 --- a/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU +++ b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU @@ -1,7 +1,7 @@  - - - + - + - - + - + - - + + iAxisIndex: INT; // The idex of the axis to action the method on. +END_VAR +]]> - +GVL.axes[iAxisIndex].config.fVelocity := tcUNIT_GVL.fDEFAULT_TARGET_VELOCITY; +GVL.axes[iAxisIndex].config.fAcceleration := tcUNIT_GVL.fDEFAULT_TARGET_ACCELERATION; +GVL.axes[iAxisIndex].config.fDeceleration := tcUNIT_GVL.fDEFAULT_TARGET_DECCELERATION; +GVL.axes[iAxisIndex].config.fOverride := tcUNIT_GVL.fDEFAULT_TARGET_OVERRIDE; +GVL.axes[iAxisIndex].config.fPosition := tcUNIT_GVL.fDEFAULT_POSITION;]]> - - + - +GVL.axes[iAxisIndex].config.fVelocity := fTargetVelocity; +GVL.axes[iAxisIndex].config.fAcceleration := fTargetAcceleration; +GVL.axes[iAxisIndex].config.fDeceleration := fTargetDeceleration; +GVL.axes[iAxisIndex].config.fPosition := fTargetPosition; +]]> - - + - +GVL.axes[iAxisIndex].inputs.bLimitBwd := FALSE; +GVL.axes[iAxisIndex].inputs.bLimitFwd := FALSE; +GVL.axes[iAxisIndex].inputs.bEncLAtch := FALSE; +GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE; +]]> - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL index ed05340..10cbe42 100644 --- a/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL +++ b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL @@ -1,12 +1,10 @@  - \ No newline at end of file diff --git a/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU index 59ff389..e80efba 100644 --- a/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU +++ b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU @@ -6,18 +6,83 @@ FUNCTION_BLOCK FB_Axis_TEST EXTENDS tcUnit.FB_TestSuite VAR fbCommon: FB_tcUNIT_common; - Axis: POINTER TO ST_AxisStruct := ADR(GVL.axes[1]); + iTargetAxis: INT := 1; // The of the axis within GVL.axes[] to test against. END_VAR]]> +SetAxisControl_Enabled(); +CheckAxisStatus_Moving(); +SetAxisConfig_Acceleration(); +CheckAxisStatus_NewPosition(); +SetAxisControl_Velocity(); +SetAxisInputs_bLimitFwd();]]> - - + + + nMaxCycles OR ExpectedResult = Result THEN + AssertEquals(Expected := ExpectedResult, + Actual := Result, + Message := 'Axis is not moving.'); + TEST_FINISHED(); +ELSE + nCycle := nCycle + 1; +END_IF]]> + + + + + + nCycleMax OR ExpectedResult = Result THEN + AssertEquals(Expected := ExpectedResult, + Actual := Result, + Message := 'fPosition of the axis is different.'); + TEST_FINISHED(); +ELSE + nCycle := nCycle + 1; +END_IF]]> + + + + - - + - - - - - - nMaxCycles OR ExpectedResult = Result THEN AssertEquals(Expected := ExpectedResult, Actual := Result, - Message := 'Axis is not moving.'); + Message := 'Axis is not enabled.'); + TEST_FINISHED(); +ELSE + nCycle := nCycle + 1; END_IF - -fbCommon.SetDefaults(GVL.Axes[1]); -TEST_FINISHED();]]> +]]> - - - - - - - - + + + + + nMaxCycles OR ExpectedResult = Result THEN + AssertEquals(Expected := ExpectedResult, + Actual := Result, + Message := 'Axis bLimitFwd is not enabled.'); + TEST_FINISHED(); +ELSE + nCycle := nCycle + 1; +END_IF]]> + + + - + + + + + + + + - + - - - + - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index d880255..e87ef80 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -369,14 +369,14 @@ - Tc2_MC2, * (Beckhoff Automation GmbH) + Tc2_MC2, 3.3.28.0 (Beckhoff Automation GmbH) - - + + "<ProjectRoot>" {192FAD59-8248-4824-A8DE-9177C94C195A} @@ -427,15 +427,15 @@ - - - System.Boolean - System.Collections.Hashtable - System.Int32 - {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} - System.String - - + + + System.Boolean + System.Collections.Hashtable + System.Int32 + {54dd0eac-a6d8-46f2-8c27-2f43c7e49861} + System.String + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_project_app.tmcRefac b/solution/tc_project_app/tc_project_app.tmcRefac new file mode 100644 index 0000000..58df39a --- /dev/null +++ b/solution/tc_project_app/tc_project_app.tmcRefac @@ -0,0 +1,25 @@ + + + + + SetAxisControl_Enabled + i + nCycle + + + SetAxisControl_Enabled + iMaxCount + nMaxCycles + + + CheckAxisStatus_NewPosition + iCount + nCycle + + + CheckAxisStatus_NewPosition + iMaxCount + nCycleMax + + + \ No newline at end of file From 9c985be4ef82e87c40a52b5f5ff4946dd57deeb6 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 19 Feb 2020 14:58:39 +0000 Subject: [PATCH 19/42] Attempt to fix whitespace damage --- .../Test/app_tests/tcUNIT_APP_RUN.TcPOU | 4 ++-- .../Test/common/FB_tcUNIT_common.TcPOU | 21 ++++++------------- 2 files changed, 8 insertions(+), 17 deletions(-) diff --git a/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU index bfdf84b..102e424 100644 --- a/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU +++ b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU @@ -2,12 +2,12 @@ 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 2d569d3..e8f604a 100644 --- a/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU +++ b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU @@ -12,11 +12,10 @@ END_VAR]]> - + @@ -25,8 +24,7 @@ VAR_INPUT iAxisIndex: INT; // The idex of the axis to action the method on. END_VAR]]> - + @@ -34,8 +32,7 @@ END_VAR]]> VAR_INPUT iAxisIndex: INT; // The idex of the axis to action the method on. -END_VAR -]]> +END_VAR]]> +GVL.axes[iAxisIndex].config.fPosition := fTargetPosition;]]> @@ -116,8 +112,7 @@ GVL.axes[iAxisIndex].config.nHomeSeq := 0; GVL.axes[iAxisIndex].inputs.bLimitBwd := FALSE; GVL.axes[iAxisIndex].inputs.bLimitFwd := FALSE; GVL.axes[iAxisIndex].inputs.bEncLAtch := FALSE; -GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE; -]]> +GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE;]]> @@ -125,11 +120,9 @@ GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE; - - @@ -141,7 +134,6 @@ GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE; - @@ -152,7 +144,6 @@ GVL.axes[iAxisIndex].inputs.bHomeSensor := FALSE; - \ No newline at end of file From c6f051cc614b887fc428f9dc0286aacddae68878 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 19 Feb 2020 15:11:53 +0000 Subject: [PATCH 20/42] Used script to fix 'whitespace damage' --- solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU | 2 +- solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU index 102e424..7326c7d 100644 --- a/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU +++ b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU @@ -1,7 +1,7 @@  - Date: Wed, 19 Feb 2020 15:46:14 +0000 Subject: [PATCH 21/42] Added test for LREAL assert using tcUNIT helper methods --- .../standard_library_tests/FB_Axis_TEST.TcPOU | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU index e80efba..36cf024 100644 --- a/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU +++ b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU @@ -140,24 +140,26 @@ VAR InitialValue: LREAL; Result: LREAL; ExpectedResult: LREAL; + + fDelta: REAL := 0.01; END_VAR]]> +AssertEquals_LREAL(Expected := ExpectedResult, + Actual := Result, + Delta := fDelta, + Message := 'fVelocity of the axis is different.'); + TEST_FINISHED(); +]]> @@ -220,10 +222,17 @@ END_IF]]> + - - + + + + + + + + From b8c4e3ff3f19e6a296e4b92fb02c3375cd53aa19 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 19 Feb 2020 16:03:29 +0000 Subject: [PATCH 22/42] Added tcUNIT libarary 1.0.0 references to resources and Test folder inc. app and common tests structure --- .../Test/app_tests/tcUNIT_APP_RUN.TcPOU | 19 +++ .../Test/common/FB_tcUNIT_common.TcPOU | 149 ++++++++++++++++++ .../Test/common/tcUNIT_GVL.TcGVL | 23 +++ .../tc_project_app/tc_project_app.plcproj | 16 ++ 4 files changed, 207 insertions(+) create mode 100644 solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU create mode 100644 solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU create mode 100644 solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL diff --git a/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU new file mode 100644 index 0000000..7326c7d --- /dev/null +++ b/solution/tc_project_app/Test/app_tests/tcUNIT_APP_RUN.TcPOU @@ -0,0 +1,19 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU new file mode 100644 index 0000000..9fb8d47 --- /dev/null +++ b/solution/tc_project_app/Test/common/FB_tcUNIT_common.TcPOU @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL new file mode 100644 index 0000000..10cbe42 --- /dev/null +++ b/solution/tc_project_app/Test/common/tcUNIT_GVL.TcGVL @@ -0,0 +1,23 @@ + + + + + + \ No newline at end of file diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index b5d34ae..ff1f68e 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -229,6 +229,15 @@ Code + + Code + + + Code + + + Code + Code @@ -236,6 +245,7 @@ + @@ -256,6 +266,8 @@ + + @@ -334,6 +346,10 @@ Tc3_Module, * (Beckhoff Automation GmbH) Tc3_Module + + TcUnit, * (www.tcunit.org) + TcUnit + VisuDialogs, * (System) VisuDialogs From a5fa02873593c2566cecde057cd4b1e401d0216a Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Mon, 2 Mar 2020 16:07:10 +0100 Subject: [PATCH 23/42] Delete all error handling from MAIN Delete the action ERROR() Delete all the variable section for Error Handling in MAIN --- solution/tc_project_app/POUs/MAIN.TcPOU | 74 +------------------------ 1 file changed, 2 insertions(+), 72 deletions(-) diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU index 2621b5e..3ff0212 100644 --- a/solution/tc_project_app/POUs/MAIN.TcPOU +++ b/solution/tc_project_app/POUs/MAIN.TcPOU @@ -26,19 +26,6 @@ VAR //bOutput24 AT %Q*: BOOL:= TRUE; //bOutput28 AT %Q*: BOOL:= TRUE; -(******Error Handling********) - fbErrorSystem: FB_ErrorSystem; - aFbAxesError: ARRAY [1..gvl_app.axisNum] OF FB_NC_Error; - - //fbEL1018 : EL1018; - //fbEL2808 : EL2808; - //fbEL5101 : EL5101; - //fbEL9505 : EL9505; - //fbEL1252 : EL1252; - //fbEL9410 : EL9410; - //fbEL7037 : EL7037; - //fbEK1110 : EK1110; - (******Startup, Shutdown and UPS********) fbUPS : FB_S_UPS_CX51x0; eUpsMode : E_S_UPS_Mode := eSUPS_WrPersistData_Shutdown; @@ -59,8 +46,7 @@ END_VAR]]> +AXES();]]> @@ -87,46 +73,6 @@ ELSIF eGlobalSUpsState <> eSUPS_PowerOK THEN END_IF]]> - - - , - nSelectedError=> , - pErrorSystem=> ); - - -FOR GVL.iAxis:=1 TO gvl_app.axisNum DO - aFbAxesError[gvl.iAxis](EN:=TRUE, - nNC_ErrorID:= gvl.axes[gvl.iAxis].status.nErrorID, - nNC_AxisID:=gvl.axes[gvl.iAxis].Axis.NcToPlc.AxisId, - ErrorSystem:= fbErrorSystem.pErrorSystem); -END_FOR - - - -(*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 "fbErrorSystem.pErrorSystem" to the input ErrorSystem in each FB E. g. : -fbEL1808( - En:= TRUE, - iTerminal_ID:= 01, - ErrorSystem:= fbErorSystem.pErrorSystem, - EnO=> , - bError=> ); - *) - -]]> - - - + @@ -287,22 +233,6 @@ END_FOR]]> - - - - - - - - - - - - - - - - From 9e3a609823c989ef2f88bda321821bdbacb6672e Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Mon, 2 Mar 2020 16:08:34 +0100 Subject: [PATCH 24/42] Add commits in tc_mca_std_lib for deleting all the error handling files --- 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 852ea37..4f0c125 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 852ea37aa8d1aadfe0f2b84fd462c1f30aadd492 +Subproject commit 4f0c125af07cc4cb5e593c32de2fbd66c9e9ebd4 From e29e5a6fd02abdca78e0c40f53f2eb4294aa2c7c Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Mon, 2 Mar 2020 16:16:30 +0100 Subject: [PATCH 25/42] Delete the directories with all the error handling files. New tree structure --- .../tc_project_app/tc_project_app.plcproj | 121 ------------------ 1 file changed, 121 deletions(-) diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index b5d34ae..f8a5867 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -71,117 +71,6 @@ 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 @@ -242,18 +131,8 @@ - - - - - - - - - - From aaea8a67a33c074e14a25a03a8cc8a70603c5173 Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Mon, 2 Mar 2020 16:29:07 +0000 Subject: [PATCH 26/42] Update submodule --- 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 852ea37..3897755 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 852ea37aa8d1aadfe0f2b84fd462c1f30aadd492 +Subproject commit 3897755dd750917c8fbeafa3143ccdbdd35af823 From f42a22cbe0fe7af557107055d598d240ef8df7c4 Mon Sep 17 00:00:00 2001 From: kleines Date: Mon, 2 Mar 2020 17:31:50 +0100 Subject: [PATCH 27/42] deleted uncommented code in GVL_APP --- solution/tc_project_app/GVLs/GVL_APP.TcGVL | 1 - 1 file changed, 1 deletion(-) diff --git a/solution/tc_project_app/GVLs/GVL_APP.TcGVL b/solution/tc_project_app/GVLs/GVL_APP.TcGVL index e125049..c284299 100644 --- a/solution/tc_project_app/GVLs/GVL_APP.TcGVL +++ b/solution/tc_project_app/GVLs/GVL_APP.TcGVL @@ -8,7 +8,6 @@ END_VAR VAR_GLOBAL CONSTANT axisNum : UINT:=0; - //axisCoupleMax : UINT:=4; END_VAR]]> \ No newline at end of file From 597881796f656d8af937a9bc1828acf08627fea5 Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Mon, 2 Mar 2020 16:35:29 +0000 Subject: [PATCH 28/42] Update submodule --- 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 3897755..50d6980 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 3897755dd750917c8fbeafa3143ccdbdd35af823 +Subproject commit 50d6980aa54ae96c813081b03ace04c3d82003f6 From 71da3cce157283895458fcd5ee84ed17d0e7c699 Mon Sep 17 00:00:00 2001 From: Dominic Oram Date: Mon, 2 Mar 2020 17:12:31 +0000 Subject: [PATCH 29/42] Updated submodule --- 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 50d6980..85f11c0 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 50d6980aa54ae96c813081b03ace04c3d82003f6 +Subproject commit 85f11c08bc807bda1e02aa5c635a789d355da20c From bb7af4fcdf67173d458b7eed2174e216424ce4e7 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 10:09:51 +0000 Subject: [PATCH 30/42] Updated after merge resolution --- solution/solution.tsproj | 8 -------- solution/tc_project_app/PlcTask.TcTTO | 3 +++ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 36de82a..6f0e066 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -33,14 +33,6 @@ tc_project_app Instance {08500001-0000-0000-F000-000000000064} - - PlcTask Outputs - - MAIN.bOutput1 - - BOOL - - diff --git a/solution/tc_project_app/PlcTask.TcTTO b/solution/tc_project_app/PlcTask.TcTTO index b5badec..3118110 100644 --- a/solution/tc_project_app/PlcTask.TcTTO +++ b/solution/tc_project_app/PlcTask.TcTTO @@ -7,6 +7,9 @@ MAIN + + tcUNIT_APP_RUN + {26d89752-95b4-4b52-80c0-c79242bc34d7} {137c4fd1-c794-4dee-a041-b4fea1d22866} {2478772d-357b-433f-886f-15340bef9bdf} From c8602c8eb7524a9e59798250dc2cf8be8b16bd27 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 11:05:47 +0000 Subject: [PATCH 31/42] Resolved merge conflicts --- .../_Config/NC/Axes/tcUNIT_simulated_axis.xti | 1526 ----------------- solution/_Config/NC/NC.xti | 1 - solution/solution.tsproj | 973 +---------- solution/tc_project_app/PlcTask.TcTTO | 3 - 4 files changed, 12 insertions(+), 2491 deletions(-) delete mode 100644 solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti diff --git a/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti b/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti deleted file mode 100644 index 6036e30..0000000 --- a/solution/_Config/NC/Axes/tcUNIT_simulated_axis.xti +++ /dev/null @@ -1,1526 +0,0 @@ - - - - - UINTARR2 - 32 - UINT - - 0 - 2 - - - [%u, %u] - [0] - [1] - - - 0x%08x [%u, %u] - . - [0] - [1] - - - 0x%08x (%u) - . - . - - - - NCENCODERSTRUCT_IN2B - 320 - - nDataIn1 - UINTARR2 - 32 - 0 - - - nDataIn2 - UINTARR2 - 32 - 32 - - - nState1 - USINT - 8 - 64 - - - nState2 - USINT - 8 - 72 - - - nState3 - USINT - 8 - 80 - - - nState4 - USINT - - 8 - 88 - - - nDataIn3 - UINTARR2 - 32 - 96 - - - nDataIn4 - UINTARR2 - 32 - 128 - - - nDataIn5 - UINTARR2 - 32 - 160 - - - nDataIn6 - UINTARR2 - 32 - 192 - - - nState5 - USINT - 8 - 224 - - - nState6 - USINT - 8 - 232 - - - nState7 - USINT - 8 - 240 - - - nState8 - USINT - 8 - 248 - - - nDcInputTime - DINT - 32 - 256 - - - nDataIn7 - UINTARR2 - 32 - 288 - - - - NCENCODERSTRUCT_IN - - 96 - - - - - - NCENCODERSTRUCT_OUT2 - 320 - - nDataOut1 - UINTARR2 - 32 - 0 - - - nDataOut2 - UINTARR2 - 32 - 32 - - - nCtrl1 - USINT - 8 - 64 - - - nCtrl2 - USINT - 8 - 72 - - - nCtrl3 - USINT - 8 - 80 - - - nCtrl4 - USINT - 8 - 88 - - - nDataOut3 - UINTARR2 - 32 - 96 - - - nDataOut4 - UINTARR2 - 32 - 128 - - - nDataOut5 - UINTARR2 - 32 - 160 - - - nDataOut6 - UINTARR2 - 32 - 192 - - - nCtrl5 - USINT - 8 - 224 - - - nCtrl6 - USINT - 8 - 232 - - - nCtrl7 - USINT - 8 - 240 - - - nCtrl8 - USINT - 8 - 248 - - - - NCENCODERSTRUCT_OUT - - 96 - - - - - - NCDRIVESTRUCT_IN2 - 320 - - nDataIn1 - UINTARR2 - 32 - 0 - - - nDataIn2 - UINTARR2 - 32 - 32 - - - nState1 - USINT - 8 - 64 - - - nState2 - USINT - 8 - 72 - - - nState3 - USINT - 8 - 80 - - - nState4 - USINT - - 8 - 88 - - - nDataIn3 - UINTARR2 - 32 - 96 - - - nDataIn4 - UINTARR2 - 32 - 128 - - - nDataIn5 - UINTARR2 - 32 - 160 - - - nDataIn6 - UINTARR2 - 32 - 192 - - - nState5 - USINT - 8 - 224 - - - nState6 - USINT - 8 - 232 - - - nState7 - USINT - 8 - 240 - - - nState8 - USINT - 8 - 248 - - - nDcOutputTime - DINT - 32 - 256 - - - - NCDRIVESTRUCT_IN - - 96 - - - - - - NCDRIVESTRUCT_OUT2 - 320 - - nDataOut1 - UINTARR2 - 32 - 0 - - - nDataOut2 - UINTARR2 - 32 - 32 - - - nCtrl1 - USINT - 8 - 64 - - - nCtrl2 - USINT - 8 - 72 - - - nCtrl3 - USINT - 8 - 80 - - - nCtrl4 - USINT - 8 - 88 - - - nDataOut3 - UINTARR2 - 32 - 96 - - - nDataOut4 - UINTARR2 - 32 - 128 - - - nDataOut5 - UINTARR2 - 32 - 160 - - - nDataOut6 - UINTARR2 - 32 - 192 - - - nCtrl5 - USINT - 8 - 224 - - - nCtrl6 - USINT - 8 - 232 - - - nCtrl7 - USINT - 8 - 240 - - - nCtrl8 - USINT - 8 - 248 - - - - NCDRIVESTRUCT_OUT - - 96 - - - - - - PLCTONC_AXIS_REF_CTRL - 32 - - Enable - BIT - 1 - 0 - - - FeedEnablePlus - BIT - 1 - 1 - - - FeedEnableMinus - BIT - 1 - 2 - - - HomingSensor - BIT - 1 - 5 - - - AcceptBlockedDrive - BIT - 1 - 8 - - - PlcDebugFlag - BIT - 1 - 30 - - - NcDebugFlag - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - PLCTONC_AXIS_REF - 1024 - - ControlDWord - PLCTONC_AXIS_REF_CTRL - 32 - 0 - - - Override - UDINT - 32 - 32 - - - AxisModeRequest - UDINT - 32 - 64 - - - AxisModeDWord - UDINT - 32 - 96 - - - AxisModeLReal - LREAL - 64 - 128 - - - PositionCorrection - LREAL - 64 - 192 - - - ExtSetPos - LREAL - 64 - 256 - - - ExtSetVelo - LREAL - 64 - 320 - - - ExtSetAcc - LREAL - 64 - 384 - - - ExtSetDirection - DINT - 32 - 448 - - - ExtControllerOutput - LREAL - 64 - 512 - - - GearRatio1 - LREAL - 64 - 576 - - - GearRatio2 - LREAL - 64 - 640 - - - GearRatio3 - LREAL - 64 - 704 - - - GearRatio4 - LREAL - 64 - 768 - - - MapState - BOOL - 8 - 832 - - - PlcCycleControl - BYTE - 8 - 840 - - - PlcCycleCount - BYTE - 8 - 848 - - - - NcStructType - 1 - - - - - NCAXLESTRUCT_FROMPLC3 - - - - - NCTOPLC_AXIS_REF_STATE - 32 - - Operational - BIT - 1 - 0 - - - Homed - BIT - 1 - 1 - - - NotMoving - BIT - 1 - 2 - - - InPositionArea - BIT - 1 - 3 - - - InTargetPosition - BIT - 1 - 4 - - - Protected - BIT - 1 - 5 - - - ErrorPropagationDelayed - BIT - 1 - 6 - - - HasBeenStopped - BIT - 1 - 7 - - - HasJob - BIT - 1 - 8 - - - PositiveDirection - BIT - 1 - 9 - - - NegativeDirection - BIT - 1 - 10 - - - HomingBusy - BIT - 1 - 11 - - - ConstantVelocity - BIT - 1 - 12 - - - Compensating - BIT - 1 - 13 - - - ExtSetPointGenEnabled - BIT - 1 - 14 - - - PhasingActive - BIT - 1 - 15 - - - ExternalLatchValid - BIT - 1 - 16 - - - NewTargetPos - BIT - 1 - 17 - - - ContinuousMotion - BIT - 1 - 19 - - - ControlLoopClosed - BIT - 1 - 20 - - - CamTableQueued - BIT - 1 - 21 - - - CamDataQueued - BIT - 1 - 22 - - - CamScalingPending - BIT - 1 - 23 - - - CmdBuffered - BIT - 1 - 24 - - - PTPmode - BIT - 1 - 25 - - - SoftLimitMinExceeded - BIT - 1 - 26 - - - SoftLimitMaxExceeded - BIT - 1 - 27 - - - DriveDeviceError - BIT - 1 - 28 - - - MotionCommandsLocked - BIT - 1 - 29 - - - IoDataInvalid - BIT - 1 - 30 - - - Error - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_OPMODE - 32 - - OpModePosAreaMonitoring - BIT - 1 - 0 - - - OpModeTargetPosMonitoring - BIT - 1 - 1 - - - OpModeLoop - BIT - 1 - 2 - - - OpModeMotionMonitoring - BIT - 1 - 3 - - - OpModePEHTimeMonitoring - BIT - 1 - 4 - - - OpModeBacklashCompensation - BIT - 1 - 5 - - - OpModeDelayedErrorReaction - BIT - 1 - 6 - - - OpModeModulo - BIT - 1 - 7 - - - OpModeSimulationAxis - BIT - 1 - 8 - - - OpModePosLagMonitoring - BIT - 1 - 16 - - - OpModeVeloLagMonitoring - BIT - 1 - 17 - - - OpModeSoftLimitMinMonitoring - BIT - 1 - 18 - - - OpModeSoftLimitMaxMonitoring - BIT - 1 - 19 - - - OpModePosCorrection - BIT - 1 - 20 - - - OpModeAllowSlaveCommands - BIT - 1 - 21 - - - OpModeAllowExtSetAxisCommands - BIT - 1 - 22 - - - ApplicationRequest - BIT - 1 - 23 - - - - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - - AvoidingCollision - BIT - 1 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_STATE2 - 32 - - Value - DWORD - 32 - 0 - - - Flags - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - 8 - - CamActivationPending - BIT - 1 - 0 - - - CamDeactivationPending - BIT - 1 - 1 - - - CamActive - BIT - 1 - 2 - - - CamDataQueued - BIT - 1 - 6 - - - CamScalingPending - BIT - 1 - 7 - - - - UINTARR8 - 128 - UINT - - 0 - 8 - - - - NCTOPLC_AXIS_REF - 2048 - - StateDWord - NCTOPLC_AXIS_REF_STATE - 32 - 0 - - - ErrorCode - UDINT - 32 - 32 - - - AxisState - UDINT - - 32 - 64 - - - AxisModeConfirmation - UDINT - 32 - 96 - - - HomingState - UDINT - - 32 - 128 - - - CoupleState - UDINT - - 32 - 160 - - - SvbEntries - UDINT - 32 - 192 - - - SafEntries - UDINT - 32 - 224 - - - AxisId - UDINT - 32 - 256 - - - OpModeDWord - NCTOPLC_AXIS_REF_OPMODE - 32 - 288 - - - ActPos - LREAL - 64 - 320 - - - ModuloActPos - LREAL - 64 - 384 - - - ActiveControlLoopIndex - UINT - 16 - 448 - - - ControlLoopIndex - UINT - 16 - 464 - - - ModuloActTurns - DINT - 32 - 480 - - - ActVelo - LREAL - 64 - 512 - - - PosDiff - LREAL - 64 - 576 - - - SetPos - LREAL - 64 - 640 - - - SetVelo - LREAL - 64 - 704 - - - SetAcc - LREAL - 64 - 768 - - - TargetPos - LREAL - 64 - 832 - - - ModuloSetPos - LREAL - 64 - 896 - - - ModuloSetTurns - DINT - 32 - 960 - - - CmdNo - UINT - 16 - 992 - - - CmdState - UINT - 16 - 1008 - - - SetJerk - LREAL - 64 - 1024 - - - SetTorque - LREAL - 64 - 1088 - - - ActTorque - LREAL - 64 - 1152 - - - StateDWord2 - NCTOPLC_AXIS_REF_STATE2 - 32 - 1216 - - - StateDWord3 - DWORD - 32 - 1248 - - - TouchProbeState - DWORD - 32 - 1280 - - - TouchProbeCounter - DWORD - 32 - 1312 - - - CamCouplingState - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - - 0 - 8 - - 64 - 1344 - - - CamCouplingTableID - UINTARR8 - 128 - 1408 - - - ActTorqueDerivative - LREAL - 64 - 1536 - - - SetTorqueDerivative - LREAL - 64 - 1600 - - - ActPosWithoutPosCorrection - LREAL - 64 - 1792 - - - ActAcc - LREAL - 64 - 1856 - - - DcTimeStamp - UDINT - 32 - 1920 - - - - NcStructType - 2 - - - - - NCAXLESTRUCT_TOPLC - - - NCAXLESTRUCT_TOPLC2 - - - NCAXLESTRUCT_TOPLC3 - - - NCAXLESTRUCT_TOPLC4 - - - - - - - - - - - - - - - __FILENAME__ - - - - - - Inputs - - In - NCENCODERSTRUCT_IN2B - 1024 - - nDataIn1 - - - nDataIn2 - - - nState4 - - - - nDataIn3 - - - nDataIn4 - - - nDataIn5 - - - nDataIn6 - - - nDataIn7 - - - - - Outputs - - Out - NCENCODERSTRUCT_OUT2 - 2048 - - nDataOut1 - - - nDataOut2 - - - nDataOut3 - - - nDataOut4 - - - nDataOut5 - - - nDataOut6 - - - - - - - - - - - Inputs - - In - NCDRIVESTRUCT_IN2 - 1344 - - nDataIn1 - - - nDataIn2 - - - nState4 - - - - nDataIn3 - - - nDataIn4 - - - nDataIn5 - - - nDataIn6 - - - - - Outputs - - Out - NCDRIVESTRUCT_OUT2 - 2368 - - nDataOut1 - - - nDataOut2 - - - nCtrl2 - - - - nCtrl3 - - - - nDataOut3 - - - nDataOut4 - - - nDataOut5 - - - nDataOut6 - - - - - - - - - - - Inputs - - FromPlc - PLCTONC_AXIS_REF - - - - Outputs - - ToPlc - NCTOPLC_AXIS_REF - - AxisState - - - - HomingState - - - - CoupleState - - - - - - diff --git a/solution/_Config/NC/NC.xti b/solution/_Config/NC/NC.xti index 0347cfe..759c7a3 100644 --- a/solution/_Config/NC/NC.xti +++ b/solution/_Config/NC/NC.xti @@ -16,6 +16,5 @@ NC-Task 1 SVB - diff --git a/solution/solution.tsproj b/solution/solution.tsproj index c5894d3..9083414 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1,878 +1,5 @@ - - - NCTOPLC_AXIS_REF_STATE - 32 - - Operational - BIT - 1 - 0 - - - Homed - BIT - 1 - 1 - - - NotMoving - BIT - 1 - 2 - - - InPositionArea - BIT - 1 - 3 - - - InTargetPosition - BIT - 1 - 4 - - - Protected - BIT - 1 - 5 - - - ErrorPropagationDelayed - BIT - 1 - 6 - - - HasBeenStopped - BIT - 1 - 7 - - - HasJob - BIT - 1 - 8 - - - PositiveDirection - BIT - 1 - 9 - - - NegativeDirection - BIT - 1 - 10 - - - HomingBusy - BIT - 1 - 11 - - - ConstantVelocity - BIT - 1 - 12 - - - Compensating - BIT - 1 - 13 - - - ExtSetPointGenEnabled - BIT - 1 - 14 - - - PhasingActive - BIT - 1 - 15 - - - ExternalLatchValid - BIT - 1 - 16 - - - NewTargetPos - BIT - 1 - 17 - - - ContinuousMotion - BIT - 1 - 19 - - - ControlLoopClosed - BIT - 1 - 20 - - - CamTableQueued - BIT - 1 - 21 - - - CamDataQueued - BIT - 1 - 22 - - - CamScalingPending - BIT - 1 - 23 - - - CmdBuffered - BIT - 1 - 24 - - - PTPmode - BIT - 1 - 25 - - - SoftLimitMinExceeded - BIT - 1 - 26 - - - SoftLimitMaxExceeded - BIT - 1 - 27 - - - DriveDeviceError - BIT - 1 - 28 - - - MotionCommandsLocked - BIT - 1 - 29 - - - IoDataInvalid - BIT - 1 - 30 - - - Error - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_OPMODE - 32 - - OpModePosAreaMonitoring - BIT - 1 - 0 - - - OpModeTargetPosMonitoring - BIT - 1 - 1 - - - OpModeLoop - BIT - 1 - 2 - - - OpModeMotionMonitoring - BIT - 1 - 3 - - - OpModePEHTimeMonitoring - BIT - 1 - 4 - - - OpModeBacklashCompensation - BIT - 1 - 5 - - - OpModeDelayedErrorReaction - BIT - 1 - 6 - - - OpModeModulo - BIT - 1 - 7 - - - OpModeSimulationAxis - BIT - 1 - 8 - - - OpModePosLagMonitoring - BIT - 1 - 16 - - - OpModeVeloLagMonitoring - BIT - 1 - 17 - - - OpModeSoftLimitMinMonitoring - BIT - 1 - 18 - - - OpModeSoftLimitMaxMonitoring - BIT - 1 - 19 - - - OpModePosCorrection - BIT - 1 - 20 - - - OpModeAllowSlaveCommands - BIT - 1 - 21 - - - OpModeAllowExtSetAxisCommands - BIT - 1 - 22 - - - ApplicationRequest - BIT - 1 - 23 - - - - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - - AvoidingCollision - BIT - 1 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_STATE2 - 32 - - Value - DWORD - 32 - 0 - - - Flags - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - 8 - - CamActivationPending - BIT - 1 - 0 - - - CamDeactivationPending - BIT - 1 - 1 - - - CamActive - BIT - 1 - 2 - - - CamDataQueued - BIT - 1 - 6 - - - CamScalingPending - BIT - 1 - 7 - - - - UINTARR8 - 128 - UINT - - 0 - 8 - - - - NCTOPLC_AXIS_REF - 2048 - - StateDWord - NCTOPLC_AXIS_REF_STATE - 32 - 0 - - - ErrorCode - UDINT - 32 - 32 - - - AxisState - UDINT - - 32 - 64 - - - AxisModeConfirmation - UDINT - 32 - 96 - - - HomingState - UDINT - - 32 - 128 - - - CoupleState - UDINT - - 32 - 160 - - - SvbEntries - UDINT - 32 - 192 - - - SafEntries - UDINT - 32 - 224 - - - AxisId - UDINT - 32 - 256 - - - OpModeDWord - NCTOPLC_AXIS_REF_OPMODE - 32 - 288 - - - ActPos - LREAL - 64 - 320 - - - ModuloActPos - LREAL - 64 - 384 - - - ActiveControlLoopIndex - UINT - 16 - 448 - - - ControlLoopIndex - UINT - 16 - 464 - - - ModuloActTurns - DINT - 32 - 480 - - - ActVelo - LREAL - 64 - 512 - - - PosDiff - LREAL - 64 - 576 - - - SetPos - LREAL - 64 - 640 - - - SetVelo - LREAL - 64 - 704 - - - SetAcc - LREAL - 64 - 768 - - - TargetPos - LREAL - 64 - 832 - - - ModuloSetPos - LREAL - 64 - 896 - - - ModuloSetTurns - DINT - 32 - 960 - - - CmdNo - UINT - 16 - 992 - - - CmdState - UINT - 16 - 1008 - - - SetJerk - LREAL - 64 - 1024 - - - SetTorque - LREAL - 64 - 1088 - - - ActTorque - LREAL - 64 - 1152 - - - StateDWord2 - NCTOPLC_AXIS_REF_STATE2 - 32 - 1216 - - - StateDWord3 - DWORD - 32 - 1248 - - - TouchProbeState - DWORD - 32 - 1280 - - - TouchProbeCounter - DWORD - 32 - 1312 - - - CamCouplingState - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - - 0 - 8 - - 64 - 1344 - - - CamCouplingTableID - UINTARR8 - 128 - 1408 - - - ActTorqueDerivative - LREAL - 64 - 1536 - - - SetTorqueDerivative - LREAL - 64 - 1600 - - - ActPosWithoutPosCorrection - LREAL - 64 - 1792 - - - ActAcc - LREAL - 64 - 1856 - - - DcTimeStamp - UDINT - 32 - 1920 - - - - NcStructType - 2 - - - - - NCAXLESTRUCT_TOPLC - - - NCAXLESTRUCT_TOPLC2 - - - NCAXLESTRUCT_TOPLC3 - - - NCAXLESTRUCT_TOPLC4 - - - - - - - - - - - - - - PLCTONC_AXIS_REF_CTRL - 32 - - Enable - BIT - 1 - 0 - - - FeedEnablePlus - BIT - 1 - 1 - - - FeedEnableMinus - BIT - 1 - 2 - - - HomingSensor - BIT - 1 - 5 - - - AcceptBlockedDrive - BIT - 1 - 8 - - - PlcDebugFlag - BIT - 1 - 30 - - - NcDebugFlag - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - PLCTONC_AXIS_REF - 1024 - - ControlDWord - PLCTONC_AXIS_REF_CTRL - 32 - 0 - - - Override - UDINT - 32 - 32 - - - AxisModeRequest - UDINT - 32 - 64 - - - AxisModeDWord - UDINT - 32 - 96 - - - AxisModeLReal - LREAL - 64 - 128 - - - PositionCorrection - LREAL - 64 - 192 - - - ExtSetPos - LREAL - 64 - 256 - - - ExtSetVelo - LREAL - 64 - 320 - - - ExtSetAcc - LREAL - 64 - 384 - - - ExtSetDirection - DINT - 32 - 448 - - - ExtControllerOutput - LREAL - 64 - 512 - - - GearRatio1 - LREAL - 64 - 576 - - - GearRatio2 - LREAL - 64 - 640 - - - GearRatio3 - LREAL - 64 - 704 - - - GearRatio4 - LREAL - 64 - 768 - - - MapState - BOOL - 8 - 832 - - - PlcCycleControl - BYTE - 8 - 840 - - - PlcCycleCount - BYTE - 8 - 848 - - - - NcStructType - 1 - - - - - NCAXLESTRUCT_FROMPLC3 - - - - @@ -907,99 +34,23 @@ External Setpoint Generation: tc_project_app Instance {08500001-0000-0000-F000-000000000064} - - PlcTask Inputs - - GVL.axes[1].inputs.bLimitFwd - - BOOL - - - GVL.axes[1].inputs.bLimitBwd - - BOOL - - - GVL.axes[1].inputs.bHomeSensor - - BOOL - - - GVL.axes[1].inputs.bEncLAtch - - BOOL - - - GVL.axes[1].Axis.NcToPlc - NCTOPLC_AXIS_REF - - AxisState - - - - HomingState - - - - CoupleState - - - - - - PlcTask Outputs - - MAIN.bOutput1 - - BOOL - - - GVL.axes[1].Axis.PlcToNc - PLCTONC_AXIS_REF - - + + + + + + + + + + + + - - - - - - - - - - diff --git a/solution/tc_project_app/PlcTask.TcTTO b/solution/tc_project_app/PlcTask.TcTTO index 3be8aea..b5badec 100644 --- a/solution/tc_project_app/PlcTask.TcTTO +++ b/solution/tc_project_app/PlcTask.TcTTO @@ -7,9 +7,6 @@ MAIN - - tcUNIT_STD_LIB_RUN - {26d89752-95b4-4b52-80c0-c79242bc34d7} {137c4fd1-c794-4dee-a041-b4fea1d22866} {2478772d-357b-433f-886f-15340bef9bdf} From dcc427cab93b5770f91069d6e0a0ac8fcf06dca7 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 11:12:07 +0000 Subject: [PATCH 32/42] Cleaned up axis files --- .../_Config/CNC/Axes/tcUNIT_virtual_axis.xti | 302 ---- solution/_Config/CNC/CNC.xti | 573 ------- .../_Config/NC/Axes/tcUNIT_virtual_axis.xti | 1525 ----------------- 3 files changed, 2400 deletions(-) delete mode 100644 solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti delete mode 100644 solution/_Config/CNC/CNC.xti delete mode 100644 solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti diff --git a/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti b/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti deleted file mode 100644 index 65dd9ce..0000000 --- a/solution/_Config/CNC/Axes/tcUNIT_virtual_axis.xti +++ /dev/null @@ -1,302 +0,0 @@ - - - - __FILENAME__ - 171 - - Inputs - - - Outputs - - - - diff --git a/solution/_Config/CNC/CNC.xti b/solution/_Config/CNC/CNC.xti deleted file mode 100644 index 8e99e26..0000000 --- a/solution/_Config/CNC/CNC.xti +++ /dev/null @@ -1,573 +0,0 @@ - - - - CNC - - CNC-Task GEO - - - CNC-Task SDA - - - CNC-Task COM - - ].prg[ ] -# -# prg -> Program path -# log_nr -> logical program path number -# typ -> Programmpfadtyp ( 0x01 Main program path ) -# ( 0x02 Sub program path ) -# ( 0x03 Main- and sub program path ) -# -# prioritaet -> priority of the program path, -# (if there are multible program paths with the same type) -# -# additional program path, customer -pfad[0].prg[0] sub -pfad[0].log_nr[0] 1 # logical path number -pfad[0].typ[0] 0x07 # main- and subprogram path, MSG SAVE -pfad[0].prioritaet[0] 1 # priority -# -# program path for sub programs -pfad[0].prg[1] cycles -pfad[0].log_nr[1] 2 # logical path number -pfad[0].typ[1] 0x03 # main- and subprogram path -pfad[0].prioritaet[1] 2 # priority -# -# program path for cycles -pfad[0].prg[2] customer -pfad[0].log_nr[2] 3 # logical path number -pfad[0].typ[2] 0x03 # main- and subprogram path -pfad[0].prioritaet[2] 3 # priority -# -# ------------------------------------------------------------------------------------------------------ -# Do not change data below this line!!! -# Daten unterhalb dieser Zeile nicht aendern, teilweise werden durch -# den Systemmanager Aenderungen automatisch durchgefuehrt!!! -# ------------------------------------------------------------------------------------------------------ -# -# -kanal_anzahl 0 -ext_var_max 100 -# -# ---------------------------------------- -# Lists for configuration data -# ---------------------------------------- -listen ASCII -# -default_sda_mds tc_virtual_1\default_sda.lis -# -hand_mds tc_virtual_2\hand_mds.lis -# -konf_path . -# -default_achs_mds tc_virtual_3\default_mds.lis -zahl_mds 1 -achs_mds[0] tc_virtual_4\achsmds1.lis -# -zahl_kw 0 -# -Ende - -]]> - - - - - - - - diff --git a/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti b/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti deleted file mode 100644 index 87ec62b..0000000 --- a/solution/_Config/NC/Axes/tcUNIT_virtual_axis.xti +++ /dev/null @@ -1,1525 +0,0 @@ - - - - - UINTARR2 - 32 - UINT - - 0 - 2 - - - [%u, %u] - [0] - [1] - - - 0x%08x [%u, %u] - . - [0] - [1] - - - 0x%08x (%u) - . - . - - - - NCENCODERSTRUCT_IN2B - 320 - - nDataIn1 - UINTARR2 - 32 - 0 - - - nDataIn2 - UINTARR2 - 32 - 32 - - - nState1 - USINT - 8 - 64 - - - nState2 - USINT - 8 - 72 - - - nState3 - USINT - 8 - 80 - - - nState4 - USINT - - 8 - 88 - - - nDataIn3 - UINTARR2 - 32 - 96 - - - nDataIn4 - UINTARR2 - 32 - 128 - - - nDataIn5 - UINTARR2 - 32 - 160 - - - nDataIn6 - UINTARR2 - 32 - 192 - - - nState5 - USINT - 8 - 224 - - - nState6 - USINT - 8 - 232 - - - nState7 - USINT - 8 - 240 - - - nState8 - USINT - 8 - 248 - - - nDcInputTime - DINT - 32 - 256 - - - nDataIn7 - UINTARR2 - 32 - 288 - - - - NCENCODERSTRUCT_IN - - 96 - - - - - - NCENCODERSTRUCT_OUT2 - 320 - - nDataOut1 - UINTARR2 - 32 - 0 - - - nDataOut2 - UINTARR2 - 32 - 32 - - - nCtrl1 - USINT - 8 - 64 - - - nCtrl2 - USINT - 8 - 72 - - - nCtrl3 - USINT - 8 - 80 - - - nCtrl4 - USINT - 8 - 88 - - - nDataOut3 - UINTARR2 - 32 - 96 - - - nDataOut4 - UINTARR2 - 32 - 128 - - - nDataOut5 - UINTARR2 - 32 - 160 - - - nDataOut6 - UINTARR2 - 32 - 192 - - - nCtrl5 - USINT - 8 - 224 - - - nCtrl6 - USINT - 8 - 232 - - - nCtrl7 - USINT - 8 - 240 - - - nCtrl8 - USINT - 8 - 248 - - - - NCENCODERSTRUCT_OUT - - 96 - - - - - - NCDRIVESTRUCT_IN2 - 320 - - nDataIn1 - UINTARR2 - 32 - 0 - - - nDataIn2 - UINTARR2 - 32 - 32 - - - nState1 - USINT - 8 - 64 - - - nState2 - USINT - 8 - 72 - - - nState3 - USINT - 8 - 80 - - - nState4 - USINT - - 8 - 88 - - - nDataIn3 - UINTARR2 - 32 - 96 - - - nDataIn4 - UINTARR2 - 32 - 128 - - - nDataIn5 - UINTARR2 - 32 - 160 - - - nDataIn6 - UINTARR2 - 32 - 192 - - - nState5 - USINT - 8 - 224 - - - nState6 - USINT - 8 - 232 - - - nState7 - USINT - 8 - 240 - - - nState8 - USINT - 8 - 248 - - - nDcOutputTime - DINT - 32 - 256 - - - - NCDRIVESTRUCT_IN - - 96 - - - - - - NCDRIVESTRUCT_OUT2 - 320 - - nDataOut1 - UINTARR2 - 32 - 0 - - - nDataOut2 - UINTARR2 - 32 - 32 - - - nCtrl1 - USINT - 8 - 64 - - - nCtrl2 - USINT - 8 - 72 - - - nCtrl3 - USINT - 8 - 80 - - - nCtrl4 - USINT - 8 - 88 - - - nDataOut3 - UINTARR2 - 32 - 96 - - - nDataOut4 - UINTARR2 - 32 - 128 - - - nDataOut5 - UINTARR2 - 32 - 160 - - - nDataOut6 - UINTARR2 - 32 - 192 - - - nCtrl5 - USINT - 8 - 224 - - - nCtrl6 - USINT - 8 - 232 - - - nCtrl7 - USINT - 8 - 240 - - - nCtrl8 - USINT - 8 - 248 - - - - NCDRIVESTRUCT_OUT - - 96 - - - - - - PLCTONC_AXIS_REF_CTRL - 32 - - Enable - BIT - 1 - 0 - - - FeedEnablePlus - BIT - 1 - 1 - - - FeedEnableMinus - BIT - 1 - 2 - - - HomingSensor - BIT - 1 - 5 - - - AcceptBlockedDrive - BIT - 1 - 8 - - - PlcDebugFlag - BIT - 1 - 30 - - - NcDebugFlag - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - PLCTONC_AXIS_REF - 1024 - - ControlDWord - PLCTONC_AXIS_REF_CTRL - 32 - 0 - - - Override - UDINT - 32 - 32 - - - AxisModeRequest - UDINT - 32 - 64 - - - AxisModeDWord - UDINT - 32 - 96 - - - AxisModeLReal - LREAL - 64 - 128 - - - PositionCorrection - LREAL - 64 - 192 - - - ExtSetPos - LREAL - 64 - 256 - - - ExtSetVelo - LREAL - 64 - 320 - - - ExtSetAcc - LREAL - 64 - 384 - - - ExtSetDirection - DINT - 32 - 448 - - - ExtControllerOutput - LREAL - 64 - 512 - - - GearRatio1 - LREAL - 64 - 576 - - - GearRatio2 - LREAL - 64 - 640 - - - GearRatio3 - LREAL - 64 - 704 - - - GearRatio4 - LREAL - 64 - 768 - - - MapState - BOOL - 8 - 832 - - - PlcCycleControl - BYTE - 8 - 840 - - - PlcCycleCount - BYTE - 8 - 848 - - - - NcStructType - 1 - - - - - NCAXLESTRUCT_FROMPLC3 - - - - - NCTOPLC_AXIS_REF_STATE - 32 - - Operational - BIT - 1 - 0 - - - Homed - BIT - 1 - 1 - - - NotMoving - BIT - 1 - 2 - - - InPositionArea - BIT - 1 - 3 - - - InTargetPosition - BIT - 1 - 4 - - - Protected - BIT - 1 - 5 - - - ErrorPropagationDelayed - BIT - 1 - 6 - - - HasBeenStopped - BIT - 1 - 7 - - - HasJob - BIT - 1 - 8 - - - PositiveDirection - BIT - 1 - 9 - - - NegativeDirection - BIT - 1 - 10 - - - HomingBusy - BIT - 1 - 11 - - - ConstantVelocity - BIT - 1 - 12 - - - Compensating - BIT - 1 - 13 - - - ExtSetPointGenEnabled - BIT - 1 - 14 - - - PhasingActive - BIT - 1 - 15 - - - ExternalLatchValid - BIT - 1 - 16 - - - NewTargetPos - BIT - 1 - 17 - - - ContinuousMotion - BIT - 1 - 19 - - - ControlLoopClosed - BIT - 1 - 20 - - - CamTableQueued - BIT - 1 - 21 - - - CamDataQueued - BIT - 1 - 22 - - - CamScalingPending - BIT - 1 - 23 - - - CmdBuffered - BIT - 1 - 24 - - - PTPmode - BIT - 1 - 25 - - - SoftLimitMinExceeded - BIT - 1 - 26 - - - SoftLimitMaxExceeded - BIT - 1 - 27 - - - DriveDeviceError - BIT - 1 - 28 - - - MotionCommandsLocked - BIT - 1 - 29 - - - IoDataInvalid - BIT - 1 - 30 - - - Error - BIT - 1 - 31 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_OPMODE - 32 - - OpModePosAreaMonitoring - BIT - 1 - 0 - - - OpModeTargetPosMonitoring - BIT - 1 - 1 - - - OpModeLoop - BIT - 1 - 2 - - - OpModeMotionMonitoring - BIT - 1 - 3 - - - OpModePEHTimeMonitoring - BIT - 1 - 4 - - - OpModeBacklashCompensation - BIT - 1 - 5 - - - OpModeDelayedErrorReaction - BIT - 1 - 6 - - - OpModeModulo - BIT - 1 - 7 - - - OpModeSimulationAxis - BIT - 1 - 8 - - - OpModePosLagMonitoring - BIT - 1 - 16 - - - OpModeVeloLagMonitoring - BIT - 1 - 17 - - - OpModeSoftLimitMinMonitoring - BIT - 1 - 18 - - - OpModeSoftLimitMaxMonitoring - BIT - 1 - 19 - - - OpModePosCorrection - BIT - 1 - 20 - - - OpModeAllowSlaveCommands - BIT - 1 - 21 - - - OpModeAllowExtSetAxisCommands - BIT - 1 - 22 - - - ApplicationRequest - BIT - 1 - 23 - - - - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - - AvoidingCollision - BIT - 1 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_STATE2 - 32 - - Value - DWORD - 32 - 0 - - - Flags - NCTOPLC_AXIS_REF_STATE2_FLAGS - 32 - 0 - - - %08x - - - 0x%08x - - - 16#%08X - - - - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - 8 - - CamActivationPending - BIT - 1 - 0 - - - CamDeactivationPending - BIT - 1 - 1 - - - CamActive - BIT - 1 - 2 - - - CamDataQueued - BIT - 1 - 6 - - - CamScalingPending - BIT - 1 - 7 - - - - UINTARR8 - 128 - UINT - - 0 - 8 - - - - NCTOPLC_AXIS_REF - 2048 - - StateDWord - NCTOPLC_AXIS_REF_STATE - 32 - 0 - - - ErrorCode - UDINT - 32 - 32 - - - AxisState - UDINT - - 32 - 64 - - - AxisModeConfirmation - UDINT - 32 - 96 - - - HomingState - UDINT - - 32 - 128 - - - CoupleState - UDINT - - 32 - 160 - - - SvbEntries - UDINT - 32 - 192 - - - SafEntries - UDINT - 32 - 224 - - - AxisId - UDINT - 32 - 256 - - - OpModeDWord - NCTOPLC_AXIS_REF_OPMODE - 32 - 288 - - - ActPos - LREAL - 64 - 320 - - - ModuloActPos - LREAL - 64 - 384 - - - ActiveControlLoopIndex - UINT - 16 - 448 - - - ControlLoopIndex - UINT - 16 - 464 - - - ModuloActTurns - DINT - 32 - 480 - - - ActVelo - LREAL - 64 - 512 - - - PosDiff - LREAL - 64 - 576 - - - SetPos - LREAL - 64 - 640 - - - SetVelo - LREAL - 64 - 704 - - - SetAcc - LREAL - 64 - 768 - - - TargetPos - LREAL - 64 - 832 - - - ModuloSetPos - LREAL - 64 - 896 - - - ModuloSetTurns - DINT - 32 - 960 - - - CmdNo - UINT - 16 - 992 - - - CmdState - UINT - 16 - 1008 - - - SetJerk - LREAL - 64 - 1024 - - - SetTorque - LREAL - 64 - 1088 - - - ActTorque - LREAL - 64 - 1152 - - - StateDWord2 - NCTOPLC_AXIS_REF_STATE2 - 32 - 1216 - - - StateDWord3 - DWORD - 32 - 1248 - - - TouchProbeState - DWORD - 32 - 1280 - - - TouchProbeCounter - DWORD - 32 - 1312 - - - CamCouplingState - NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE - - 0 - 8 - - 64 - 1344 - - - CamCouplingTableID - UINTARR8 - 128 - 1408 - - - ActTorqueDerivative - LREAL - 64 - 1536 - - - SetTorqueDerivative - LREAL - 64 - 1600 - - - ActPosWithoutPosCorrection - LREAL - 64 - 1792 - - - ActAcc - LREAL - 64 - 1856 - - - DcTimeStamp - UDINT - 32 - 1920 - - - - NcStructType - 2 - - - - - NCAXLESTRUCT_TOPLC - - - NCAXLESTRUCT_TOPLC2 - - - NCAXLESTRUCT_TOPLC3 - - - NCAXLESTRUCT_TOPLC4 - - - - - - - - - - - - - - - __FILENAME__ - - - - - - Inputs - - In - NCENCODERSTRUCT_IN2B - 1024 - - nDataIn1 - - - nDataIn2 - - - nState4 - - - - nDataIn3 - - - nDataIn4 - - - nDataIn5 - - - nDataIn6 - - - nDataIn7 - - - - - Outputs - - Out - NCENCODERSTRUCT_OUT2 - 2048 - - nDataOut1 - - - nDataOut2 - - - nDataOut3 - - - nDataOut4 - - - nDataOut5 - - - nDataOut6 - - - - - - - - - - Inputs - - In - NCDRIVESTRUCT_IN2 - 1344 - - nDataIn1 - - - nDataIn2 - - - nState4 - - - - nDataIn3 - - - nDataIn4 - - - nDataIn5 - - - nDataIn6 - - - - - Outputs - - Out - NCDRIVESTRUCT_OUT2 - 2368 - - nDataOut1 - - - nDataOut2 - - - nCtrl2 - - - - nCtrl3 - - - - nDataOut3 - - - nDataOut4 - - - nDataOut5 - - - nDataOut6 - - - - - - - - - - - Inputs - - FromPlc - PLCTONC_AXIS_REF - - - - Outputs - - ToPlc - NCTOPLC_AXIS_REF - - AxisState - - - - HomingState - - - - CoupleState - - - - - - From e8e944b812f5773f1e4d6124299b5796db3ab7ba Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 13:03:25 +0000 Subject: [PATCH 33/42] Removed incorrectly added PLC task --- solution/tc_project_app/PlcTask.TcTTO | 3 --- 1 file changed, 3 deletions(-) diff --git a/solution/tc_project_app/PlcTask.TcTTO b/solution/tc_project_app/PlcTask.TcTTO index 3118110..b5badec 100644 --- a/solution/tc_project_app/PlcTask.TcTTO +++ b/solution/tc_project_app/PlcTask.TcTTO @@ -7,9 +7,6 @@ MAIN - - tcUNIT_APP_RUN - {26d89752-95b4-4b52-80c0-c79242bc34d7} {137c4fd1-c794-4dee-a041-b4fea1d22866} {2478772d-357b-433f-886f-15340bef9bdf} From ca85a0c07b7d2bbf4cbe8573e8defa24acf5c5f4 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 13:28:51 +0000 Subject: [PATCH 34/42] Removed epicscommmodule from solution --- solution/solution.tsproj | 955 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 946 insertions(+), 9 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 6f0e066..62c7257 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -1,5 +1,878 @@ + + + NCTOPLC_AXIS_REF_STATE + 32 + + Operational + BIT + 1 + 0 + + + Homed + BIT + 1 + 1 + + + NotMoving + BIT + 1 + 2 + + + InPositionArea + BIT + 1 + 3 + + + InTargetPosition + BIT + 1 + 4 + + + Protected + BIT + 1 + 5 + + + ErrorPropagationDelayed + BIT + 1 + 6 + + + HasBeenStopped + BIT + 1 + 7 + + + HasJob + BIT + 1 + 8 + + + PositiveDirection + BIT + 1 + 9 + + + NegativeDirection + BIT + 1 + 10 + + + HomingBusy + BIT + 1 + 11 + + + ConstantVelocity + BIT + 1 + 12 + + + Compensating + BIT + 1 + 13 + + + ExtSetPointGenEnabled + BIT + 1 + 14 + + + PhasingActive + BIT + 1 + 15 + + + ExternalLatchValid + BIT + 1 + 16 + + + NewTargetPos + BIT + 1 + 17 + + + ContinuousMotion + BIT + 1 + 19 + + + ControlLoopClosed + BIT + 1 + 20 + + + CamTableQueued + BIT + 1 + 21 + + + CamDataQueued + BIT + 1 + 22 + + + CamScalingPending + BIT + 1 + 23 + + + CmdBuffered + BIT + 1 + 24 + + + PTPmode + BIT + 1 + 25 + + + SoftLimitMinExceeded + BIT + 1 + 26 + + + SoftLimitMaxExceeded + BIT + 1 + 27 + + + DriveDeviceError + BIT + 1 + 28 + + + MotionCommandsLocked + BIT + 1 + 29 + + + IoDataInvalid + BIT + 1 + 30 + + + Error + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_OPMODE + 32 + + OpModePosAreaMonitoring + BIT + 1 + 0 + + + OpModeTargetPosMonitoring + BIT + 1 + 1 + + + OpModeLoop + BIT + 1 + 2 + + + OpModeMotionMonitoring + BIT + 1 + 3 + + + OpModePEHTimeMonitoring + BIT + 1 + 4 + + + OpModeBacklashCompensation + BIT + 1 + 5 + + + OpModeDelayedErrorReaction + BIT + 1 + 6 + + + OpModeModulo + BIT + 1 + 7 + + + OpModeSimulationAxis + BIT + 1 + 8 + + + OpModePosLagMonitoring + BIT + 1 + 16 + + + OpModeVeloLagMonitoring + BIT + 1 + 17 + + + OpModeSoftLimitMinMonitoring + BIT + 1 + 18 + + + OpModeSoftLimitMaxMonitoring + BIT + 1 + 19 + + + OpModePosCorrection + BIT + 1 + 20 + + + OpModeAllowSlaveCommands + BIT + 1 + 21 + + + OpModeAllowExtSetAxisCommands + BIT + 1 + 22 + + + ApplicationRequest + BIT + 1 + 23 + + + + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + + AvoidingCollision + BIT + 1 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_STATE2 + 32 + + Value + DWORD + 32 + 0 + + + Flags + NCTOPLC_AXIS_REF_STATE2_FLAGS + 32 + 0 + + + %08x + + + 0x%08x + + + 16#%08X + + + + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + 8 + + CamActivationPending + BIT + 1 + 0 + + + CamDeactivationPending + BIT + 1 + 1 + + + CamActive + BIT + 1 + 2 + + + CamDataQueued + BIT + 1 + 6 + + + CamScalingPending + BIT + 1 + 7 + + + + UINTARR8 + 128 + UINT + + 0 + 8 + + + + NCTOPLC_AXIS_REF + 2048 + + StateDWord + NCTOPLC_AXIS_REF_STATE + 32 + 0 + + + ErrorCode + UDINT + 32 + 32 + + + AxisState + UDINT + + 32 + 64 + + + AxisModeConfirmation + UDINT + 32 + 96 + + + HomingState + UDINT + + 32 + 128 + + + CoupleState + UDINT + + 32 + 160 + + + SvbEntries + UDINT + 32 + 192 + + + SafEntries + UDINT + 32 + 224 + + + AxisId + UDINT + 32 + 256 + + + OpModeDWord + NCTOPLC_AXIS_REF_OPMODE + 32 + 288 + + + ActPos + LREAL + 64 + 320 + + + ModuloActPos + LREAL + 64 + 384 + + + ActiveControlLoopIndex + UINT + 16 + 448 + + + ControlLoopIndex + UINT + 16 + 464 + + + ModuloActTurns + DINT + 32 + 480 + + + ActVelo + LREAL + 64 + 512 + + + PosDiff + LREAL + 64 + 576 + + + SetPos + LREAL + 64 + 640 + + + SetVelo + LREAL + 64 + 704 + + + SetAcc + LREAL + 64 + 768 + + + TargetPos + LREAL + 64 + 832 + + + ModuloSetPos + LREAL + 64 + 896 + + + ModuloSetTurns + DINT + 32 + 960 + + + CmdNo + UINT + 16 + 992 + + + CmdState + UINT + 16 + 1008 + + + SetJerk + LREAL + 64 + 1024 + + + SetTorque + LREAL + 64 + 1088 + + + ActTorque + LREAL + 64 + 1152 + + + StateDWord2 + NCTOPLC_AXIS_REF_STATE2 + 32 + 1216 + + + StateDWord3 + DWORD + 32 + 1248 + + + TouchProbeState + DWORD + 32 + 1280 + + + TouchProbeCounter + DWORD + 32 + 1312 + + + CamCouplingState + NCTOPLC_AXIS_REF_CAMCOUPLINGSTATE + + 0 + 8 + + 64 + 1344 + + + CamCouplingTableID + UINTARR8 + 128 + 1408 + + + ActTorqueDerivative + LREAL + 64 + 1536 + + + SetTorqueDerivative + LREAL + 64 + 1600 + + + ActPosWithoutPosCorrection + LREAL + 64 + 1792 + + + ActAcc + LREAL + 64 + 1856 + + + DcTimeStamp + UDINT + 32 + 1920 + + + + NcStructType + 2 + + + + + NCAXLESTRUCT_TOPLC + + + NCAXLESTRUCT_TOPLC2 + + + NCAXLESTRUCT_TOPLC3 + + + NCAXLESTRUCT_TOPLC4 + + + + + + + + + + + + + + PLCTONC_AXIS_REF_CTRL + 32 + + Enable + BIT + 1 + 0 + + + FeedEnablePlus + BIT + 1 + 1 + + + FeedEnableMinus + BIT + 1 + 2 + + + HomingSensor + BIT + 1 + 5 + + + AcceptBlockedDrive + BIT + 1 + 8 + + + PlcDebugFlag + BIT + 1 + 30 + + + NcDebugFlag + BIT + 1 + 31 + + + %08x + + + 0x%08x + + + 16#%08X + + + + PLCTONC_AXIS_REF + 1024 + + ControlDWord + PLCTONC_AXIS_REF_CTRL + 32 + 0 + + + Override + UDINT + 32 + 32 + + + AxisModeRequest + UDINT + 32 + 64 + + + AxisModeDWord + UDINT + 32 + 96 + + + AxisModeLReal + LREAL + 64 + 128 + + + PositionCorrection + LREAL + 64 + 192 + + + ExtSetPos + LREAL + 64 + 256 + + + ExtSetVelo + LREAL + 64 + 320 + + + ExtSetAcc + LREAL + 64 + 384 + + + ExtSetDirection + DINT + 32 + 448 + + + ExtControllerOutput + LREAL + 64 + 512 + + + GearRatio1 + LREAL + 64 + 576 + + + GearRatio2 + LREAL + 64 + 640 + + + GearRatio3 + LREAL + 64 + 704 + + + GearRatio4 + LREAL + 64 + 768 + + + MapState + BOOL + 8 + 832 + + + PlcCycleControl + BYTE + 8 + 840 + + + PlcCycleCount + BYTE + 8 + 848 + + + + NcStructType + 1 + + + + + NCAXLESTRUCT_FROMPLC3 + + + + @@ -20,19 +893,83 @@ - - - tc_epicscommodule Instance - {08500001-0000-0000-F000-000000000064} - - - - - tc_project_app Instance {08500001-0000-0000-F000-000000000064} + + PlcTask Inputs + + GVL.axes[1].bLimitFwd + + BOOL + + + GVL.axes[1].bLimitBwd + + BOOL + + + GVL.axes[1].bHomeSensor + + BOOL + + + GVL.axes[1].bEncLAtch + + BOOL + + + GVL.axes[1].Axis.NcToPlc + NCTOPLC_AXIS_REF + + AxisState + + + + HomingState + + + + CoupleState + + + + + + PlcTask Outputs + + GVL.axes[1].Axis.PlcToNc + PLCTONC_AXIS_REF + + From 345b0cf56bd472f6a70bfbdc345003b789b44313 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 13:32:41 +0000 Subject: [PATCH 35/42] Removed submodule epicscommodule --- .gitmodules | 3 --- solution/tc_epicscommodule | 1 - 2 files changed, 4 deletions(-) delete mode 160000 solution/tc_epicscommodule diff --git a/.gitmodules b/.gitmodules index 744093e..3eb7f73 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "solution/tc_epicscommodule"] - path = solution/tc_epicscommodule - url = https://bitbucket.org/europeanspallationsource/tc_epicscommodule.git [submodule "solution/tc_project_app/tc_mca_std_lib"] path = solution/tc_project_app/tc_mca_std_lib url = https://bitbucket.org/europeanspallationsource/tc_mca_std_lib.git diff --git a/solution/tc_epicscommodule b/solution/tc_epicscommodule deleted file mode 160000 index a13d6bb..0000000 --- a/solution/tc_epicscommodule +++ /dev/null @@ -1 +0,0 @@ -Subproject commit a13d6bb6221ab2fbe8fa8f7f2345ca8cd791f8d1 From f44a0283fd3a7b5135cf7f26fd0fdcafe2bf2297 Mon Sep 17 00:00:00 2001 From: Aaron James Long Date: Wed, 4 Mar 2020 14:13:30 +0000 Subject: [PATCH 36/42] Fixed typo in tc_project_app.plcproj --- solution/tc_project_app/tc_project_app.plcproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index dc80599..1df8677 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -1,4 +1,4 @@ - + 1.0.0.0 @@ -131,6 +131,8 @@ Code + Code + Code From 1f3a874736b119eba77bcb7fd75e48180a74b6c1 Mon Sep 17 00:00:00 2001 From: aaronlong Date: Wed, 4 Mar 2020 14:38:46 +0000 Subject: [PATCH 37/42] Prepare branch for merging into master --- solution/solution.tsproj | 9 +- .../tc_project_app/tc_project_app.plcproj | 158 +++++++++++++++--- 2 files changed, 139 insertions(+), 28 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 336b132..8e751aa 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -25,7 +25,14 @@ tc_project_app Instance {08500001-0000-0000-F000-000000000064} - + + PlcTask Outputs + + MAIN.bOutput1 + + BOOL + + diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 1df8677..aef526a 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -1,4 +1,4 @@ - + 1.0.0.0 @@ -6,7 +6,7 @@ {fb261665-fd20-4bf2-97f8-2854c82b752d} True tc_project_app - 3.1.4023.0 + 3.1.4022.6 {047dee04-c246-47b2-8ccc-a15e36987c43} {ae4eb5ee-6030-47a6-bf35-5a6afd9efeeb} {5ef19bd0-aca2-493f-b2a1-89e363647697} @@ -14,6 +14,7 @@ {26d08e27-a705-49a9-95de-a3a0b6ea049c} {577f21c4-8eb2-4f2c-a24e-4c3f62ca96d2} true + false @@ -29,15 +30,6 @@ Code - - Code - - - Code - - - Code - Code @@ -80,6 +72,117 @@ 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 @@ -127,12 +230,6 @@ Code - - Code - - - Code - Code @@ -142,6 +239,12 @@ Code + + Code + + + Code + Code @@ -156,13 +259,23 @@ + + + + + + + + + + - + @@ -241,10 +354,6 @@ Tc3_Module, * (Beckhoff Automation GmbH) Tc3_Module - - TcUnit, * (www.tcunit.org) - TcUnit - VisuDialogs, * (System) VisuDialogs @@ -255,11 +364,6 @@ Content - - - Tc2_MC2, 3.3.28.0 (Beckhoff Automation GmbH) - - From b03486cf6d90e17d4c0c3422924e8a2dc5da7e77 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Wed, 4 Mar 2020 16:09:28 +0100 Subject: [PATCH 38/42] Delete Error Handling and Hardware directories from the solution tree --- .../tc_project_app/tc_project_app.plcproj | 121 ------------------ 1 file changed, 121 deletions(-) diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index aef526a..28aa8ca 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -72,117 +72,6 @@ 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 @@ -259,18 +148,8 @@ - - - - - - - - - - From 6931409b83eb04f4146d60ee6380d7f41a859b7a Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Wed, 4 Mar 2020 16:18:21 +0100 Subject: [PATCH 39/42] Remove again Hardware directory from solution tree --- solution/tc_project_app/tc_project_app.plcproj | 1 - 1 file changed, 1 deletion(-) diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 28aa8ca..23772d4 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -147,7 +147,6 @@ - From 663f983a015169bc05df51f65ee7d53f460ac13b Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Wed, 4 Mar 2020 16:28:10 +0100 Subject: [PATCH 40/42] Change TC2_MC version to 3.3.28.0 and added Reference TcUnit --- solution/tc_project_app/tc_project_app.plcproj | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj index 23772d4..c52eb62 100644 --- a/solution/tc_project_app/tc_project_app.plcproj +++ b/solution/tc_project_app/tc_project_app.plcproj @@ -148,7 +148,6 @@ - @@ -232,6 +231,10 @@ Tc3_Module, * (Beckhoff Automation GmbH) Tc3_Module + + TcUnit, * (www.tcunit.org) + TcUnit + VisuDialogs, * (System) VisuDialogs @@ -242,6 +245,11 @@ Content + + + Tc2_MC2, 3.3.28.0 (Beckhoff Automation GmbH) + + From ebe450b3a5df827d31e2ed8572c26c5704f0212f Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Wed, 4 Mar 2020 16:35:32 +0100 Subject: [PATCH 41/42] Delete PlcTaskCom task from SYSTEM/TASKS --- solution/solution.tsproj | 3 --- 1 file changed, 3 deletions(-) diff --git a/solution/solution.tsproj b/solution/solution.tsproj index 8e751aa..9e5511d 100644 --- a/solution/solution.tsproj +++ b/solution/solution.tsproj @@ -9,9 +9,6 @@ - - PlcTaskCom - PlcTask From 8fe64ab461daa90459f99ffd2037363e83ea8840 Mon Sep 17 00:00:00 2001 From: Federico Rojas Date: Wed, 4 Mar 2020 17:29:54 +0100 Subject: [PATCH 42/42] Update the pointer to latest commit of master branch of tc_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 85f11c0..5ee22a6 160000 --- a/solution/tc_project_app/tc_mca_std_lib +++ b/solution/tc_project_app/tc_mca_std_lib @@ -1 +1 @@ -Subproject commit 85f11c08bc807bda1e02aa5c635a789d355da20c +Subproject commit 5ee22a6d093b48768c6bc912b5893a9d0d383d84