TIA Openness GettingStartedAndDemo V14SP1 en
TIA Openness GettingStartedAndDemo V14SP1 en
TIA Openness GettingStartedAndDemo V14SP1 en
Introduction and
Demo Application
Siemens
TIA Portal V14 SP1 Industry
Online
https://support.industry.siemens.com/cs/ww/de/view/108716692 Support
Warranty and liability
Note The Application Examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The Application
Examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are used correctly. These Application Examples do not
relieve you of the responsibility to use safe practices in application, installation,
operation and maintenance. When using these Application Examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
Application Examples at any time without prior notice.
If there are any deviations between the recommendations provided in these
Application Examples and other Siemens publications – e.g. Catalogs – the
contents of the other documents have priority.
We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of
the examples, information, programs, engineering and performance data etc.,
described in this Application Example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act ("Produkthaftungsgesetz"), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
Siemens AG 2017 All rights reserved
Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, systems, machines and networks.
tion In order to protect plants, systems, machines and networks against cyber
threats, it is necessary to implement – and continuously maintain – a holistic,
state-of-the-art industrial security concept. Siemens’ products and solutions only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.
Table of Contents
Warranty and liability ................................................................................................... 2
1 Task ..................................................................................................................... 4
2 Solution............................................................................................................... 5
2.1 Overview............................................................................................... 5
2.2 Hardware and software components ................................................... 5
2.2.1 Validity .................................................................................................. 5
2.2.2 Components used ................................................................................ 5
3 Mode of Operation ............................................................................................. 7
3.1 TIA Portal Openness ............................................................................ 7
3.1.1 Range of functions ............................................................................... 7
3.1.2 Restrictions ........................................................................................... 9
3.2 "StartOpenness" application example .................................................. 9
3.3 "DemoOpenness" application example ................................................ 9
4 Creating a New TIA Portal Openness Application ....................................... 10
4.1 Installing TIA Portal Openness ........................................................... 10
4.2 Managing user rights .......................................................................... 10
4.3 Creating a project ............................................................................... 12
4.4 Configuration file/AssemblyResolve ................................................... 13
4.5 Permitting access ............................................................................... 14
Siemens AG 2017 All rights reserved
5 StartOpenness ................................................................................................. 15
5.1 Overview............................................................................................. 15
5.2 "TIA Portal" group ............................................................................... 17
5.3 "Project" group ................................................................................... 18
5.4 "Add" group ........................................................................................ 19
5.5 "Compile" group ................................................................................. 20
6 TIA Openness Demo ........................................................................................ 21
6.1 General ............................................................................................... 21
6.2 Application examples ......................................................................... 21
6.3 Methods .............................................................................................. 22
6.4 Description of the application ............................................................. 23
6.4.1 General settings ................................................................................. 23
6.4.2 Flexible AssemblyResolve ................................................................. 24
6.4.3 TIA Portal functions ............................................................................ 24
6.4.4 Project functions ................................................................................. 26
6.4.5 Importing/exporting objects ................................................................ 29
6.4.6 Libraries .............................................................................................. 31
6.4.7 PLC..................................................................................................... 32
7 Related literature ............................................................................................. 35
8 History............................................................................................................... 35
1 Task
Introduction
In STEP 7 or WinCC V14 SP1 TIA Portal Openness is included in the delivery of
STEP 7 or WinCC in TIA Portal. This enables you to program the applications
which automate the engineering in TIA Portal.
Public API
Own Import/
program Export
Scenarios
Based on a text database, project texts are to be complied program-controlled
automatically and applied in the TIA Portal project. This way, you can quickly
use standardized texts in new projects.
The visualization is to be created automatically with the help of exported PLC
data.
Project statistics or backups can be created automatically. With the help of
your program you can check whether programming guidelines were met.
Projects can be automatically compared with global libraries and if required,
updated and compiled.
The offline project can be automatically compared with the online projects in
order to ensure plant consistency.
With the help of a tool the entire project is to be created based on prefabricated
project parts.
2 Solution
2.1 Overview
Advantages
The solution presented here, offers you the following advantages
More efficiency by executing the task faster
Accuracy by automating constant processes
Short commissioning times through configuration setup
Competitiveness by targeted use of resources
Delimitation
This application does not contain a description of:
Basics on object-oriented programming
Basics on programming environment, such as e.g. Microsoft Visual Studio
Basics on TIA Portal configuration
Basic knowledge of these topics is assumed.
Siemens AG 2017 All rights reserved
Software components
Table 2-1
Component No. Article number Note
STEP 7 Professional 1 6ES7822-1AA04-0YA5
V14 SP1
WinCC Advanced 1 6AV2102-0AA04-0AA5
V14 SP1
TIA Portal Openness 1 Included in the delivery of STEP
7 or WinCC V14 SP1 (in
subfolder "Support" of the
installation files)
Microsoft Visual 1
Studio 2015
Table 2-2
Component Note
108716692_TiaPortalOpennessDemo_V14 Demo application for the use of TIA
SP1.zip Portal Openness (see chapter 6)
108716692_StartOpenness_V14SP1.zip Introductory example for the use of TIA
Portal Openness (see chapter 5)
108716692_TIA_Openness_GettingStartedAnd This document.
Demo_V14SP1_en.pdf
Siemens AG 2017 All rights reserved
3 Mode of Operation
3.1 TIA Portal Openness
In STEP 7 or WinCC V14 SP1 TIA Portal Openness is available for free on the
respective product DVDs. Prerequisite for the use is an installation of STEP 7 or
WinCC V14 SP1.
TIA Portal Openness provides DLLs via which you can access the TIA Portal
platform. These DLLs are based on .NET Framework 4.6.1.
Table 3-1
Further
Device Function see
information/restrictions
Throughout Opening TIA Portal P. 24
the project
Throughout Closing/separating TIA P. 25
the project Portal
Throughout Connecting TIA Portal P. 24
the project process
Siemens AG 2017 All rights reserved
Further
Device Function see
information/restrictions
management as XML windows
HMI Importing elements of the P. 29 Exception: Pop-up and slide-in
screen management from windows
XML
HMI Exporting tags/tag tables as P. 29
XML
HMI Importing tags/tag tables P. 29
from XML
HMI Exporting connections as P. 29 Non-integrated connections
XML
HMI Importing connections from P. 29 Non-integrated connections
XML
HMI Exporting scripts as XML P. 29
HMI Importing scripts from XML P. 29
HMI Exporting cycles as XML P. 29
HMI Importing cycles from XML P. 29
HMI Exporting text and graphic P. 29
lists as XML
HMI Importing text and graphic P. 29
Siemens AG 2017 All rights reserved
3.1.2 Restrictions
With TIA Portal Openness V14 SP1 you can only access projects and libraries
with version V14 SP1. If required, upgrade your project or your library before
using TIA Portal Openness.
Compatibility between the TIA Portal Openness versions cannot be
guaranteed. A new version may require changes in your program.
At present, it is not possible to access the WinCC Runtime Professional
configuration or the data from Startdrive objects via TIA Portal Openness.
Table 4-1
No. Action
1. Open the STEP 7 or WinCC V14 SP1 product DVD. Start the installation setup
"Siemens_TIA_Openness_V14SP1" in the "Support" folder.
2. Follow the instructions of the installation setup.
Table 4-2
No. Action
1. Right click "Computer" in the windows taskbar and select "Manage".
2. Open "Local Users and Groups and Groups > Users" and double click the user.
No. Action
3. Go to the "Member Of" tab and click the "Add" button.
The installation path of the TIA Portal is read out of the registry so that the
program can be used irrespective of the installation path.
System manual
(https://support.industry.siemens.com/cs/ww/en/view/109477163)
Siemens AG 2017 All rights reserved
2. Confirm the message with "Yes" in order to permit the access once.
Confirm the message with "Yes to all" in order to always permit access to this
application.
Click "No" to deny the access.
Note If you are working with Microsoft Visual Studio, it can happen that you will
receive the message, although you have already clicked "Yes to all". In order to
avoid this, follow the instructions in entry \5\.
5 StartOpenness
5.1 Overview
The "StartOpenness" program is to facilitate access to programming your first
independent Openness application.
Figure 5-1
Siemens AG 2017 All rights reserved
Table 5-1
No. Action
1. Open the project "StartOpenness".
2. Open the "Form1" class.
Table 5-2
No. Description
1. Select whether the TIA Portal is to be started with or without user interface via
the option boxes "With User Interface" and "Without User Interface".
Siemens AG 2017 All rights reserved
2. Click the "Start TIA" button in order to start the TIA Portal.
The "StartTIA()" method is called.
The "MyTiaPortal" tag is assigned a new TIA Portal instance.
3. Click the "Dispose TIA" button in order to end the TIA Portal or the connection to
the TIA Portal.
The "DisposeTIA()" method is called.
With "mytiaportal.Dispose()" the connection to the TIA Portal is terminated (if the
TIA Portal was not started with the user interface) or the TIA Portal was
terminated (if the TIA Portal was started without user interface).
Table 5-3
No. Description
1. Click the "Open Project" button in order to open a new project. Select the project
Siemens AG 2017 All rights reserved
2. Click the "Connect to Open TIA Project" button in order to connect to an open
TIA Project.
No. Description
4. Click the "Close Project" button to close the project.
The "CloseProject()" method is called.
The project is closed via "MyProject.Close()".
3
Siemens AG 2017 All rights reserved
Tabelle 5-4
Nr. Beschreibung
1. Enter in the text field the name of the device you would like to add.
2. Enter in the text field the order number of the device you would like to add.
3. Enter in the text field the version of the device you would like to add.
4. Click the "Add Device" button to add the device.
The "btn_AddHW_Click()" is called.
If no device with the entered name is found, the device is added and output in the
status field.
Table 5-5
No. Description
1. Enter in the text field the name of the controller or the operator panel you would
like to compile.
Siemens AG 2017 All rights reserved
In the method Compile() the name of all devices and their DeviceItems are
compared with the entered names.
6.3 Methods
CompareTo(Object) ........................................................................... 33
CompareToOnline() ........................................................................... 33
CreateFromFile(sourcename, filename) ............................................ 34
Delete() .............................................................................................. 29
ShowInEditor ...................................................................................... 28
Compile() ........................................................................................... 29
Dispose() ............................................................................................ 25
Export(path, exportOption) ................................................................ 30
Groups.Create(FolderName) ............................................................. 28
GenerateBlockFromSource() ............................................................. 34
GenerateSourceFromBlocks(blocklist, filepath) ................................ 34
TiaPortal.GetProcesses() .................................................................. 25
GlobalLibraries.Open(fileName) ........................................................ 32
GoOffline() ......................................................................................... 33
GoOnline() ......................................................................................... 33
Import(file, importOption) ................................................................... 30
Siemens AG 2017 All rights reserved
Project.Close() ................................................................................... 26
Project.Save() .................................................................................... 26
Project.ShowHwEditor(Siemens.Engineering.HW.View.Network) .... 28
Project.ShowHwEditor(Siemens.Engineering.HW.View.Topology) .. 28
Projects.Open(new FileInfo(filename)) .............................................. 26
process.Attach() ................................................................................. 25
ShowInEditor ...................................................................................... 28
TiaPortal ............................................................................................. 24
UpdateCheck ..................................................................................... 32
Table 6-1
No. Action
1. Click the "File->Settings".
Siemens AG 2017 All rights reserved
2. Select whether the TIA Portal is to be started with or without user interface.
3. Select the export settings.
4. Select the default path for the export and import files.
5. Click the "Save" button to save the settings.
Figure 6-1
Siemens AG 2017 All rights reserved
Figure 6-2
Figure 6-3
By clicking the instance, the demo application connects with this instance.
Siemens AG 2017 All rights reserved
Figure 6-4
Opening/saving/closing project
If no project is opened yet, you can open a project via "File > Open project".
Figure 6-5
If a TIA Portal project is opened, you can save or close the project via "File > Save
project" or "File > Close project".
Figure 6-6
For this purpose, all "Devices" and their "DeviceItems" included in the project are
read out.
Open the class "General.cs" in the "TiaOpennessHelper" project.
In this class the project contents are read out and provided as lists.
In the "MainWindowViewModel.cs" class of the "TIAPortalOpennessDemo" project
this list is accessed in the "CreateDeviceTreeViewItem ()" method.
When listing the elements, please note the following:
Many elements can be located in user-defined folders. The nesting depth is not
necessarily known here. For this reason the functions should be recursive.
Opening editors
You can start the topology and the network editor in the user interface of the TIA
Portals with "Project > Editor".
Figure 6-8
Creating folder
Depending on your selection in the project tree of the TIA Portal Openness
application, you can create new folders (e.g. block folder).
Figure 6-10
Figure 6-11
Deleting elements
Depending on your selection in the project tree of the TIA Portal Openness
application, you can delete folders.
Figure 6-12
Compiling elements
The device can be compiled with TIA Portal Openness.
Siemens AG 2017 All rights reserved
Figure 6-13
Figure 6-14
Note You can only export consistent blocks. Compile the blocks before exporting.
6.4.6 Libraries
Figure 6-15
Siemens AG 2017 All rights reserved
Note The global library is opened for access via Openness. It is not displayed in the
user interface of the TIA Portal.
With the "Libraries" button on the right side of the demo application, the project
library and global library that has been opened with Openness is shown.
Figure 6-16
For this purpose, a tag of the "GlobalLibrary" type is initialized with the
"GlobalLibraries.Open(fileName)" method of the TIA Portal tag.
If a global library is opened and selected in the application, you can close the
global library with "File > Close global Library".
You find the "CloseGlobalLibraryCommand_Executed" function in the
"MainWindowViewModel.cs" class.
The library is closed with the "Close()" method of the library tag.
Update check
With the "Edit > Update global library" you can perform an update check.
Figure 6-17
Siemens AG 2017 All rights reserved
The result of the check is displayed in the status bar of the application.
6.4.7 PLC
Figure 6-18
Comparing controllers
Online/offline
You can compare the selected controller with the online connected controller with
"PLC > Compare > Compare to online".
Figure 6-19
Siemens AG 2017 All rights reserved
The result of the comparison is displayed in the status bar of the application.
Open the "CompareOnlineCommand_Executed" method in the
"MainWindowViewModel.cs" class.
The "CompareToOnline()" method of the control tag compares the controllers and
provides the result of the comparison of the "CompareResult" type as return value.
Online/offline
With "PLC > Compare > Compare to offline" you can compare a controller in the
project with a controller of a global library. Open the global library and select the
controller. Select the controller you want to compare in the project tree of the
application. The result of the comparison is displayed in the status bar of the
application.
Open the "CompareOfflineCommand_Executed" method in the
"MainWindowViewModel.cs" class.
The "CompareTo(Object)" method compares the controllers and provides the result
of the comparison of the "CompareResult" type as return value.
Figure 6-20
With the filter settings, you can select whether STL or SCL sources are to be
displayed.
Figure 6-21
7 Related literature
Table 7-1
Topic
\1\ Siemens Industry Online Support
http://support.industry.siemens.com
\2\ Download page of the entry
https://support.industry.siemens.com/cs/ww/de/view/108716692
\3\ Support Request
http://www.siemens.com/automation/support-request
\4\ Delivery release STEP 7 V14 SP1
https://support.industry.siemens.com/cs/ww/de/view/109745984
\5\ Why does your TIA Portal Openness application not work as expected?
http://support.industry.siemens.com/cs/ww/en/view/109251656
\6\ Why, when using a TIA Portal Openness application, do you get the error message
"Cannot connect to TIA Portal"?
http://support.industry.siemens.com/cs/ww/en/view/109038214
\7\ System manual
https://support.industry.siemens.com/cs/ww/en/view/109477163
Siemens AG 2017 All rights reserved
8 History
Table 8-1
Version Date Modifications
V1.0 02/2015 First version
V1.0 09/2015 Fixed minor problems
V1.1 12/2016 Version for TIA Portal V14
V1.2 05/2017 Version für TIA Portal V14 SP1