I'm moving from CodeSys 2.3 to 3.5, and having a problem with version control.
On CodeSys 2.3, I would save my project, and then use Project/Export to generate an EXP file for each POU. This worked well with Github (and other SCCS tools), as it allowed me to see the line by line changes in POUs between different versions in addition to having the project file under version control.
On CodeSys 3.5, I cannot get Export to do anything other than generate a huge XML file, which is useless for version control purposes. All the POUs are in one huge file, and the source code is obscured by all of the XML wrapping, so looking at line-by-line differences is essentially not possible.
I'd be surprised if CodeSys 3.5 didn't allow any way to do normal source code control... Can someone please point me to what I'm missing here?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The only version control I'm aware of with Codesys 3 is their SVN plugin. It works great, but unfortunately is subscription based and is bundled with a handful of other plugins, so its quite expensive. I would love an alternative, especially since I prefer git.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I made my own Python script to export my POUs etc. as text files for git management, but a few weeks ago I found a user on Github who has an even better version than mine!
Exporting my project as plain text has been wonderful, though it is "one way" in that it is a snapshot in time of the project and I cannot re-import changes in plain text without more scripting and complication (I see that there is a "load.py" in the above repo but I haven't tested it). I hear a rumor that Codesys native Git support is coming but it cannot come soon enough for me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
bjh hat geschrieben:
I made my own Python script to export my POUs etc. as text files for git management, but a few weeks ago I found a user on Github who has an even better version than mine! https://github.com/18thCentury/CodeSys
I pulled the two files from here, export.py and load.py, and couldn't run either one successfully. It looked like load.py was what I wanted, as it had the project name in it. This failed on an error right at the beginning:
$ python load.py
File "load.py", line 13
func(proj,path,name)
^
IndentationError: expected an indented block
Did you have to do anything to fix up this code, or did it run by just changing the hardcoded path names? Maybe I have to use Python 2 instead of the Python 3 I've installed?
Thanks for the help!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have not used the load.py script from that user yet. That error is exactly what it says - indentation is very important to Python so double check the scripts indentation levels.
Also, you need to run export.py from within the Codeys IDE to generate the required export text files first.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm moving from CodeSys 2.3 to 3.5, and having a problem with version control.
On CodeSys 2.3, I would save my project, and then use Project/Export to generate an EXP file for each POU. This worked well with Github (and other SCCS tools), as it allowed me to see the line by line changes in POUs between different versions in addition to having the project file under version control.
On CodeSys 3.5, I cannot get Export to do anything other than generate a huge XML file, which is useless for version control purposes. All the POUs are in one huge file, and the source code is obscured by all of the XML wrapping, so looking at line-by-line differences is essentially not possible.
I'd be surprised if CodeSys 3.5 didn't allow any way to do normal source code control... Can someone please point me to what I'm missing here?
The only version control I'm aware of with Codesys 3 is their SVN plugin. It works great, but unfortunately is subscription based and is bundled with a handful of other plugins, so its quite expensive. I would love an alternative, especially since I prefer git.
I made my own Python script to export my POUs etc. as text files for git management, but a few weeks ago I found a user on Github who has an even better version than mine!
https://github.com/18thCentury/CodeSys
Exporting my project as plain text has been wonderful, though it is "one way" in that it is a snapshot in time of the project and I cannot re-import changes in plain text without more scripting and complication (I see that there is a "load.py" in the above repo but I haven't tested it). I hear a rumor that Codesys native Git support is coming but it cannot come soon enough for me.
Thanks for the replies! I'll try that one-way solution, that's exactly what I'm looking for at this point. I appreciate the help!
I pulled the two files from here, export.py and load.py, and couldn't run either one successfully. It looked like load.py was what I wanted, as it had the project name in it. This failed on an error right at the beginning:
$ python load.py
File "load.py", line 13
func(proj,path,name)
^
IndentationError: expected an indented block
Did you have to do anything to fix up this code, or did it run by just changing the hardcoded path names? Maybe I have to use Python 2 instead of the Python 3 I've installed?
Thanks for the help!
I have not used the load.py script from that user yet. That error is exactly what it says - indentation is very important to Python so double check the scripts indentation levels.
Also, you need to run export.py from within the Codeys IDE to generate the required export text files first.
https://help.codesys.com/webapp/_cds_co ... n=3.5.15.0
https://git-scm.com/docs/git-difftool
The same help.codesys link above explains how to run the CODESYS IDE python scripts from the command line.
The command line switch is --runscript
Do you think the textconv git attribute can be used here to automatically display .project files as text? Especially with cache turned on?
Search for textconv here https://git-scm.com/docs/gitattributes m
I'll try all of those things, thanks for your thoughts!