Using Siemens Version Control Interface (VCI) in TIA Portal

17.5 min video

In this video, we show you how to set up and use Siemens Version Control Interface (VCI) in TIA Portal. VCI allows you to sync code within function blocks to a central repository. Multiple programmers can access and edit the files, track development progress, and rollback the codebase to previous versions. We're using an Amazon Web Services (AWS) EC2 instance to host our remote repository through Gitlab.

Questions? Get in touch!

Learn more about Siemens Industrial Automation Products.

Intro

  • Hi and welcome! I’m Liz, co-founder of Outlier Automation, a Control Systems Integrator. Today I’m going to look at Siemens Version Control Interface, or “VCI” in TIA Portal.

  • I’ll start by talking about what version control means for software development, and then I’ll dive into how you can apply it to your Siemens TIA Portal development workflow.


Version Control

  • Let’s get started! At a high level, Version Control is how we track software development on both our local PCs and on an external server, which is typically the Cloud.

  • Now, usually, people think of version control as tracking text based programming languages where their development files can be opened and read by a text editor, like Notepad. That gets a little bit tricky for us PLC programmers, who use graphical programming languages, but I’ll go into more detail on that later. Let’s start by looking at a simple example.

  • Version control allows me to place, or “commit”, my file in a cloud storage area called a repository. Other people working on my project can view and “clone” the repository to edit the files on their own PCs.

  • If another developer has a change to make to the files, they can then “push” to the repository with their updated file. And the latest version of the file becomes the second commit.

  • Anyone looking at the repository can see what the changes were between the first and second commits.

  • All PCs can then “Pull” the latest commit and continue developing from the updated file.


Advantages

  • So what are some of the advantages of using version control?

  • First, it protects our codebase to ensure that we don’t lose any of our changes as we’re working. The development files are stored both in the cloud repository and on the development PCs. It also tracks changes so if we find a mistake in the code, we can just go back to a previous version.

  • The second major advantage is that it allows multiple developers to create and merge their changes into master files through a simple, coordinated workflow.

  • And last but not least, it allows us to track development progress. There are many version control tools that integrate project management. That way we can make sure that the code is developed on time and with minimal bugs.


Tools

  • Let’s go into some of the tools associated with Version Control.

  • By and large, the most popular version control tool is “Git”. In its simplest form, Git allows you to manage and view your repositories through a command line environment called Git Bash on Windows.

  • Git communicates with an external server to sync with repositories. At Outlier, we use our own EC2 instance on Amazon Web Services which contains an open source flavor of Git called Gitlab and stores all of our repositories in AWS S3 buckets.

  • Gitlab gives us a customizable web interface for viewing and tracking repos, and there are many project management tools that can help track our overall projects.

  • To use Git to track PLC project files, you need a way to convert the graphical programming files to a text-based file, and then transfer it to Git. This is where Siemens’ TIA Portal Version Control Interface comes in. Just like it sounds, VCI is TIA Portal’s interface to Git. It can export or import program blocks, which allows us to do backups, archiving, rollbacks, and share code between team members.

  • It’s important to note that VCI cannot sync an entire project to Git, it only syncs the code and tags within blocks like Function Blocks, Functions, datablocks, and PLC tags. It cannot sync instance memory, library types, or hardware configurations. When using VCI, it is useful to think about developing code with a modular approach. This makes it easier to track and test changes.

  • A useful feature of VCI is that it gives you a change log so that you can see what changed between different commits. But as I mentioned before, the files are stored in Git in XML format. Siemens has released the Automation Compare tool to make it easy to visually see differences between ladder code and datablocks that have been exported to XML.

  • Now that we’ve reviewed the tools we’re going to use, we’ll have my teammate Nic join us to walk you through exactly how to do all of this.


