Get new content delivered to your inbox every month.
No spam, unsubscribe anytime.
If you have ever worked on a large project with multiple engineers, you know how messy version control can be.
You have most likely retrieved the latest version of a project by going to shared folder and opening the last modified version of a project that has a name like "PLC2100_310725_ KB_ V2_ Final".
You have most likely tried to go online with the controller and discovered that this was not actually the latest version.
The latest version is on Bob's laptop and Bob has gone home for the day.
F*cking Bob.
FactoryTalk Design Studio, Rockwell Automation's next generation development system for Logix 5000 PLCs, uses Git as an integrated version control system. Git is a distributed version control system that has been used in IT for many years to track changes in a project and to allow multiple people to work together in a project.
In this post, I'll show you how the integrated version control system works in FactoryTalk Design Studio. I'll also show you how it enables multi-user collaboration and talk about some of the limitations of the implementation in Design Studio.
Let's start by looking at how a single user can use the integrated version control system to track changes to a project over time.
In FactoryTalk Design Studio, I click on New Project to open the New project dialog.
In this dialog, I specify a name for the project and where it will be stored in the FactoryTalk Vault. In this example, I am adding this project to the default solution, called default.
This is very different to Studio 5000 Logix Designer where the project was stored locally on your computer. With FactoryTalk Design Studio, your project is stored in FactoryTalk Vault which is a secure remote repository.
When you click Create, the project is created in FactoryTalk Vault and a local copy of the project opens in your browser. So when you work on the project in your browser, you are not working on the actual project. You are working on a local copy that lives in your workspace while the actual project is safely stored in FactoryTalk Vault.
As you make changes in your project, FactoryTalk Design Studio will check for differences between your copy of the project and the version in FactoryTalk Vault. You can see the status of the project in the bottom right corner of FactoryTalk Design Studio. In this case, there are local changes in my project that don't exist in the project in FactoryTalk Vault.
As I make changes to the project, those changes are automatically saved in my local copy of the project but to get those changes into the project in FactoryTalk Vault, I have to do two things:
First, I have to commit the change using the commit button.
Each time I commit changes to the local repository, I can add a Commit Message that documents what I have changed. When you commit a change, you are basically making the change permanent.
After committing a change, I am prompted to push those changes to the remote repository which is the project in FactoryTalk Vault. I can do that using the Push button on the version control toolbar.
After pushing my local changes to the remote repository, I can see that my local repository and the remote repository are synced again:
At any time, I can click on the Change History button on the version control toolbar to see a list of all the commits that have been made in this project. The Change History overview shows the Commit Messages for the changes as well as who made the change and when they made it.
I can also compare two commits to see exactly what has changed in the project.
Right now, this comparison is only available in a textual display but it is on the roadmap to add a graphical comparison too.
This is a much more effective way to track changes in a project than traditional methods of storing many copies of a project on a shared folder and makes it very easy to understand who changed something, when they changed it, why they changed it, and exactly what was changed.
What's really cool is that this Git integration also enables multi-user collaboration in FactoryTalk Design Studio.
Let's see how that works.
As I already mentioned, when you open a project in FactoryTalk Design Studio you are actually creating a local copy of the project.
It turns out that multiple users can have local copies of the same project. Here, I am opening the project while logged in as a different user.
After opening the project, I can make changes and commit them to the remote repository.
Now any other user who is working on the project is notified that remote changes are available and is prompted to pull those remote changes into their local copy using the Pull button on the version control toolbar.
After pulling the changes, all of the changes are available in the local project. I can also see in the commit history what has been changed and by who.
Occasionally, conflicts will occur when two people are working in the same project. A conflict occurs when two people change the same line of code.
When a conflict occurs, the person who is pulling the change can resolve the conflict and push the resolution back to the remote repository.
To resolve a conflict, you can choose to keep the local change, accept the remote change, or keep both changes.
I think its great that Rockwell Automation are adding version control to their products and I think it will improve the lives of a lot of controls engineers.
I also like the fact that they are integrating trusted, proven products like Git rather than trying to reinvent the wheel.
However, the implementation is not perfect. My main gripes are:
I have to use FactoryTalk Vault as my remote repository even though I may want to use GitHub or BitBucket.
There is no support for branching.
When working with Git, you can create branches which are parallel versions of a project where you can develop and test without modifying the main project. Once your development is done, you can merge these branches back into the main project or discard the branch.
There is no support for forking.
With Git, you can create a Fork of a project which is a parallel version of a project that diverges. This would be very useful to get library objects into a starting project or to make a customer specific copy of a project for a standard machine.
The version control system in FactoryTalk Design Studio is not perfect, but it is very good.
Its amazing to be able to see exactly what has changed as a project develops and it enables multi-user collaboration in a very controlled way.
There are a few features that are missing, but I have no doubt that they will be added in future releases of FactoryTalk Design Studio.