CODESYS - the IEC 61131-3 automation software

Welcome to the official CODESYS Forum by 3S-Smart Software Solutions GmbH | A member of the CODESYS Group
Deutsche Version English version russian version 
It is currently Mon Feb 24, 2020 9:23 pm

All times are UTC+01:00




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Tue Jan 07, 2020 6:40 pm 
Offline

Joined: Tue Dec 10, 2019 6:38 pm
Posts: 5
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?


Top
   
PostPosted: Tue Jan 07, 2020 7:27 pm 
Offline

Joined: Tue Jan 07, 2020 6:47 pm
Posts: 2
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.


Top
   
PostPosted: Wed Jan 08, 2020 5:47 pm 
Online

Joined: Thu Jul 27, 2017 7:54 pm
Posts: 16
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.


Top
   
PostPosted: Wed Jan 08, 2020 7:10 pm 
Offline

Joined: Tue Dec 10, 2019 6:38 pm
Posts: 5
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!


Top
   
PostPosted: Fri Jan 17, 2020 2:58 am 
Offline

Joined: Tue Dec 10, 2019 6:38 pm
Posts: 5
bjh wrote:
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!


Top
   
PostPosted: Fri Jan 17, 2020 5:37 pm 
Online

Joined: Thu Jul 27, 2017 7:54 pm
Posts: 16
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.


Top
   
PostPosted: Fri Jan 17, 2020 10:46 pm 
Offline

Joined: Tue Mar 26, 2019 4:28 pm
Posts: 95
1. Do you think it is possible, to set your GIT diff tool to CODESYS.exe --compare ?

https://help.codesys.com/webapp/_cds_co ... n=3.5.15.0

https://git-scm.com/docs/git-difftool

2. 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

3. 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


Top
   
PostPosted: Thu Jan 23, 2020 1:01 am 
Offline

Joined: Tue Dec 10, 2019 6:38 pm
Posts: 5
I'll try all of those things, thanks for your thoughts!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 posts ] 

All times are UTC+01:00


Who is online

Users browsing this forum: andre_teprom, bjh and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Limited