VCI Demo in Portal

  • Hey this is Nic. I’ll guide us through some implementation.

  • Let’s start by taking a quick look at the demo project we’ll be using. Here’s our project tree. We’ve got some DBs, some OBs, some tag tables, here’s our Main, and in PLC Tags, we have some safety tags that we'll come back to later.

  • We’ll be using a number of automation tools that Siemens developed in this demo. Let’s start off with the SIMATIC Automation Compare Tool.

  • We’re going to download that first by searching the term SIMATIC Automation Compare Tool, clicking the link, and the link to the download is here. Now that we’ve downloaded and unzipped the file off the website, we can just double click to run the installer.

  • We’ve got an executable now to run the tool from our desktop, but we can actually integrate this automation with Portal.

  • We’ll go to Options > Settings > at the bottom we have Version Control Interface > Compare. And here we’re going to point Portal to the executable file for the Automation Compare Tool.

  • That should be in This PC > C Drive > Program Files > Siemens Automation. Here it is. And it’s added.

  • So let's move on to our next add-in which is going to be Git.

  • Search Siemens VCI Git Add-In. This link, here. If I scroll down, here’s the download link for the VCI Git Connector. That’s a quick download. I’ll extract the zip file. And the method of installing add-ins into Portal is quite simple. We’re just going to take this add-in file and add it to Portal's executable folder. Let’s find that in C Drive > Program Files > Siemens Automation > Portal V17 > and then the add-ins folder. We take that dot-add-in and drag it right over.

  • By default, add-ins are going to start out disabled in Portal. We just have to come over here and enable it using the add-ins tab. Drop this down. There it is. For status- instead of X, we’ll choose Activate.

  • Now here it’s just going to show us some of the different permissions we’re giving the add-in, because it is kind of a third-party thing, even though it is from Siemens. We accept all of those, so now it’s good to go.

  • Before we go any further, let's go ahead and clone our repo. We’ll be using the built in Git GUI that comes when you download Git. We’ll need an SSH key, so we’ll grab that.

  • We’re using Gitlab for our Git management. I’ll go to preferences and SSH keys and drop mine in here to generate it. Obviously this process could be different depending on what service you use for Git, so this is not too critical.

  • Ok, now I’ll hit Clone and Clone with SSH. That will give me a URL I can use in the GUI. I’ll clone an existing repo at that URL and I’ll put the target to TestRepo on my desktop. There it is, looks like it cloned it successfully.

  • Alright, we’ve got everything. Now let’s get going with VCI.

  • I’ll open up Portal > Version Control Interface > Add a new workspace > Workspace 1

  • We’ve got all our blocks and objects on the left. You can see our workspace is not configured, so I’ll click here. The workspace path is just our Repo, on the local machine. We can select Git here as our Version Control Add-In since we added that earlier on. Now I’ll just go ahead and grab and drag PLC_1 over.

  • Oh looks like we got an error. Let’s see, BoilerAlarm.xml. Ok, how about the log file. “Cannot be exported. Block is a type instance. Export is not possible”. So that brings up a good point. A type object is already managed in version control through Siemens Libraries, so it actually wouldn’t make sense for us to try to use VCI for it here.

  • We can right-click here to use Git and add our PLC to our Version Control. Then we’ll do it again, except this time we’ll commit. That will put all of our XML blocks committed to our local repository. I’ll put a comment. Looks good!

  • Now I can right-click > Git > and Push to the remote repository. That looks good too, let’s check it out on GitLab. There it is, that’s my comment and this is the data.

  • Hi, it’s Liz here again. I'm working on the project with Nic, but on my own PC. Now that Nic is done, I’m going to go in and make a few changes.

  • I have here the latest version of the project. I’m going to go into the Safety Tags and create a new tag called E-Stop Not Activated. And I’ll go into my program block and assign it to this output. I’m also going to change this upper limit to 1700.

  • Now to commit my changes, I’ll go to VCI in the Project tree. You can see that the VCI workspace has detected changes to our local project. I’ll export my changes to the workspace and synchronize. I’ll need to compile first. Then it will prompt me to write a description of what I’ve changed. And I’ll push the workspace to Git.

  • If I open Git, I can see that my commit is posted. Next, Nic is going to pull this commit and look at my changes. As you can see, they’re not totally clear aside from the description I gave, so Nic’s going to use Siemens’ Automation Compare Tool.

  • [Nic] I'll right click on PLC_1 > Git > Pull. That’s going to pull the changes from the remote repo to my local one. So now we can see there’s a difference between what I have in Portal and what I just pulled.

  • Here are my options for how I can deal with that, I can either import or export or discard the actions. But first I want to see what changed, so I can right-click, and here’s where we can use the Automation Compare Tool.

  • That loads up, and we can see the difference. On the left was the original block. Looks like we had 1500 for the high limit and then in that last commit it was changed to 1700.

  • How about the safety routine? Let’s see- here’s the change. Seems like there was nothing on that output before, and now we added a new tag.

  • We can also use the ACT with PLC tags. So here’s our safety tags, and we can see that a new boolean tag was added to this tag table.

  • So I’ll decide to import all of those changes and synchronize. Thats going to pull the changes in from Git to this project. So I can verify that pretty easily now, everything is green. If I go to my main OB1, that 1500 is now 1700.


Outro

  • And that’s all for today! Thanks for watching! If you have any questions, send us a message at info@outlierautomation.com and check out the other resources on the blog on our website. Bye!

Outlier Automation