Siemen’s TIA Portal provides quite a few useful features that make it very easy to update and maintain code. Updating projects from one version to the next is as easy as opening the project in the newer version of Portal. However, there are times when you want to revert a project to an older version of TIA Portal, something that Portal cannot do. That’s where TIA Portal Openness can help.
For those looking to revert projects from V15 to V14, this post will outline the process of using TIA Portal Openness to automatically revert a project from TIA Portal V15 to V14 SP1 (note that due to large changes in the XML format, this will not work for versions earlier than V14 SP1).
Overview:
Many parts of TIA Portal projects, like PLC/HMI tags and HMI alarms, can already be exported and imported as .xlsx files between TIA Portal versions, but some parts, like ladder logic and HMI screens can’t be easily exported and reimported to older versions. It's possible to export these as a source, assuming the code can be first converted into structured text language (STL).
This process is time-consuming and incomplete since it misses much if the block's metadata and some blocks can't automatically convert into STL. Openness, and specifically this post, are geared towards saving time and effort by exporting and importing:
- Screens
- Screens with faceplates
- Program blocks
- Program blocks with arrays of data blocks
TIA Portal Openness can import and export more than this, but these items cover most of what you would otherwise have to recreate manually, and some of the special cases you are likely to run into.
Exporting:
- Download TiaPortalOpennessDemo Version 15 and 14 SP1
- Create a new V14 SP1 project with the same hardware and device configuration as your V15 project, in TIA Portal V14 SP1
- Start Openness V15 by navigating to the.exe file inside TiaPortalOpennessDemo_V15\TiaPortalOpennessDemo\bin\Release
- Use Openness to open your V15 Project - this will require a working version of TIA Portal V15
- Select what device or devices you want to export and click 'export.' By default, this will export all the code on that device as .xml files into c:\Temp
These .xml files contain all the information from your TIA Portal blocks and screens as structured XML code. Before we can re-import these into V14 SP1, we have to change a few parameters. I like to use Notepad++ since it can find and replace in any number of files in one shot, but you can use any text editor to make these changes.
- Replace all
V15
with V14 SP1
- Replace all
FlgNet/V2
with FlgNet/V1
- Replace all
SW/Interface/V3
with SW/Interface/V2
- Remove all
<SetENOAutomatically>False</SetENOAutomatically>
- Remove all
AccessModifier=”Array”
Importing (Program Blocks and Screens):
- Start Openness V14 SP1 by navigating to the.exe file inside TiaPortalOpennessDemo_V14SP1\TiaPortalOpennessDemo\bin\Release
- Uses Openness to open your V14 SP1 project - this will require a working version of TIA Portal V14 SP1
- Select a destination such as; Program blocks, PLC tags, PLC data types, screens, templates, HMI tags, etc.
- Click import and select your .xml files with the corresponding code
Now you can save the project and close Openness.
Screens with Faceplates and
Program Blocks with Arrays of Data Blocks:
Importing a screen with a faceplate that is not already in the project library will crash Openness and TIA Portal without any error message. However, it's still possible to import these screens. To import screens with faceplates, first import, or recreate, a matching project library and make sure that the library file structure and versioning exactly match the structure and versioning of the original library. Then import the screens one at a time saving in between each import in case any library differences persist.
Similarly, importing program blocks with arrays of data blocks will throw an error due to differences in formatting and syntax in the interaction of XML and TIA Portal. Working around this error is more difficult and time-consuming. We found the quickest solution was to replace the arrayed data block references in the .xml file with a placeholder string and then manually reenter the arrayed data block’s references in TIA Portal. This method does require a solid understanding of both .xml and regular expression to find and then replace all the arrayed data block references but can be made to work in most situations.
<Part Name="TON" Version="1.0" UId="44">
<Instance Scope="GlobalVariable" UId="45">
<Component Name="AlarmTimers" />
<Component Name="Timer" >
<Access Scope="LiteralConstant">
<Constant>
<ConstantType>DInt</ConstantType>
<ConstantValue>252</ConstantValue>
</Constant>
</Access>
</Component>
</Instance>
<TemplateValue Name="time_type" Type="Type">Time</TemplateValue>
</Part>
<Part Name="TON" Version="1.0" UId="44">
<Instance Scope="GlobalVariable" UId="45">
<Component Name="AlarmTimers" />
</Instance>
<TemplateValue Name="time_type" Type="Type">Time</TemplateValue>
</Part>
Conclusion:
TIA Portal Openness is a great tool for reverting projects from TIA Portal V15 to V14 SP1 and has the potential to save a great deal of time for projects that require reverting versions. Openness adds beneficial and timesaving functions to TIA Portal's already impressive version updating abilities. It’s not flawless and it can’t automatically import and export every code, but in combination with the import and export functionality native to TIA Portal, it can make reverting versions a breeze.