diff --git a/.gitattributes b/.gitattributes
old mode 100644
new mode 100755
index d697d2e..31f31e7
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,8 +1,18 @@
# end of line conversion CLRF -- LF
-# Default is no conversion (follow Visual Studio)
-* -text
-#
-.gitattributes text
-.gitignore text
+# Default is auto
+* text=auto
+# Hidden .git files: CRLF for convenience
+.gitattributes text eol=crlf
+.gitignore text eol=crlf
+# Shell scripts must be LF
+*.sh text eol=lf
+
+# Tc files must be CRLF
+*.plcproj text eol=crlf
+*.Tc* text eol=crlf
+*.tsproj text eol=crlf
+*.txt text eol=crlf
+*.xml text eol=crlf
+*.xti text eol=crlf
diff --git a/.gitignore b/.gitignore
index 2d1ca8d..63a08bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,17 +1,21 @@
+
+*.bak
+*.pyc
+*.suo
+*.tmc
+*.tpy
+*.~u
+*~
+.#*
+.epics.*
+UpgradeLog.htm
+\#*#
_Boot/
_CompileInfo/
_Libraries/
+logs.0*
+solution/TrialLicense.tclrs
tools/linux/ADS/
tools/linux/getADSState/getADSState.bin
-logs.0*
-.epics.*
-*.bak
-*.~u
-*.pyc
-*.tpy
-*.suo
-*~
-.#*
-\#*#
-*.tmc
-
+_Config/NC/Axes
+_Config/IO
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/UpgradeLog.htm b/UpgradeLog.htm
deleted file mode 100644
index 103b560..0000000
Binary files a/UpgradeLog.htm and /dev/null differ
diff --git a/bitbucket-pipelines.yml b/bitbucket-pipelines.yml
new file mode 100644
index 0000000..873f48c
--- /dev/null
+++ b/bitbucket-pipelines.yml
@@ -0,0 +1,10 @@
+image: python:3.7.3
+options:
+ max-time: 1
+pipelines:
+ default:
+ - step:
+ script:
+ - git submodule update --init
+ - python twincat_version_manager.py
+ - python check_fix_white_space.py
diff --git a/check_fix_white_space.py b/check_fix_white_space.py
new file mode 100755
index 0000000..6597e58
--- /dev/null
+++ b/check_fix_white_space.py
@@ -0,0 +1,113 @@
+#!/usr/bin/env python3
+
+#
+# Script to fix whithespace errors in files
+# All trailing white space are removed
+# TAB are replace by spaces
+#
+import glob
+import sys
+
+file_patterns_tab_width = {"**/*.Tc*": 4,
+ "**/*.py": 4,
+ "**/*.sh": 8}
+def fix_white_space(debug, fix_files):
+ """
+ Checks the Twincat source code for white space:
+ TAB should not be used
+ Trailing SPACE shoulf not be there.
+ :return: A dictionary of white-space-damaged files
+ """
+ incorrect_files = dict()
+ for file_path, tab_width in file_patterns_tab_width.items():
+ found_files = glob.glob(file_path, recursive=True)
+ #if not found_files:
+ # raise IOError("ERROR: No files of type {} found".format(file_path))
+
+ 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))
+ file = open(pathname, 'r', newline='', encoding="iso-8859-1")
+ lines = file.readlines()
+ file.close()
+ for old_line in lines:
+ had_crlf = 0
+ this_line_dirty = False
+ if old_line.endswith('\r\n'):
+ had_crlf = 2 # Both CR and LF
+ elif old_line.endswith('\n'):
+ had_crlf = 1 # LF
+ # Convert all TAB into SPACE
+ new_line = old_line.expandtabs(tabsize=tab_width)
+ 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:
+ new_line = new_line + '\n'
+
+ if len(new_line) != len(old_line):
+ dirty = True
+ this_line_dirty = True
+ new_lines.append(new_line)
+ if this_line_dirty:
+ if debug >= 2:
+ print("had_crlf=%d" % had_crlf)
+ print("old_line=%s" % old_line)
+ print("new_line=%s" % new_line)
+ # end of loop of all line in one file
+ if debug >= 1:
+ print("pathname=%s dirty=%d" % (pathname, dirty))
+ if dirty:
+ 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)
+ file.close()
+
+ return incorrect_files
+
+
+if __name__ == "__main__":
+ try:
+ argc = len(sys.argv)
+ arg_idx = 1
+ debug = 0
+ fix_files = False
+ while arg_idx < argc:
+ if sys.argv[arg_idx] == "--fix":
+ fix_files = True
+ elif sys.argv[arg_idx] == "--debug":
+ debug = debug + 1
+ else:
+ print("%s : [--fix|--debug]" % sys.argv[0])
+ exit(2)
+ arg_idx = arg_idx + 1
+ incorrect_files = fix_white_space(debug, fix_files)
+ if not fix_files:
+ for file in incorrect_files:
+ message = incorrect_files[file]
+ print("ERROR: '{}' {}".format(file,message))
+ if incorrect_files:
+ print('run %s --fix' % sys.argv[0])
+ exit(1)
+ except IOError as e:
+ print(e) # Likely no files found
+ exit(2)
diff --git a/solution.sln b/solution.sln
index 1bff69d..9459e68 100644
--- a/solution.sln
+++ b/solution.sln
@@ -1,72 +1,72 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio 2013
-VisualStudioVersion = 12.0.21005.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "solution", "solution\solution.tsproj", "{9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|TwinCAT CE7 (ARMV7) = Debug|TwinCAT CE7 (ARMV7)
- Debug|TwinCAT OS (ARMT2) = Debug|TwinCAT OS (ARMT2)
- Debug|TwinCAT RT (x64) = Debug|TwinCAT RT (x64)
- Debug|TwinCAT RT (x86) = Debug|TwinCAT RT (x86)
- Release|TwinCAT CE7 (ARMV7) = Release|TwinCAT CE7 (ARMV7)
- Release|TwinCAT OS (ARMT2) = Release|TwinCAT OS (ARMT2)
- Release|TwinCAT RT (x64) = Release|TwinCAT RT (x64)
- Release|TwinCAT RT (x86) = Release|TwinCAT RT (x86)
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
- {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
- {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
- {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.21005.1
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{B1E792BE-AA5F-4E3C-8C82-674BF9C0715B}") = "solution", "solution\solution.tsproj", "{9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|TwinCAT CE7 (ARMV7) = Debug|TwinCAT CE7 (ARMV7)
+ Debug|TwinCAT OS (ARMT2) = Debug|TwinCAT OS (ARMT2)
+ Debug|TwinCAT RT (x64) = Debug|TwinCAT RT (x64)
+ Debug|TwinCAT RT (x86) = Debug|TwinCAT RT (x86)
+ Release|TwinCAT CE7 (ARMV7) = Release|TwinCAT CE7 (ARMV7)
+ Release|TwinCAT OS (ARMT2) = Release|TwinCAT OS (ARMT2)
+ Release|TwinCAT RT (x64) = Release|TwinCAT RT (x64)
+ Release|TwinCAT RT (x86) = Release|TwinCAT RT (x86)
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
+ {9CF97348-B9D3-4938-B1F2-5F0B0B6AA66A}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
+ {F935F1DE-0753-4702-B418-1DC0ED040A4D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).ActiveCfg = Debug|TwinCAT CE7 (ARMV7)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT CE7 (ARMV7).Build.0 = Debug|TwinCAT CE7 (ARMV7)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT OS (ARMT2).ActiveCfg = Debug|TwinCAT OS (ARMT2)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT OS (ARMT2).Build.0 = Debug|TwinCAT OS (ARMT2)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x64).ActiveCfg = Debug|TwinCAT RT (x64)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x64).Build.0 = Debug|TwinCAT RT (x64)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x86).ActiveCfg = Debug|TwinCAT RT (x86)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Debug|TwinCAT RT (x86).Build.0 = Debug|TwinCAT RT (x86)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT CE7 (ARMV7).ActiveCfg = Release|TwinCAT CE7 (ARMV7)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT CE7 (ARMV7).Build.0 = Release|TwinCAT CE7 (ARMV7)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT OS (ARMT2).ActiveCfg = Release|TwinCAT OS (ARMT2)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT OS (ARMT2).Build.0 = Release|TwinCAT OS (ARMT2)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x64).ActiveCfg = Release|TwinCAT RT (x64)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x64).Build.0 = Release|TwinCAT RT (x64)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x86).ActiveCfg = Release|TwinCAT RT (x86)
+ {FB261665-FD20-4BF2-97F8-2854C82B752D}.Release|TwinCAT RT (x86).Build.0 = Release|TwinCAT RT (x86)
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/solution/Licenses/ReadMe_licenses.txt b/solution/Licenses/ReadMe_licenses.txt
index 79e6b36..1cc9be8 100644
--- a/solution/Licenses/ReadMe_licenses.txt
+++ b/solution/Licenses/ReadMe_licenses.txt
@@ -1,5 +1,5 @@
-Copy and paste in this folder the licenses contained inside the Beckhoff CPU in the path:
-
-C:\TwinCAT\3.1\Target\License
-
+Copy and paste in this folder the licenses contained inside the Beckhoff CPU in the path:
+
+C:\TwinCAT\3.1\Target\License
+
Thank you
\ No newline at end of file
diff --git a/solution/TrialLicense.tclrs b/solution/TrialLicense.tclrs
deleted file mode 100644
index 3b78bf8..0000000
--- a/solution/TrialLicense.tclrs
+++ /dev/null
@@ -1,2 +0,0 @@
-
-{647C6958-3A0C-73AB-3631-FCA93A32D91D}2019-03-28T10:01:002019-04-05T00:00:00c5d3cb1031fe69b92637f818532268e150e73209fbcde806d6a45fa5c587430d79f2c1228179d00673ab0c897cec2974facbbdea6732800f514190342df993e6cf6c8900d81c6168e82abc6419353caaa16eae89c3652b99dc5724bd894c9688d636d924d65f9bd2be9c76a54d9389d9c2e80b95ac96243e653e4af19badfbdfa010ba61245f038ad5eef223906c4cade2def8629cdbed3a49da1c64a666625c6c23b0d87507ee78907eaf7e2d8bf7b2ce4fd5d511ecc80ae9058fbc8fabd02bf239827c8abad467f34390374768fe2427b583c8af5c86ee51c2f4bbadd341b0daccb1e0c5625b4894babedd35d3cb816a514aab66bc4fcaa5762164e6e078da{4C256767-E6E6-4AF5-BD68-9F7ABAD0C200}TC3 ADSTC1000{3FF18E97-7754-401B-93FB-70544DE28A13}TC3 IOTC1100{66689887-CCBD-452C-AC9A-039D997C6E66}TC3 PLCTC1200{A19036CF-A53B-4E3A-99FF-023EF5C4798B}TC3 NC PTP Axis10{520DE751-9DB6-47CB-8240-BD5C466E7E64}TC3 NC PTPTF5000{3EBB9639-5FF3-42B6-8847-35C70DC013C8}TC3 TCP/IPTF6310
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
+
+
+
diff --git a/solution/solution.tsproj b/solution/solution.tsproj
index 313b9a2..9e5511d 100644
--- a/solution/solution.tsproj
+++ b/solution/solution.tsproj
@@ -1,1032 +1,40 @@
-
-
-
-
- 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
-
-
-
-
-
-
-
-
- {3EBB9639-5FF3-42B6-8847-35C70DC013C8}
-
-
-
-
- PlcTaskCom
-
-
- PlcTask
-
-
-
-
-
-
- NC-Task 1 SAF
-
- Inputs
-
-
- Outputs
-
-
- Image
-
-
-
- NC-Task 1 SVB
-
-
-
-
-
-
- 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
-
- MAIN.bOutput1
-
-
-
- BOOL
-
-
- GVL.axes[1].Axis.PlcToNc
- PLCTONC_AXIS_REF
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+ {3EBB9639-5FF3-42B6-8847-35C70DC013C8}
+
+
+
+
+ PlcTask
+
+
+
+
+
+
+
+
+
+ tc_project_app Instance
+ {08500001-0000-0000-F000-000000000064}
+
+ PlcTask Outputs
+
+ MAIN.bOutput1
+
+ BOOL
+
+
+
+
+
+
+
+
+
+
diff --git a/solution/tc_epicscommodule b/solution/tc_epicscommodule
deleted file mode 160000
index 6c86fc4..0000000
--- a/solution/tc_epicscommodule
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 6c86fc4bd9250add709323079d3c84c63790648b
diff --git a/solution/tc_project_app/GVLs/GVL_APP.TcGVL b/solution/tc_project_app/GVLs/GVL_APP.TcGVL
new file mode 100644
index 0000000..c284299
--- /dev/null
+++ b/solution/tc_project_app/GVLs/GVL_APP.TcGVL
@@ -0,0 +1,13 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/solution/tc_project_app/GlobalTextList.TcGTLO b/solution/tc_project_app/GlobalTextList.TcGTLO
new file mode 100644
index 0000000..1818614
--- /dev/null
+++ b/solution/tc_project_app/GlobalTextList.TcGTLO
@@ -0,0 +1,279 @@
+
+
+
+
+
+
+
+
+ "951"
+ "%2.2f"
+
+
+
+ "878"
+ "%d"
+
+
+
+ "706"
+ "%i"
+
+
+
+ "940"
+ "%x"
+
+
+
+ "703"
+ "Acknowledge"
+
+
+
+ "710"
+ "Active:"
+
+
+
+ "952"
+ "actPos"
+
+
+
+ "953"
+ "actVel"
+
+
+
+ "110"
+ "AXESMAX"
+
+
+
+ "107"
+ "axisSel"
+
+
+
+ "945"
+ "bBusy"
+
+
+
+ "950"
+ "bBwEnabled"
+
+
+
+ "946"
+ "bDone"
+
+
+
+ "943"
+ "bEnabled"
+
+
+
+ "941"
+ "bError"
+
+
+
+ "102"
+ "bExecute"
+
+
+
+ "949"
+ "bFwEnabled"
+
+
+
+ "297"
+ "bGeared"
+
+
+
+ "948"
+ "bHomed"
+
+
+
+ "947"
+ "bResetDone"
+
+
+
+ "944"
+ "bWarning"
+
+
+
+ "704"
+ "Clear All"
+
+
+
+ "104"
+ "ENABLE"
+
+
+
+ "106"
+ "ENABLE BW"
+
+
+
+ "105"
+ "ENABLE FW"
+
+
+
+ "109"
+ "English"
+
+
+
+ "939"
+ "errID"
+
+
+
+ "701"
+ "Error #"
+
+
+
+ "705"
+ "Error #:"
+
+
+
+ "702"
+ "Error Log"
+
+
+
+ "707"
+ "Errors:"
+
+
+
+ "955"
+ "fAcceleration"
+
+
+
+ "956"
+ "fDeceleration"
+
+
+
+ "957"
+ "fPosition"
+
+
+
+ "708"
+ "Free Entries:"
+
+
+
+ "954"
+ "fVelocity"
+
+
+
+ "299"
+ "gearIn"
+
+
+
+ "300"
+ "gearOut"
+
+
+
+ "711"
+ "Inactive:"
+
+
+
+ "116"
+ "jogBw"
+
+
+
+ "117"
+ "jogFw"
+
+
+
+ "298"
+ "masterGear"
+
+
+
+ "111"
+ "moveAbsolute"
+
+
+
+ "114"
+ "moveModulo"
+
+
+
+ "113"
+ "moveRelative"
+
+
+
+ "112"
+ "moveVelocity"
+
+
+
+ "709"
+ "Overflows:"
+
+
+
+ "942"
+ "reset"
+
+
+
+ "115"
+ "stop"
+
+
+
+ "108"
+ "Test Language"
+
+
+
+ "103"
+ "toggle"
+
+
+
+
+ {062c6d5a-aca0-4f82-8481-8e26e8c8681e}
+ {d08328f1-0dac-4dfb-b105-bd18d7b5a756}
+ {180f93fa-c96b-483e-953c-133bc7d30e18}
+
+
+
+ System.Collections.ArrayList
+ {63784cbb-9ba0-45e6-9d69-babf3f040511}
+ System.Guid
+ System.String
+ {53da1be7-ad25-47c3-b0e8-e26286dad2e0}
+
+
+
+
\ No newline at end of file
diff --git a/solution/tc_project_app/POUs/MAIN.TcPOU b/solution/tc_project_app/POUs/MAIN.TcPOU
index 639c474..8e73b6a 100644
--- a/solution/tc_project_app/POUs/MAIN.TcPOU
+++ b/solution/tc_project_app/POUs/MAIN.TcPOU
@@ -1,125 +1,329 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ,
- nNoError=> ,
- nNoOverflow=> ,
- pErrorSystem=> );
-
-(*call all the necessary instance (input assistance F2 or right click) according to the terminals that you have in your hardware and
- add "TRUE" in the input En, the corresponding number of termianl to the iTerminal_ID and
-the variable "fbErrorList.pErrorSystem" to the input ErrorSystem in each FB E. g. :
-fbEL1808(
- En:= TRUE,
- iTerminal_ID:= 1,
- ErrorSystem:= fbErrorList.pErrorSystem,
- EnO=> ,
- bDi_1=> ,
- bDi_2=> ,
- bDi_3=> ,
- bDi_4=> ,
- bDi_5=> ,
- bDi_6=> ,
- bDi_7=> ,
- bDi_8=> ,
- bError=> ); *)
-//
-]]>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 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]]>
+
+
+
+
+ '0') THEN
+ CHECK_UPS();
+ RESTORE_POSITIONS();
+END_IF]]>
+
+
+
+
+
+
+
+
+
+ ,
+ ReadMode:= E_READMODE.READMODE_ONCE);
+ END_FOR
+
+ // Cycle through set position function blocks for each axis
+ FOR i:=1 TO gvl_app.axisNum DO
+ fbRestorePosition[i](
+ Axis:= gvl.axes[i].Axis,
+ Execute:= ,
+ Position:= axesPersistent[i].iPositionAtShutdown);
+ END_FOR
+
+ CASE eStartUp OF
+ ColdStart:
+ // First cycle of the PLC, do nothing just give one cycle for variables to initialise
+ IF NOT bPositionRestoreDone THEN
+ eStartUp:= ReadAxisFeedbackType;
+ iRetry:=0;
+ END_IF
+
+ ReadAxisFeedbackType:
+ // Exectute the function blocks to read the encoder reference system (0=inc OR 1=ABS)
+ bExecuteReadEncRefSys:=TRUE;
+ eStartUp:=CheckReadDone;
+
+ CheckReadDone:
+ // Check the encoder reference system has been read for all axis -> if busy then continue with PLC cycle and check again next time.
+ // If fbReadEncRefSys not started then go back a step.
+ // If any axes result in an error the code will get stuck here, this happens if gvl_app.axisNum is not set correctly
+ FOR i:=1 TO gvl_app.axisNum DO
+ IF fbReadEncRefSys[i].Valid = FALSE THEN
+ IF fbReadEncRefSys[i].Busy = TRUE THEN
+ // Exit MAIN.STARTUP Action and wait till next cycle, needs to cycle through whole program in order for data to update
+ RETURN;
+ ELSE
+ // Sometimes the code gets here and the fbReadEncRefSys[i] misses the rising edge. If the code gets here it means
+ // .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:=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:= ExecuteRestore;
+
+ ExecuteRestore:
+ // Execute position restore by setting fbRestorePosition.execute = TRUE
+ FOR i:=1 TO gvl_app.axisNum DO
+ IF fbReadEncRefSys[i].Valid = TRUE AND fbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN
+ IF GVL.axes[i].config.eRestorePosition = RestorePosition.RestoreWithoutHome THEN
+ fbRestorePosition[i].Execute:=TRUE;
+ END_IF
+ END_IF
+ END_FOR
+ eStartUp:= CheckRestore;
+
+ CheckRestore:
+ // Check the set position fbs are finished
+ // Nothing actually happens if the restore is not done, the code just returns from here each cycle and the
+ // bPositionRestoreDone will never get set to TRUE and will take up cycle time
+ FOR i:=1 TO gvl_app.axisNum DO
+ IF fbReadEncRefSys[i].Valid = TRUE AND fbReadEncRefSys[i].Value = 0 AND NOT(axesPersistent[i].bMovingAtShutdown) THEN
+ IF GVL.axes[i].config.eRestorePosition = RestorePosition.RestoreWithoutHome THEN
+ IF NOT fbRestorePosition[i].Done THEN
+ RETURN;
+ END_IF
+ END_IF
+ END_IF
+ END_FOR
+ eStartUp:= FinishRestore;
+
+ FinishRestore:
+ // Remove execute = TRUE for fbRestorePosition
+ FOR i:=1 TO gvl_app.axisNum DO
+ fbRestorePosition[i].Execute:=FALSE;
+ END_FOR
+ bPositionRestoreDone:=TRUE;
+ bRestoreExecute:=FALSE;
+ END_CASE
+END_IF]]>
+
+
+
+
+ 0 THEN
+ axesPersistent[i].bMovingAtShutdown:=TRUE;
+ ELSE
+ axesPersistent[i].bMovingAtShutdown:=FALSE;
+ END_IF
+ axesPersistent[i].bMovingAtShutdown:=axesPersistent[i].bMovingAtShutdown OR gvl.axes[i].Axis.Status.Moving;
+END_FOR]]>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/solution/tc_project_app/PlcTask.TcTTO b/solution/tc_project_app/PlcTask.TcTTO
index dfc6cfd..b5badec 100644
--- a/solution/tc_project_app/PlcTask.TcTTO
+++ b/solution/tc_project_app/PlcTask.TcTTO
@@ -1,16 +1,16 @@
-
-
-
-
- 1000
- 20
-
- MAIN
-
- {26d89752-95b4-4b52-80c0-c79242bc34d7}
- {137c4fd1-c794-4dee-a041-b4fea1d22866}
- {2478772d-357b-433f-886f-15340bef9bdf}
- {c16ee410-277f-45f0-a92e-1ec5f87024b9}
- {291eb57a-f9a9-4722-b7d3-fd700e5db288}
-
+
+
+
+
+ 10000
+ 20
+
+ MAIN
+
+ {26d89752-95b4-4b52-80c0-c79242bc34d7}
+ {137c4fd1-c794-4dee-a041-b4fea1d22866}
+ {2478772d-357b-433f-886f-15340bef9bdf}
+ {c16ee410-277f-45f0-a92e-1ec5f87024b9}
+ {291eb57a-f9a9-4722-b7d3-fd700e5db288}
+
\ No newline at end of file
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/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..36cf024
--- /dev/null
+++ b/solution/tc_project_app/Test/standard_library_tests/FB_Axis_TEST.TcPOU
@@ -0,0 +1,248 @@
+
+
+
+ of the axis within GVL.axes[] to test against.
+END_VAR]]>
+
+
+
+
+
+
+ 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 enabled.');
+ TEST_FINISHED();
+ELSE
+ nCycle := nCycle + 1;
+END_IF
+]]>
+
+
+
+
+
+
+
+
+
+
+
+ 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/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/Visualization Manager.TcVMO b/solution/tc_project_app/Visualization Manager.TcVMO
new file mode 100644
index 0000000..e63f527
--- /dev/null
+++ b/solution/tc_project_app/Visualization Manager.TcVMO
@@ -0,0 +1,568 @@
+
+
+
+
+
+
+ Undefined
+
+
+ "MainVisu"
+ false
+ false
+ AutoDetect
+ 2000
+ 2000
+ false
+ 50000
+ 400000
+ false
+ false
+ true
+ "Default, 3.1.5.0 (Beckhoff Automation GmbH)"
+ 100
+ ""
+ "VisuDialogs.Numpad"
+ "VisuDialogs.Keypad"
+ "VisuDialogs.TextinputWithLimits"
+ false
+ false
+ true
+ true
+ false
+ "VisuUserManagement.VUM_Login"
+ "VisuUserManagement.VUM_ChangePassword"
+ "VisuUserManagement.VUM_UserManagement"
+ {00000000-0000-0000-0000-000000000000}
+ {00000000-0000-0000-0000-000000000000}
+ true
+ true
+ false
+ ""
+
+
+
+ FB_Init
+ c98701bd-1e9f-450a-a2a8-a2474d536f2e
+ FB_Reinit
+ 5b6e372a-a69d-40e8-aef7-f470b7c53d95
+ FB_Exit
+ 0be1b9ab-e8eb-4b33-b803-109abb46bde4
+
+ "NotImportant"
+ {aa8b7e42-e967-427f-8f2e-f00f9d706470}
+
+
+
+ 7
+ 4096
+ "1002 0004"
+ "1.0.0.4"
+ {cb73a13e-6ccc-4bc6-8859-f5aa98bb116b}
+
+
+ true
+ 48
+ "0"
+
+
+ true
+ 49
+ "1"
+
+
+ true
+ 50
+ "2"
+
+
+ true
+ 51
+ "3"
+
+
+ true
+ 52
+ "4"
+
+
+ true
+ 53
+ "5"
+
+
+ true
+ 54
+ "6"
+
+
+ true
+ 55
+ "7"
+
+
+ true
+ 56
+ "8"
+
+
+ true
+ 57
+ "9"
+
+
+ true
+ 65
+ "A"
+
+
+ true
+ 107
+ "ADDITION"
+
+
+ true
+ 66
+ "B"
+
+
+ true
+ 8
+ "BACKSPACE"
+
+
+ true
+ 67
+ "C"
+
+
+ true
+ 110
+ "COMMA"
+
+
+ true
+ 68
+ "D"
+
+
+ true
+ 46
+ "DELETE"
+
+
+ true
+ 111
+ "DIVIDE"
+
+
+ true
+ 40
+ "DOWN"
+
+
+ true
+ 69
+ "E"
+
+
+ true
+ 35
+ "END"
+
+
+ true
+ 27
+ "ESCAPE"
+
+
+ true
+ 70
+ "F"
+
+
+ true
+ 112
+ "F1"
+
+
+ true
+ 121
+ "F10"
+
+
+ true
+ 122
+ "F11"
+
+
+ true
+ 123
+ "F12"
+
+
+ true
+ 113
+ "F2"
+
+
+ true
+ 114
+ "F3"
+
+
+ true
+ 115
+ "F4"
+
+
+ true
+ 116
+ "F5"
+
+
+ true
+ 117
+ "F6"
+
+
+ true
+ 118
+ "F7"
+
+
+ true
+ 119
+ "F8"
+
+
+ true
+ 120
+ "F9"
+
+
+ true
+ 71
+ "G"
+
+
+ true
+ 72
+ "H"
+
+
+ true
+ 36
+ "HOME"
+
+
+ true
+ 73
+ "I"
+
+
+ true
+ 45
+ "INSERT"
+
+
+ true
+ 74
+ "J"
+
+
+ true
+ 75
+ "K"
+
+
+ true
+ 76
+ "L"
+
+
+ true
+ 37
+ "LEFT"
+
+
+ true
+ 77
+ "M"
+
+
+ true
+ 106
+ "MULTIPLY"
+
+
+ true
+ 78
+ "N"
+
+
+ true
+ 96
+ "NUM0"
+
+
+ true
+ 97
+ "NUM1"
+
+
+ true
+ 98
+ "NUM2"
+
+
+ true
+ 99
+ "NUM3"
+
+
+ true
+ 100
+ "NUM4"
+
+
+ true
+ 101
+ "NUM5"
+
+
+ true
+ 102
+ "NUM6"
+
+
+ true
+ 103
+ "NUM7"
+
+
+ true
+ 104
+ "NUM8"
+
+
+ true
+ 105
+ "NUM9"
+
+
+ true
+ 79
+ "O"
+
+
+ true
+ 80
+ "P"
+
+
+ true
+ 19
+ "PAUSE"
+
+
+ true
+ 42
+ "PRINT"
+
+
+ true
+ 81
+ "Q"
+
+
+ true
+ 82
+ "R"
+
+
+ true
+ 13
+ "RETURN_KEY"
+
+
+ true
+ 39
+ "RIGHT"
+
+
+ true
+ 83
+ "S"
+
+
+ true
+ 32
+ "SPACE"
+
+
+ true
+ 109
+ "SUBTRACT"
+
+
+ true
+ 84
+ "T"
+
+
+ true
+ 9
+ "TAB"
+
+
+ true
+ 85
+ "U"
+
+
+ true
+ 38
+ "UP"
+
+
+ true
+ 86
+ "V"
+
+
+ true
+ 87
+ "W"
+
+
+ true
+ 88
+ "X"
+
+
+ true
+ 89
+ "Y"
+
+
+ true
+ 90
+ "Z"
+
+
+
+
+
+ 481037385728L
+ 549755813887L
+ 481037385728L
+ 549754765312L
+ 1048576L
+
+
+
+
+ ExecuteLooseCapture
+ 4e2884cd-dc97-4120-914c-87a83e618f1f
+ ExecuteMouseUp
+ 57eea9a5-15d9-4269-bb8d-9fee5420cdb2
+ Init
+ e61a0910-39b6-4bcc-9a64-fcab62230628
+ FB_Exit
+ e6e1ea47-0811-4b03-9888-d0564361e0d6
+ ExecuteMouseDblClick
+ a517a0ac-170b-4df4-b289-55dcb57628ed
+ GetElementInfo
+ f64cb89f-3016-4fba-85f5-02efcd4282c1
+ ExecuteMouseDown
+ 94bab392-b395-4c03-9d0e-5738d11bd021
+ FB_Reinit
+ 97933c03-0169-4afe-ac83-de892204e120
+ Initialize
+ 6946d6e0-129f-4425-b8b0-ef98281a99e9
+ ExecuteMouseMove
+ 58fc221c-be14-4e34-871e-a118f8ba9539
+ ExecuteDialogClosed
+ f08d08b6-e70c-4bef-a136-38845bd246d8
+ ExecuteKeyUp
+ 7403635b-2725-4f00-93d4-e0dd125959de
+ ExecuteKeyDown
+ 9649ecda-3794-4d6b-a8a7-71e528d9d170
+ abstrGetDefaultCursor
+ 25718998-50a9-408d-8b3f-20a55e2cc784
+ ExecuteMouseEnter
+ 569205fa-533b-4fc2-8d51-21ccab693305
+ ExecuteMouseLeave
+ 3bacea68-55b4-4764-928e-e69910299932
+ FB_Init
+ f37e1250-9b48-45ca-810e-c192ea9440ec
+ ExecuteMouseClick
+ cd348bda-7eaf-4dfe-8c4b-bf9b71e5b10c
+
+ "NotImportant"
+ {073ee466-cf0a-4c8b-ba92-64f671516699}
+
+
+
+ true
+ true
+
+
+
+
+ {925c2b24-84d1-469a-954d-7af8b99219ef}
+ {f905b871-af16-47c5-a6ef-0a0918a8b009}
+ {d3706fa7-8257-48b3-af0a-cab0afb4dc49}
+ {4d5d9e0c-fa46-4312-abcd-ab81ecde84e1}
+ {00a84c7a-9a31-408b-860a-9d896efbd842}
+ {3ef700b6-44e8-4cfc-b6e0-26bfef38c2b6}
+ {e2123cf7-55c2-43c4-8135-f70e23d789b6}
+ {b7fab3e5-7354-42a4-bdf2-bc53461ec63c}
+ {967863f2-ccef-44e4-a545-05cbd9acb6be}
+ {f97c4870-0a84-4b7b-9cfd-0059a20bebbd}
+ {81498829-8b99-4474-8196-a48127c8e5d4}
+ {71bfd0df-7f34-4abc-b3b9-84bad2430630}
+ {6695a96b-387d-4f98-b9f1-09dab5b7c483}
+ {5fe53f14-f5a7-4173-9e2b-538b7d89379a}
+ {09c26f6e-e9b1-4455-a763-8dfd243af668}
+ {48451f3d-75f9-48ba-acdb-82d62e000f26}
+ {8214e061-c2ef-40f5-b519-acfed1ca1cca}
+ {97cdf6c7-053d-4364-abf2-f17c232375c1}
+ {30af51e2-0f28-4c98-bb4e-6c7a4ef6b64e}
+ {9e20996c-a8e0-4843-9524-9317ce5fc512}
+ {9d656f8b-b228-46a1-8204-ecc426d69d24}
+ {0a915a90-ba73-4abc-b7c3-f5acec9f952a}
+ {0dedbb39-c60c-476d-aa88-36e50d09fdfc}
+ {9dd59c98-b565-4e32-8873-d0c41e452b61}
+ {43ba7f16-75cc-4157-b401-5b6df597b0b4}
+ {ccfc9bcc-edea-480a-ac07-0c05646a5eda}
+ {5531e874-67e5-49bb-abdc-7ac83b125a33}
+ {398fdf90-7db7-4f59-b7ca-c68fb5513e2e}
+ {c21922fc-3c9f-4927-affe-3857961c67c0}
+ {b435091b-c53f-4ea3-9ed5-223f402a82e7}
+ {2acce1aa-45b9-434d-bd0d-05676ddde292}
+ {7e796d60-07e9-4daf-b8ad-e42e285dae85}
+
+
+
+ System.Collections.ArrayList
+ System.Boolean
+ {7df88604-7ac5-4e36-91c4-55e4fdad3e68}
+ {11a86981-4b02-4f98-b432-96e385cb41b7}
+ {c91fc5aa-1e38-43b2-9a05-c52cc5d7f5b6}
+ {40d6dd8d-dfd0-493a-8e29-c9a35e1e6539}
+ System.Guid
+ {6b108d46-58af-4e41-a3f4-174d8f160cc4}
+ System.Int32
+ System.Int64
+ System.String
+ {19611221-ebd3-4607-86d2-9822fbe84c30}
+ {c37fe731-4f69-4d98-82fe-4f9aefbe200d}
+ {997fedbb-1888-4256-b61c-2933d8056bfd}
+ {4d3fdb8f-ab50-4c35-9d3a-d4bb9bb9a628}
+ {ec9b2ec6-92a2-4856-be72-7866fb274c64}
+
+
+
+
\ No newline at end of file
diff --git a/solution/tc_project_app/tc_mca_std_lib b/solution/tc_project_app/tc_mca_std_lib
index 936ed0e..85f11c0 160000
--- a/solution/tc_project_app/tc_mca_std_lib
+++ b/solution/tc_project_app/tc_mca_std_lib
@@ -1 +1 @@
-Subproject commit 936ed0e9d0f34f876c91cf857ee389ed8ea4eb61
+Subproject commit 85f11c08bc807bda1e02aa5c635a789d355da20c
diff --git a/solution/tc_project_app/tc_project_app.plcproj b/solution/tc_project_app/tc_project_app.plcproj
index 325287e..c52eb62 100644
--- a/solution/tc_project_app/tc_project_app.plcproj
+++ b/solution/tc_project_app/tc_project_app.plcproj
@@ -1,347 +1,319 @@
-
-
-
- 1.0.0.0
- 2.0
- {fb261665-fd20-4bf2-97f8-2854c82b752d}
- True
- tc_project_app
- 3.1.4022.2
- {047dee04-c246-47b2-8ccc-a15e36987c43}
- {ae4eb5ee-6030-47a6-bf35-5a6afd9efeeb}
- {5ef19bd0-aca2-493f-b2a1-89e363647697}
- {f52f0efe-1be1-4600-94a9-9aa59fdf8e4e}
- {26d08e27-a705-49a9-95de-a3a0b6ea049c}
- {577f21c4-8eb2-4f2c-a24e-4c3f62ca96d2}
- true
-
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
-
-
- Code
- Visualization Manager.TcVMO
-
-
- Code
- Visualization Manager.TcVMO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- VisuElemMeter, 3.5.10.0 (System)
- VisuElemMeter
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- VisuElems, 3.5.10.20 (System)
- VisuElems
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- VisuElemsSpecialControls, 3.5.10.0 (System)
- VisuElemsSpecialControls
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- VisuElemsWinControls, 3.5.10.20 (System)
- VisuElemsWinControls
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- VisuElemTextEditor, 3.5.10.10 (System)
- VisuElemTextEditor
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- visuinputs, 3.5.10.0 (system)
- visuinputs
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- VisuNativeControl, 3.5.10.0 (System)
- VisuNativeControl
- true
- 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
-
-
- Tc2_EtherCAT, * (Beckhoff Automation GmbH)
- Tc2_EtherCAT
-
-
- Tc2_MC2, * (Beckhoff Automation GmbH)
- Tc2_MC2
-
-
- Tc2_Standard, * (Beckhoff Automation GmbH)
- Tc2_Standard
-
-
- Tc2_System, * (Beckhoff Automation GmbH)
- Tc2_System
-
-
- Tc2_Utilities, * (Beckhoff Automation GmbH)
- Tc2_Utilities
-
-
- Tc3_MC2_AdvancedHoming, * (Beckhoff Automation GmbH)
- Tc3_MC2_AdvancedHoming
-
-
- Tc3_Module, * (Beckhoff Automation GmbH)
- Tc3_Module
-
-
-
-
- Content
-
-
-
-
-
-
-
- "<ProjectRoot>"
-
- {192FAD59-8248-4824-A8DE-9177C94C195A}
-
- "{192FAD59-8248-4824-A8DE-9177C94C195A}"
-
-
-
- {246001F4-279D-43AC-B241-948EB31120E1}
-
- "{246001F4-279D-43AC-B241-948EB31120E1}"
-
-
-
- {29BD8D0C-3586-4548-BB48-497B9A01693F}
-
- "{29BD8D0C-3586-4548-BB48-497B9A01693F}"
-
- Rules
-
- "Rules"
-
-
-
-
-
-
- {8F99A816-E488-41E4-9FA3-846536012284}
-
- "{8F99A816-E488-41E4-9FA3-846536012284}"
-
-
-
- {40450F57-0AA3-4216-96F3-5444ECB29763}
-
- "{40450F57-0AA3-4216-96F3-5444ECB29763}"
-
-
- ActiveVisuExtensionsLength
- 0
- ActiveVisuProfile
- "IR0whWr8bwfyBwAAHf+pawAAAABVAgAADnffSgAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDJUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgAyAC4AMQAwAAUWUAByAG8AZgBpAGwAZQBEAGEAdABhAAZMewAxADYAZQA1ADUAYgA2ADAALQA3ADAANAAzAC0ANABhADYAMwAtAGIANgA1AGIALQA2ADEANAA3ADEAMwA4ADcAOABkADQAMgB9AAcSTABpAGIAcgBhAHIAaQBlAHMACEx7ADMAYgBmAGQANQA0ADUAOQAtAGIAMAA3AGYALQA0AGQANgBlAC0AYQBlADEAYQAtAGEAOAAzADMANQA2AGEANQA1ADEANAAyAH0ACUx7ADkAYwA5ADUAOAA5ADYAOAAtADIAYwA4ADUALQA0ADEAYgBiAC0AOAA4ADcAMQAtADgAOQA1AGYAZgAxAGYAZQBkAGUAMQBhAH0ACg5WAGUAcgBzAGkAbwBuAAsGaQBuAHQADApVAHMAYQBnAGUADQpUAGkAdABsAGUADhpWAGkAcwB1AEUAbABlAG0ATQBlAHQAZQByAA8OQwBvAG0AcABhAG4AeQAQDFMAeQBzAHQAZQBt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LRLQDwEtENAACRoERQoLBAMAAAAFAAAACgAAACgAAADQDAutAgAAANANAS0T0A8BLRDQAAkaBEUKCwQDAAAABQAAAAoAAAAKAAAA0AwLrQIAAADQDQEtFNAPAS0Q0AAJGgRFCgsEAwAAAAUAAAAKAAAAKAAAANAMC60CAAAA0A0BLRXQDwEtENAACRoERQoLBAMAAAAFAAAACgAAAAAAAADQDAutAgAAANANAS0W0A8BLRfQAAkaBEUKCwQDAAAABQAAAAoAAAAoAAAA0AwLrQQAAADQDQEtGNAPAS0Q0BkarQFFGxwB0AAcGgJFHQsEAwAAAAUAAAAKAAAAAAAAANAeHy0g0CEiGgJFIyQC0AAlGgVFCgsEAwAAAAMAAAAAAAAACgAAANAmC60AAAAA0AMBLSfQKAEtEdApAS0Q0AAlGgVFCgsEAwAAAAMAAAAAAAAACgAAANAmC60BAAAA0AMBLSfQKAEtEdApAS0QmiorAUUAAQLQAAEtLNAAAS0X0AAfLS3QLi8aA9AwC60BAAAA0DELrRMAAADQMhqtANAzLxoD0DALrQIAAADQMQutAwAAANAyGq0A0DQarQDQNRqtAA=="
-
-
-
-
-
-
-
- System.Collections.Hashtable
- System.Int32
- {54dd0eac-a6d8-46f2-8c27-2f43c7e49861}
- System.String
-
-
-
-
+
+
+
+ 1.0.0.0
+ 2.0
+ {fb261665-fd20-4bf2-97f8-2854c82b752d}
+ True
+ tc_project_app
+ 3.1.4022.6
+ {047dee04-c246-47b2-8ccc-a15e36987c43}
+ {ae4eb5ee-6030-47a6-bf35-5a6afd9efeeb}
+ {5ef19bd0-aca2-493f-b2a1-89e363647697}
+ {f52f0efe-1be1-4600-94a9-9aa59fdf8e4e}
+ {26d08e27-a705-49a9-95de-a3a0b6ea049c}
+ {577f21c4-8eb2-4f2c-a24e-4c3f62ca96d2}
+ true
+ false
+
+
+
+ Code
+
+
+ Code
+ true
+
+
+ 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
+ Visualization Manager.TcVMO
+
+
+ Code
+
+
+ Code
+ Visualization Manager.TcVMO
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ VisuElemMeter, 3.5.13.0 (System)
+ VisuElemMeter
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ VisuElems, 3.5.13.21 (System)
+ VisuElems
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ VisuElemsSpecialControls, 3.5.13.0 (System)
+ VisuElemsSpecialControls
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ VisuElemsWinControls, 3.5.13.20 (System)
+ VisuElemsWinControls
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ VisuElemTextEditor, 3.5.13.0 (System)
+ VisuElemTextEditor
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ visuinputs, 3.5.13.0 (system)
+ visuinputs
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ VisuNativeControl, 3.5.13.0 (System)
+ VisuNativeControl
+ true
+ 2717eb6a-dd07-4c66-8d8d-cacebd7b18ae
+
+
+ Tc2_EtherCAT, * (Beckhoff Automation GmbH)
+ Tc2_EtherCAT
+
+
+ Tc2_MC2, * (Beckhoff Automation GmbH)
+ Tc2_MC2
+
+
+ Tc2_Standard, * (Beckhoff Automation GmbH)
+ Tc2_Standard
+
+
+ Tc2_SUPS, * (Beckhoff Automation GmbH)
+ Tc2_SUPS
+
+
+ Tc2_System, * (Beckhoff Automation GmbH)
+ Tc2_System
+
+
+ Tc2_Utilities, * (Beckhoff Automation GmbH)
+ Tc2_Utilities
+
+
+ Tc3_MC2_AdvancedHoming, * (Beckhoff Automation GmbH)
+ Tc3_MC2_AdvancedHoming
+
+
+ Tc3_Module, * (Beckhoff Automation GmbH)
+ Tc3_Module
+
+
+ TcUnit, * (www.tcunit.org)
+ TcUnit
+
+
+ VisuDialogs, * (System)
+ VisuDialogs
+
+
+
+
+ Content
+
+
+
+
+ Tc2_MC2, 3.3.28.0 (Beckhoff Automation GmbH)
+
+
+
+
+
+
+
+ "<ProjectRoot>"
+
+ {192FAD59-8248-4824-A8DE-9177C94C195A}
+
+ "{192FAD59-8248-4824-A8DE-9177C94C195A}"
+
+
+
+ {246001F4-279D-43AC-B241-948EB31120E1}
+
+ "{246001F4-279D-43AC-B241-948EB31120E1}"
+
+
+ UnicodeStrings
+ False
+
+
+ {29BD8D0C-3586-4548-BB48-497B9A01693F}
+
+ "{29BD8D0C-3586-4548-BB48-497B9A01693F}"
+
+ Rules
+
+ "Rules"
+
+
+
+
+
+
+ {8F99A816-E488-41E4-9FA3-846536012284}
+
+ "{8F99A816-E488-41E4-9FA3-846536012284}"
+
+
+
+ {40450F57-0AA3-4216-96F3-5444ECB29763}
+
+ "{40450F57-0AA3-4216-96F3-5444ECB29763}"
+
+
+ ActiveVisuExtensionsLength
+ 0
+ ActiveVisuProfile
+ "IR0whWr8bwfwBwAAhiaVXgAAAABVAgAAWdTSaQAAAAABAAAAAAAAAAEaUwB5AHMAdABlAG0ALgBTAHQAcgBpAG4AZwACTHsAZgA5ADUAYgBiADQAMgA2AC0ANQA1ADIANAAtADQAYgA0ADUALQA5ADQAMAAwAC0AZgBiADAAZgAyAGUANwA3AGUANQAxAGIAfQADCE4AYQBtAGUABDBUAHcAaQBuAEMAQQBUACAAMwAuADEAIABCAHUAaQBsAGQAIAA0ADAAMgA0AC4AMA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+
+
+
+
+
+
+
+ System.Boolean
+ System.Collections.Hashtable
+ System.Int32
+ {54dd0eac-a6d8-46f2-8c27-2f43c7e49861}
+ System.String
+
+
+
+
\ No newline at end of file
diff --git a/twincat_version_manager.py b/twincat_version_manager.py
new file mode 100644
index 0000000..b420619
--- /dev/null
+++ b/twincat_version_manager.py
@@ -0,0 +1,44 @@
+import glob
+import xml.etree.ElementTree as ET
+
+VERSION_TAGS = {"**/*.Tc*": "ProductVersion", "**/*.tsproj": "TcVersion"}
+CORRECT_VERSIONS = {"**/*.Tc*": "3.1.4024.0", "**/*.tsproj": "3.1.4023.119"}
+
+
+def check_versions():
+ """
+ Checks the Twincat version used to create a file.
+ It assumes that the version is stored as an attribute on the top element of the file, the attribute names are
+ listed in VERSION_TAGS.
+ :return: A dictionary of incorrect files and their version numbers
+ """
+ incorrect_files_exp = dict()
+ incorrect_files_act = dict()
+ for file_path, version_attrib in VERSION_TAGS.items():
+ correct_version = CORRECT_VERSIONS[file_path]
+ found_files = glob.glob(file_path, recursive=True)
+ if not found_files:
+ raise IOError("ERROR: No files of type {} found".format(file_path))
+ for file in found_files:
+ tree = ET.parse(file)
+ try:
+ found_version = tree.getroot().attrib[version_attrib]
+ if found_version != correct_version:
+ incorrect_files_exp[file] = correct_version
+ incorrect_files_act[file] = found_version
+ except KeyError:
+ print("WARNING: No version found for {}".format(file))
+ return incorrect_files_exp, incorrect_files_act
+
+
+if __name__ == "__main__":
+ try:
+ incorrect_files_exp, incorrect_files_act = check_versions()
+ for file, version in incorrect_files_act.items():
+ correct_version = incorrect_files_exp[file]
+ print("ERROR: {} has incorrect version {}, expected version {}".format(file, version, correct_version))
+ if incorrect_files_act:
+ exit(1)
+ except IOError as e:
+ print(e) # Likely no files found
+ exit(2)