Before we start, I want to say that the off the shelf TIA Portal’s library management features are not ideal compared to other more open source style brands like B&R’s Automation Studio. But given the history of the SIMATIC controllers, I can accept this imperfection. Hopefully in the future SIEMENS will fix the issue.
This article is a part of a series of articles that introduces various ways to manage the TIA Portal library.
Introduction
The concept of library in the Industrial Automation can vary from the source management to the project “template” management. I am not going to define what TIA Portal Library is, but will focus on different methods that we can use and their scope of management.
In this article, I’ll introduce the library management method by using the version control interface (VCI) feature of TIA Portal. I’ll start by introducing the scope of management this method covers and then provide an application example. At the end of this article I’ll provide a short conclusion and a comparison of the various library management methods which will be the same part of the other articles of this blog series.
You can also check out the other articles via the links below.
- TIA Portal Library Management Methods 1: Import / Export
- TIA Portal Library Management Methods 2: Global Library
Let’s start.
Scope of Management
The VCI method can manage programs (OB, FB, FC), data blocks (including technology objects since they are a type of DB), UDTs and tag tables.
The VCI can’t work with the global library features so if a program is typified, it can’t be managed by VCI. To learn more about the global library method, check out my blog post here.
VCI can’t manage CEM blocks nor know how protected blocks are.
Now let’s look at the application example.
Application Example
The VCI is getting more features and this application example is based on TIA Portal V19.
Configure the Workspace
Either with Git or SVN, it is important to prepare a workspace for the programs. If you already have a directory for your programs, that’s great, otherwise, create the directory before continuing.
It is important to note that MS OneDrive has its access control running in the background and it may block your applications / TIA Portal Addins / TIA Portal Openness Tools, so try to avoid it. This issue may also happen with LAN shared folders or other network storage services.
Since your programs will be managed in a remote Git / SVN repository, saving your local files in a synced storage is not really that important (you’re writing code, not a novel).
After getting your Git / SVN folder ready, you can go to TIA Portal and configure your workspace by doing the below things.
Your workspace is successfully configured.
Manage Program in the Workspace
Copy Program to Workspace
After having your workspace configured, you can start to put your programs in and manage them. It is extremely easy in the TIA Portal. Simply drag and drop the programs that you want to manage in your environment and TIA Portal will do the rest.
In this application example, I have two programs in the folder VCI that I want to manage via Git. I can either drag the folder to my workspace or create a folder and drag the programs in it. I prefer dragging the folder because it will help me maintain a consistent file structure in my PLC project and the workspace.
Commit Changes and Update Program from Library
One feature that I like about the VCI is it allows me to choose my actions for each program. In the below example, I have made some changes in my local project that I want to commit to the repository but in the meantime I have some updates from the repository that I also want to get into my project, I can do both in one go.
Below you can see that the two FBs are both having some differences between my local project and the repository. VCI_Example_LAD has some program changes that I made locally. Meanwhile, VCI_Example has some changes from the repository that I want to apply to my local project.
I can choose which direction to sync for each program. Here I’m getting the repo’s change to my local and updating the repo with my local change at the same time.
After running the sync, both the repo and the local project are updated.
For DBs, TOs, UDTs and tag tables, the process are exactly the same hence I’m not going to spend time on them.
Manage Programs in a Repo
After finishing the above actions, the local PLC project’s program and the repo’s local copy / active branch are synced. From this point onwards, you can choose any tool you prefer to finish the rest of the version control tasks.
Since the further actions are highly personalized, I won’t cover them here.
(Optional) Add VCI Extensions
VCI extensions are based on TIA Openness. They provide some useful extra features that I’d like to have.
SIMATIC Automation Compare Tool
This one is useful if your program is not text based. You can download it from the SIEMENS support link and install it.
After doing so, you can follow the below actions to configure the compare tools.
In my case, I have configured Notepad++ for text based comparison and the SIMATIC Automation Compare Tool for the non-text based programs.
If I have some program changes in VCI_Example_LAD, I can fire up the compare tool that I have configured like below.
The compare tool is quite powerful in processing the program differences and provides the results with looks and feels of the TIA Portal’s internal compare tool.
For text based programs, I’m using Notepad ++ for the comparison but you can choose any other tool for it. Since text based programs are much more flexible in terms of comparison, I will not go further in this direction.
VCI Git and SVN Extension
If you prefer Git / SVN GUI built for TIA Portal, you can get this extension. It is provided by SIEMENS and can be downloaded from the link.
After downloading and unzipping, simply copy the .addin file to \your TIA Portal’s installation directory\Automation\Portal Vxx\AddIns. Then in TIA Portal, enable the addin by following the below actions.
Of couse, you will need to install Git.
Now you can perform basic Git operations in TIA Portal.
Conclusion
The version control interface method brings the traditional control automation software development closer to the modern software development world but it is not a comprehensive approach due to its limited management scope.
I recommend this method if you’re a developer and your development doesn’t require certain hardware (i.e., you develop a control algorithm that is generic for your applications and doesn’t involve hardware features).
If your development requires certain hardware support and you’ve got to this blog post which is clear and easy to you, I suppose the TIA Openness tool will better suit you.
Comparison of Various TIA Portal Library Management Methods
Method | Cost | Scope | Git Compatibility | Extra Development |
---|---|---|---|---|
Import / Export | Free | Text based programs and UDTs | Use Git independently | No |
Global Library | Free | Entire TIA Portal project | No | No |
VCI | Free | Software, UDTs, TOs, tag tables | Yes | No |
Openness | Free | Entire TIA Portal project | Yes | Yes |