Using Git with RSLogix project files/HMI

PeeLC

Member
Join Date
Oct 2018
Location
Krypton
Posts
30
Hello PLCS.net!

I'm new to the PLC world but have had some interaction with the software world.

Within my team at least, it seems like version control will help out a lot. I have used Git in the past a lot. It's convenient to me, and easy to learn for the team.

I am aware that Rockwell has both merge and compare tools for projects. Using git extensions I can use custom tools for merge and diff.
Is there a way I can use rockwell merge and compare tools with command line, and project names?

Thank you for any help!
-PeeLC.

EDIT: Another way I though of using git was saving things as a .L5K file as well as an ACD file, and running diff on the .L5K file which is an XML, but then people would have to learn translating XML to ladder in their heads, which isn't a convenient option while the other compare tools exist already.
 
Last edited:
I've been doing this with RSLogix 500 for awhile now, see this post.


It isn't clean but it does work for me as a way to use git diff on my RS500 projects. I don't know about Studio 5000 because I don't remember how comparing projects works. Isn't it a separate tool? It might be as easy as running the tool with 2 parameters for the source and compare file.
 
I've been doing this with RSLogix 500 for awhile now, see this post.


It isn't clean but it does work for me as a way to use git diff on my RS500 projects. I don't know about Studio 5000 because I don't remember how comparing projects works. Isn't it a separate tool? It might be as easy as running the tool with 2 parameters for the source and compare file.
Thank you bjh! Your post does offer insight.

Most of our projects are in RSLogix5000, There is a tool called compare.
It is just what you want in your post(Command line accessible)and needs only two parameters.

I am still trying to figure it out, but hopefully have it going soon. Thanks!
-PLC.
 
Hello Van!

I wanted to use git because of the open source and chronological nature of version sourcing.
I work in a plant environment, with at least one version of the code always downloaded and running on the PLCs. This is a git users dream: Only one head and deployment at all times!
Even though we have factorytalk Assetcenter, I would rather prefer git myself, and to introduce to my team, compared to SubVersioN(Assetcenter).

Also, if we hire someone to integrate a new machine/PLC/MES into our code, we can give them a live code and have them merge their parts then, making it an awesome tool for collaboration as well.

Recently, I have been able to successfully able to use the merge as well as the compare tool via Git.Extensions. It's working and I'm using it at the moment. I'll post details about it soon.

Thanks!
-PeeLC.
 
In order to do merges, the compare tool would have to support that. Git itself doesn't know anything about the file it just handles everything at the binary level. The Compare tool is what would have to handle doing the merging and give git a new version for commit.



Does the RS 5000 compare tool handling doing merges?
 
In order to do merges, the compare tool would have to support that. Git itself doesn't know anything about the file it just handles everything at the binary level. The Compare tool is what would have to handle doing the merging and give git a new version for commit.



Does the RS 5000 compare tool handling doing merges?


Hello theColonel26,

I actually got the whole program running successfully now.
I have about ~15 PLCs with different code running on them. I use RSLogix Compare tool to handle diff and merge. It handles both!

The best part is that I now have a central repository set up which has all the code. It helps out with finding out what changed over the past commits.

Thanks!
-PreLC
 
@PreLC,


Would you be interested in writing up a tutorial post on how you did this? It doesn't need to be super dumbed down. As anyone that doesn't already have experience with Git probably shouldn't use it for this.


But even a basic walkthrough would be nice.
 
I'm currently developing a workflow and best practices for the OEM I work for for using git with our various platforms. I'd be interested in how you have git setup to use the compare tool. We've selected SourceTree and are using manually installed git for windows instead of SourceTree's embedded version. I created merge-tool and diff-tool entries for Rockwell Compare Tool, and have SourceTree set to use System Default for merge/diff tools. I just don't know how to make it use the Compare Tool with ACD files while using our primary compare program for text (WinMerge).

Related, if anyone is wondering how to tackle FactoryTalk's horrendous handling of HMI project files with git:

- Initialize a git repository somewhere, anywhere.
- use `git config core.worktree C:\\Users\\Public\\Documents\\RSView Enterprise\\ME\\HMI projects\\<ProjectName>` to set the working directory for the repository to the HMI project. Your path will vary based on Windows and FT version.
- Stage and commit the repo to get it up to date
- Add the repository as a subtree in your main project repository

We did a subtree instead of the safer submodule option because it makes it easier to move changes from the main repository down to the real HMI project directory that FTVS uses. That lets us get changes from coworkers without dealing with MER or APA files.

You absolutely can't use symbolic links to simplify this because Factory Talk just up and deletes the whole HMI project directory and recreates it if you ever restore from an APA or MER; that includes deleting the symbolic links. Of course putting the links on the repository side doesn't work well with windows, with or without support for symlinks turned on in git.
 
A guide to GIT.

Here it is:
I have this quick start guide that I made to use a version control system we have control over ourselves.
Here it is:
Hello PLCs.net!

I have Git up and running within my team. Git is a way to chronologically save stuff over time, so you don’t lose work which hasn’t been saved as a new copy of the old program. A repository is supposed to be an easy to maneuver location where code (Ladder logic woot woot!) and artifacts (E.G: HMI files) are stored.

