Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Export for use with version control

skraft
2020-01-07
2020-01-23
  • skraft - 2020-01-07

    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?

     
  • JTG - 2020-01-07

    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.

     
  • bjh - 2020-01-08

    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.

     
  • skraft - 2020-01-08

    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!

     
  • skraft - 2020-01-17

    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!

     
  • bjh - 2020-01-17

    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.

     
  • skraft - 2020-01-23

    I'll try all of those things, thanks for your thoughts!

     

Log in to post a comment.