The following is a small tutorial on how to use git, as well as an advanced in depth way of working with Rockwell tools and Git at the same time. You can make a personal repo just for yourself, or a combined repo for yourself as well as your teammates in a shared location. Both add value to my workflow personally.
We have the following code storage structure in our team:
-> Remote directory on a shared drive
-> Local directory per team-member

Tools used: -
- Windows 7 Pro(Home should do too, I think)
- Git Extensions 3.00.00.4433 : GUI which simplifies GIT for users.
- Git 2.19.2.windows.1 : Latest git release I could find.
- Studio 5000 Logix Designer V16-28 : All the different PLC firmwares we use in our plant. Haven't tested on all of them, but seems to be working fine with any I use.
- Logix Designer Compare v7.00.00 : Latest compare tool I could get my hands on.
🍻

OK, so here is what I did on the config side:

1) Make sure you have GitExtensions and Git installed on your machine.
2) If you want the capability of comparing, make sure you have LogixCompare installed on your machine as well.
3) Make an empty directory in a local location(Somewhere on your computer), then right click in windows explorer, and click GitExt Create new repository> Personal Repo> Create.
4) Once you have this empty repository, right click in windows explorer, and then GitExt Open repository.
5) In GitExt, click repository on the top right> Edit .gitignore > Add default ignores.
6) Then paste the following in there:
#Ignore useless packages created by RSLogix.
*.bak*acd
*.acd.recovery
*.sem
*.wrk
This would stop the temporary files from being backed up, and will declutter your system.
7) Hit save.
8) Now go to Tools> Settings>Git>Config. Enter your username and email. Hit save.
9) At this point, start moving your PLC code into this repository. which is logically and wisely created, so it's easy to maneuver through the programs you have.
10) Once you have them in the repo, it the Commit button at the top, it’ll pull up a commit dialog.
11) Hit commit, and then there you have it, the first node of your first git branch is now created.
At this point, you can start using git as a simple chronological way. It’s widely used in the code development industry, so you can look up anything from tutorials to error questions directly on google. Stack Overflow is my favorite resource.
12) Now comes the interesting part about how to merge Rockwell with Git. Make sure you have Logix Compare installed.
13) Bring back the Config menu from the earlier step. Now:
• Here, you’ll find an option to fill in your username, email, etc.
• In MergeTool: Type in something like RSLogixMerge, which defines a new mergetool in Git.
• My path to mergetool was: C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe
• The mergetool command was: "C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe" -m "$LOCAL" "$REMOTE" -PM FastestCompare
o This follows the syntax of the RSLogix command line switches.
• In Difftool type in something like RSLogixDiff, which defines a new difftool in git.
• My path to difftool was: C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe
• My difftool command was: 'C:/Program Files (x86)/Rockwell Software/Logix Designer Tools/Logix Designer Compare Tool/RSLCompare.exe' "$LOCAL" "$REMOTE" -PM FastestCompare
• Line endings: Not Set.
Hit apply, and you are set! Now, if you commit an ACD file, make a change, save it, and then commit another file.
You can use any youtube video to learn about how to use git-extensions further after that. But that should follow the standard process at that point.
 
I'm currently developing a workflow and best practices for the OEM I work for for using git with our various platforms. I'd be interested in how you have git setup to use the compare tool. We've selected SourceTree and are using manually installed git for windows instead of SourceTree's embedded version. I created merge-tool and diff-tool entries for Rockwell Compare Tool, and have SourceTree set to use System Default for merge/diff tools. I just don't know how to make it use the Compare Tool with ACD files while using our primary compare program for text (WinMerge).

Just got this guide from a reddit post I follow.

I was wondering, is there a way I can collaborate over these best practices? It'll be great if it's open and available for everyone.

Step 13 would be important.
 
Thank you for the detailed write-up. I am pretty new to using Git, but definitely want to explore its potential for my team. I am having trouble getting Git to launch the compare tool. Can you give an example of how to launch that, typically?
 
Any update to this since GitHub no longer allows for the Login Credentials but requires a Personal Authentication Token?

No updates to this tutorial, as it doesn't utilize GitHub, just Git, which is the underlying technology which GitHub provides storage space and a webinterface for.

On a sidenote though, using tokens should be just fine. Here are some instructions on how to use a personal access token with a repository. https://docs.github.com/en/github/extending-github/git-automation-with-oauth-tokens
 
I'm running into this a lot at work with conflaiting gitHub which is just one of many only repository services with the actual version control program git, which is not affiliated with gitHub, gitLab, BitBucket, or anyone else.

git is not gitHub the same way corn is not CornHub. *the P word is Censored here

Very reminiscent of the issue with people confusing TCP/IP with Ethernet/IP
 
Last edited:

Similar Topics

A previous thread touched on something that I'm a little curious about. In my prior job, we used Git for version control (with SourceTree as the...
Replies
14
Views
12,934
Hello everyone, I'm working on a project that involves controlling an array of nozzles within a CNC environment, where the nozzles travel along a...
Replies
5
Views
118
Hi, I was noticing that Profibus connectors have 2 ports on them that can house 2 separate cables. Can I use 2 cables with Profibus signals...
Replies
4
Views
120
Hi, Seeking consultation on an implementation matter, and have a question about Modicon Compact 984 communication through RS485: Three Modicon...
Replies
2
Views
82
Dear all, I don't know why setup of password became challenging and weird. After setting up the password and try to upload the ladder from the plc...
Replies
3
Views
91
Back
Top Bottom