Simatic TIA Portal Openness: API For Automation of Engineering Workflows
Simatic TIA Portal Openness: API For Automation of Engineering Workflows
Basics 4
TIA Portal
Openness: API for automation of
engineering workflows TIA Portal Openness API 5
Export/import 6
System Manual
Major Changes 7
Online documentation
05/2021
Online documentation
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent damage
to property. The notices referring to your personal safety are highlighted in the manual by a safety alert symbol, notices
referring only to property damage have no safety alert symbol. These notices shown below are graded according to
the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will be
used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to property
damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended or
approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and maintenance
are required to ensure that the products operate safely and without any problems. The permissible ambient
conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication may
be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software described.
Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the information in this
publication is reviewed regularly and any necessary corrections are included in subsequent editions.
1 Security note........................................................................................................................................ 19
2 What's new in TIA Portal Openness?.................................................................................................... 21
3 Readme TIA Portal Openness............................................................................................................... 25
3.1 Readme ............................................................................................................................. 25
3.2 Major changes for long-term stability in TIA Portal Openness V17 ....................................... 28
3.3 Hints for writing long-term stable code .............................................................................. 33
4 Basics ................................................................................................................................................... 35
4.1 Installation ........................................................................................................................ 35
4.1.1 Requirements for TIA Portal Openness ................................................................................ 35
4.1.2 Installing TIA Portal Openness ............................................................................................ 36
4.1.3 Adding users to the "Siemens TIA Openness" user group ..................................................... 37
4.1.4 Accessing the TIA Portal ..................................................................................................... 43
4.1.5 Configurations ................................................................................................................... 43
4.2 Openness tasks.................................................................................................................. 47
4.2.1 Introduction....................................................................................................................... 47
4.2.2 Applications....................................................................................................................... 48
4.2.3 Export/import .................................................................................................................... 49
5 TIA Portal Openness API ...................................................................................................................... 51
5.1 TIA Portal Openness object................................................................................................. 51
5.1.1 TIA Portal Openness object model ...................................................................................... 51
5.1.2 Blocks and types of the TIA Portal Openness object model .................................................. 57
5.1.3 Hierarchy of hardware objects of the object model ............................................................. 65
5.1.4 Object list .......................................................................................................................... 67
5.2 General functions .............................................................................................................. 71
5.2.1 Introduction....................................................................................................................... 71
5.2.2 Information about installed TIA Portal Openness versions ................................................... 71
5.2.3 TIA Portal Openness IntelliSense support ............................................................................ 72
5.2.4 Standard libraries............................................................................................................... 73
5.2.5 Use of the code examples .................................................................................................. 74
5.2.6 Example program............................................................................................................... 76
5.2.7 Programming steps ............................................................................................................ 80
5.2.8 Connecting to the TIA Portal............................................................................................... 81
5.2.9 TIA Portal Openness firewall ............................................................................................... 86
5.2.10 Event handlers................................................................................................................... 87
5.2.11 Program-controlled acknowledgement of dialogs with system events ................................. 89
5.2.12 Terminating the connection to the TIA Portal ...................................................................... 90
5.2.13 Diagnostic interfaces on TIA Portal ..................................................................................... 91
5.2.14 Exclusive access ................................................................................................................. 96
5.2.15 Dynamic behaviours .......................................................................................................... 98
5.2.16 Working with associations................................................................................................ 101
5.2.17 Working with compositions .............................................................................................. 101
5.12.3.27 Generating block/UDT from external source file in specific user group................................ 597
5.12.4 Technology objects .......................................................................................................... 598
5.12.4.1 Overview of functions for technology objects ................................................................... 598
5.12.4.2 Overview of technology objects and versions ................................................................... 599
5.12.4.3 Overview of data types .................................................................................................... 600
5.12.4.4 Querying the composition of technology objects .............................................................. 601
5.12.4.5 Creating technology object .............................................................................................. 602
5.12.4.6 Deleting technology object .............................................................................................. 603
5.12.4.7 Compiling technology object............................................................................................ 604
5.12.4.8 Enumerating technology object ....................................................................................... 605
5.12.4.9 Finding technology object................................................................................................ 606
5.12.4.10 Enumerating parameters of technology object ................................................................. 607
5.12.4.11 Finding parameters of technology object.......................................................................... 607
5.12.4.12 Reading parameters of technology object ......................................................................... 608
5.12.4.13 Writing parameters of technology object .......................................................................... 609
5.12.4.14 S7-1200 Motion Control................................................................................................... 610
5.12.4.15 S7-1500 Motion Control................................................................................................... 619
5.12.4.16 PID control....................................................................................................................... 640
5.12.4.17 Counting ......................................................................................................................... 641
5.12.4.18 Easy Motion Control......................................................................................................... 641
5.12.5 Tags and Tag tables .......................................................................................................... 642
5.12.5.1 Starting the "PLC Tags" editor ........................................................................................... 642
5.12.5.2 Querying system groups for PLC tags................................................................................ 643
5.12.5.3 Creating PLC tag table ...................................................................................................... 643
5.12.5.4 Enumerating user-defined groups for PLC tags .................................................................. 644
5.12.5.5 Creating user-defined groups for PLC tags ......................................................................... 645
5.12.5.6 Deleting user-defined groups for PLC tags ......................................................................... 646
5.12.5.7 Enumerating PLC tag tables in a folder ............................................................................. 646
5.12.5.8 Querying information from a PLC tag table ....................................................................... 647
5.12.5.9 Reading the time of the last changes of a PLC tag table..................................................... 649
5.12.5.10 Deleting a PLC tag table from a group............................................................................... 649
5.12.5.11 Enumerating PLC tags ...................................................................................................... 650
5.12.5.12 Accessing PLC tags ........................................................................................................... 650
5.12.5.13 Accessing PLC constants................................................................................................... 652
5.12.6 Functions for software units............................................................................................. 654
5.12.6.1 Working with software unit .............................................................................................. 654
5.12.6.2 Accessing software unit ................................................................................................... 657
5.12.6.3 Accessing software unit underlying objects ...................................................................... 658
5.12.6.4 Accessing to existing relations of a unit ............................................................................ 660
5.12.6.5 Updating software unit properties.................................................................................... 662
5.12.6.6 Publishing software unit object ........................................................................................ 664
5.12.6.7 Adding external sources in units....................................................................................... 666
5.12.6.8 Units as mastercopies ...................................................................................................... 668
5.12.6.9 Updating existing relations & create/delete relations......................................................... 670
5.13 Functions for Version Control Interface............................................................................. 676
5.13.1 Accessing VCI system group in project .............................................................................. 676
5.13.2 Enumerating user groups in VCI group ............................................................................. 676
5.13.3 Creating VCI user group in VCI group ................................................................................ 677
5.13.4 Updating VCI group properties ......................................................................................... 678
5.13.5 Deleting VCI user group.................................................................................................... 679
5.13.6 Enumerating VCI workspaces in VCI group........................................................................ 679
5.13.7 Creating VCI workspace in VCI group ................................................................................ 680
5.15.2.15 Checking state for UMC User and UMC User Group ........................................................... 730
5.15.2.16 Deleting UMC User and UMC User Group .......................................................................... 731
5.15.2.17 Complete sample code..................................................................................................... 732
5.16 Functions on OPC............................................................................................................. 740
5.16.1 Configuring OPC UA server secure communication protocol .............................................. 740
5.16.2 Setting OPC UA security policy.......................................................................................... 742
5.17 SiVArc Openness .............................................................................................................. 744
5.17.1 Introduction..................................................................................................................... 744
5.17.2 SiVArc service properties ................................................................................................. 744
5.17.3 Copying rules or groups from library................................................................................. 746
5.17.4 Finding a screen rule and screen rule group...................................................................... 747
5.17.5 Deleting rules and rule groups.......................................................................................... 748
5.17.6 UMAC set up for openness ............................................................................................... 749
5.17.7 SiVArc generation ............................................................................................................ 749
5.18 Functions for SINUMERIK 840D sl ..................................................................................... 752
5.18.1 Introduction..................................................................................................................... 752
5.18.2 Type identifier - identifier of the components .................................................................... 752
5.18.3 Fundamentals.................................................................................................................. 753
5.18.4 Object model ................................................................................................................... 756
5.18.5 Code example.................................................................................................................. 758
5.18.5.1 General ........................................................................................................................... 758
5.18.5.2 Executing the first steps in SINUMERIK.............................................................................. 758
5.18.5.3 Creating an NCU .............................................................................................................. 758
5.18.5.4 Creating an NX module .................................................................................................... 759
5.18.5.5 Connecting an NX module with NCU ................................................................................ 759
5.18.5.6 Activating Safety Integrated ............................................................................................. 760
5.18.5.7 Accessing PLC software .................................................................................................... 761
5.19 Functions for SINUMERIK ONE .......................................................................................... 763
5.19.1 Introduction..................................................................................................................... 763
5.19.2 Type identifier designation of the components ................................................................. 763
5.19.3 Fundamentals.................................................................................................................. 764
5.19.4 Object model ................................................................................................................... 767
5.19.5 Reference ........................................................................................................................ 769
5.19.5.1 Namespace Siemens.Engineering.MC.DriveConfiguration ................................................. 769
5.19.5.2 Namespace Siemens.Engineering.MC.Drives .................................................................... 777
5.19.5.3 ArchiveProvider................................................................................................................ 785
5.19.6 Code example.................................................................................................................. 786
5.19.6.1 General ........................................................................................................................... 786
5.19.6.2 Executing the first steps in SINUMERIK.............................................................................. 786
5.19.6.3 Creating an NCU .............................................................................................................. 787
5.19.6.4 Creating an NX module .................................................................................................... 787
5.19.6.5 Connecting an NX module with NCU ................................................................................ 788
5.19.6.6 Accessing NCK events ...................................................................................................... 788
5.19.6.7 Creating archives ............................................................................................................. 789
5.19.6.8 Activating Safety Integrated ............................................................................................. 791
5.19.6.9 Accessing PLC software .................................................................................................... 792
5.19.6.10 Examples for Namespace Siemens.Engineering.MC.DriveConfiguration............................. 793
5.19.6.11 Examples for Namespace Siemens.Engineering.MC.Drives ................................................ 797
5.20 Functions for Startdrive.................................................................................................... 802
5.20.1 Introduction..................................................................................................................... 802
Note
V* refer to the installed version of the TIA Portal Openness API.
For changes to the object model see Major Changes in TIA Portal Openness V17 for further
information.
New features
The following new features and innovations are available in TIA Portal Openness V17. You can
find additional details on the various topics in the individual sections of the product
documentation.
• Extensions for project generation of PLC programs:
– Creation of instance DBs for FBs in the following additional languages: LAD, FBD, STL, SCL,
Graph, Cause Effect Matrix (CEM)
– Write access to the "PriorityNumber" OB attribute
– Modules or data types from "ExternalSourceGroup" can be generated directly into a
subgroup.
– Direct read access to DB tags and write access to their "StartValue" property
• Extension for devices with IP address not configured in the project when downloading to the
PLC
• Extensions for Safety engineering:
– Write access for most attributes of the Safety Administration Editor (SAE)
– Configuration of the Safety engineering password (set, reset, lock, unlock)
– Compiling the Safety hardware and Safety software
– Loading of changes in the standard software or standard hardware configuration to an F-
PLC with unchanged Safety program / Safety hardware configuration
– Documentation generation (Safety printout)
• Extended support for library processes:
– Structure applied when updating the library
– Clean up library
– Harmonize project
– Force update
– Reading and setting the default version of a type
– Reading the status information of library types
• Extension of CAx export and import:
– Support of the AML specification AR APC v1.2
– Support of Safety Base Units for ET200SP modules
– Exchange of manufacturer-specific hardware parameters for GSD/GSDML-based devices
– Option to export normalized order numbers (MLFB)
– Tolerant import of order numbers (MLFB)
Hardware parameters
A description of hardware parameters is available in the installation folder of TIA Portal at
Siemens\Automation\Portal V*\PublicAPI\V*\HW Parameter Description
\Openness_hardware_parameter_description.pdf
Note
V* refers to adapted path according to the installed version of TIA Portal.
Failsafe
When you are using TIA Portal Openness there are restrictions regarding failsafe. Please consider
the documentation "SIMATIC Safety - Configuring and Programming" for further information.
3.2 Major changes for long-term stability in TIA Portal Openness V17
Changes
If you have considered the hints concerning programming across versions and you do not
rebuild your Openness application to V17 your applications will run without any restrictions on
any computer even if only a TIA Portal V17 is installed.
If you rebuild your Openness application to V17 it is necessary to recompile your application
using the SiemensEngineering.dll of V17. In some cases it might be necessary to adapt the code
of your application.
With TIA Portal Openness V17, all methods of IEngineeringObject is implicitly implemented on
all types that implement IEngineeringObject so that the explicit cast is not required, all methods
will be visible to you. The change will be available in all previous version engineering dll's i.e V15,
V15.1 & V16 supported in V17.
For following methods, typecast is not required:
• object GetAttribute(string name) - Gets an attribute with the given name.
• IList<EngineeringAttributeInfo> GetAttributeInfos() - Returns a collection of
EngineeringAttributeInfo objects describing the different attributes on this object.
• IList<object> GetAttributes(IEnumerable<string> names) - Gets a list of attributes for the
given names.
• void SetAttribute(string name, object value) - Sets an attribute with the given name to the
given value.
• void SetAttributes(IEnumerable<KeyValuePair<string, object>> attributes) - Sets the
attributes with the given names to the given values as indicated in attribute
By introducing this change, there will be a slight change-in behavior if you recompile the code
used under extension method. For example when you have used extension method and when
the code is compiled into the V17 engineering dll, call from the extension method doesn’t get
executed. In this case you would have to change code to stay with the behavior compatible.
There would also be no compiler error.
The below example code explains where GetAttribute method doesn’t get executed:
• Supports more tolerant (independent of IoType order within deviceitem) start address
import.
• Import of compact module using ‘TemplateReference’ with some restrictions supported.
Version change
If you consider some hints for writing long-term stable code you will be able to use your
application with other versions of the TIA Portal without modifying the code of your application.
Note
V* and *.ap* in document refer to the adapted path and extension according to the installed
version of the TIA Portal.
Installation path
Modifications are necessary to change the installation path of TIA Portal, for instance:
“C:\Program Files\Siemens\Automation\Portal V14\PublicAPI\V14 SP1\Siemens.Engineering.dll”
has to be changed to
“C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Siemens.Engineering.dll”
To write long-term stable code, the installation path should be configurable.
Path of AmiHost
Modifications are necessary to change the path of AmiHost, for instance:
“C:\Program Files\Siemens\Automation\Portal V14\bin\Siemens.Automation.Cax.AmiHost.exe”
has to be changed to “C:\Program Files\Siemens\Automation\Portal V*\bin
\Siemens.Automation.Cax.AmiHost.exe”
To write long-term stable code, the path of AmiHost should be configurable.
Opening a project
To write long-term stable code, the Projects.OpenWithUpgrade method should be used
instead of the Projects.Open method.
Note
You should avoid registering another IpcChannel using a “ensureSecurity” parameter value other
than "false" with a priority higher than or equal to “1”.
Attribute Settings
"name" and "portName" Set to $”{Process.Name}_{Process.Id}” or $”{Proc‐
ess.Name}_{Process.Id}_{AppDomain.Id}” when registered in
an AppDomain other than the application’s default.
“priority” Set with the default value of “1”.
“typeFilterLevel” Set to “Full”.
“authorizedGroup” Set to the NTAccount value string for the built-in user account
(i.e. everyone).
See also
Adding users to the "Siemens TIA Openness" user group (Page 37)
Introduction
The "TIA Portal Openness" is installed via TIA Portal setup program by selecting the TIA Portal
Openness checkbox (under Options) during TIA Portal installation.
Requirements
• Hardware and software of the programming device or PC meet the system requirements.
• You have administrator rights.
• Running programs are closed.
• Autorun is disabled.
• WinCC and/or STEP 7 are installed.
• The version number of the "TIA Portal Openness" matches the version numbers of WinCC and
STEP 7.
Note
If a previous version of TIA Portal Openness is already installed, the current version will be
installed side by side.
Procedure
To install the TIA Portal Openness, ensure the TIA Portal Openness checkbox is selected during
the installation of TIA Portal. Follow the below steps to check the TIA Openness installation.
1. Under Configuration menu, select the folder Options.
2. Check the TIA Portal Openness checkbox.
3. Click "Next" and select the required option.
Follow the installation procedure of TIA Portal to complete the TIA Portal Openness installation.
Result
"TIA Portal Openness" is installed on the PC. Moreover, the local user group "Siemens TIA
Openness" is generated.
Note
You still do not have access to the TIA Portal with the "TIA Portal Openness" add-on package. You
need to be a member of the "Siemens TIA Openness" user group (see Adding users to the
"Siemens TIA Openness" user group (Page 37)).
Introduction
When you install TIA Portal Openness on the PC, the "Siemens TIA Openness" user group is
automatically created.
Whenever you access the TIA Portal with your TIA Portal Openness application, the TIA Portal
verifies that you are a member of the "Siemens TIA Openness" user group, either directly or
indirectly by way of another user group. If you are a member of the "Siemens TIA Openness" user
group, the TIA Portal Openness application starts and establishes a connection to the TIA Portal.
Procedure
You add a user to the "Siemens TIA Openness" user group with applications from your operating
system. The TIA Portal does not support this operation.
Note
Depending on the configuration of your domain or computer, you may need to log on with
administrator rights to expand the user group.
In a Windows 7 operating system (English language setting), for example, you can add a user to
the user group as follows:
1. Select "Start" > "Control Panel".
2. Double-click "Administrative Tools" in the Control Panel.
3. Click "Computer Management" to open the configuration dialog of the same name.
4. Select "Local Users and Groups > Groups", in order to display all created user groups.
5. Select the "Siemens TIA Openness" entry from the list of user groups in the right pane.
7. Click "Add".
The selection dialog that opens displays the users that can be selected:
Overview
&RQILJXUDWLRQ3&
<RXU 6LHPHQV
SURJUDP (QJLQHHULQJGOO
7,$3RUWDO 3URMHFWIRU
3URFHVV 0DFKLQH
Procedure
1. Set up the development environment to access and start the TIA Portal.
2. Instantiate the object of the portal application in your program to start the portal.
3. Find the desired project and open it.
4. Access the project data.
5. Close the project and exit the TIA Portal.
See also
Connecting to the TIA Portal (Page 81)
Terminating the connection to the TIA Portal (Page 90)
4.1.5 Configurations
You can work with two variants of the TIA Portal Openness:
$SSOLFDWLRQFRPSXWHU 7,$3RUWDOSURMHFWFRPSXWHU
3& 3&
'DWDH[FKDQJH
'DWD
SURFHVVLQJ
7,$3RUWDO
3URFHVV
• Data exchange takes place by XML files. The XML files can be exported or imported by your
programs.
• The data exported from the TIA Portal project to PC2 can be modified on PC1 and re-imported.
Note
You have to develop an executable program "Your Program 2" for PC2, such as
"program2.exe". The TIA Portal runs with this program in the background.
Import and export of XML files takes place exclusively via the TIA Portal Openness API.
&RQILJXUDWLRQ3&
3URMHFWGDWD
7,$3RUWDO
0DFKLQH
<RXU 3XEOLF$3,
SURJUDP
• Your program launches the TIA Portal either with or without the user interface. Your program
opens, saves and/or closes a project. The program can also connect to a running TIA Portal.
• You can then use the TIA Portal functionality to request, generate and modify project data or
to initiate import or export processes.
• The data is created under control of the TIA Portal processing and stored in the project data.
&RQILJXUDWLRQFRPSXWHU
3DUDPHWHUVIRU
PDFKLQH *HQHUDWRU
3DUDPHWHUVIRU 7RRO
PDFKLQH
3URMHFWIRU
PDFKLQH
7,$3RUWDO
3URFHVV
3URMHFWIRU
PDFKLQH
4.2.1 Introduction
Introduction
TIA Portal Openness describes open interfaces for engineering with the TIA Portal. You will find
further information about "TIA Portal Openness - Efficient generation of program code using
code generators" in the SIEMENS YouTube channel (www.youtube.com/watch?v=Ki12pLbEcxs).
You automate the engineering with TIA Portal Openness by controlling the TIA Portal externally
from a program you have created.
You can perform the following actions with TIA Portal Openness:
• Create project data
• Modify projects and project data
• Delete project data
• Read in project data
• Make projects and project data available for other applications.
Note
Siemens is not liable for and does not guarantee the compatibility of the data and information
transported via these interfaces with third-party software.
We expressly point out that improper use of the interfaces can result in data loss or production
downtimes.
Note
The code snippets contained in this documentation are written in C# syntax.
Due to the shortness of the used code snippets the error handling description has been
shortened as well.
Application
The TIA Portal Openness interface is used to do the following:
• Provide project data.
• Access the TIA Portal process.
• Use project data.
See also
Configurations (Page 43)
4.2.2 Applications
Introduction
TIA Portal Openness provides you with various ways to access the TIA Portal and offers a selection
of functions for defined tasks.
You access the following areas of the TIA Portal by using the TIA Portal Openness API interface :
• Portal data
• Project data
• PLC data
• HMI data
• Drive data
Note
You must not use the TIA Portal Openness API to execute checks or generate data for the
acceptance/approval of a fail-safe system. Acceptance/approval may only be carried out with a
safety printout using the STEP 7 Safety add-on package or with the function test. The TIA Portal
Openness API is no substitute.
4.2.3 Export/import
Introduction
TIA Portal Openness supports the import and export of project data by means of XML files. The
import/export function supports external configuration of existing engineering data. You use
this function to make the engineering process effective and free of error.
Application
You use the import/export function for the following purposes:
• Data exchange
• Copying parts of a project
• External processing of configuration data, for example, for bulk data operations using find
and replace
• External processing of configuration data for new projects based on existing configurations
• Importing externally-created configuration data, for example, text lists and tags
• Providing project data for external applications
Overview
The following diagram describes the highest level of the TIA Portal Openness object model:
7LD3RUWDO6HWWLQJ
'HYLFHVQ
'HYLFH*URXS
'HYLFHVQ 'HYLFH 'HYLFH,WHPVQ 'HYLFH,WHP
7LD3RUWDO6HWWLQJV)ROGHU $EVWUDFW!!
The following diagram describes the objects which are located under GlobalLibrary.
0DVWHU&RS\6\VWHP)ROGHU 0DVWHU&RS\8VHU)ROGHU
*OREDO/LEUDU\
/LEUDU\7\SH)ROGHU 7\SHVQ /LEUDU\7\SH 9HUVLRQVQ /LEUDU\7\SH9HUVLRQ
7\SH)ROGHU $EVWUDFW!! )ROGHUVQ
/LEUDU\7\SH6\VWHP)ROGHU /LEUDU\7\SH8VHU)ROGHU
The following diagram describes the objects which are located under ProjectLibrary.
0DVWHU&RS\6\VWHP)ROGHU 0DVWHU&RS\8VHU)ROGHU
3URMHFW/LEUDU\
/LEUDU\7\SH)ROGHU 7\SHVQ /LEUDU\7\SH 9HUVLRQVQ /LEUDU\7\SH9HUVLRQ
7\SH)ROGHU $EVWUDFW!! )ROGHUVQ
/LEUDU\7\SH6\VWHP)ROGHU /LEUDU\7\SH8VHU)ROGHU
The following diagram describes the objects which are located under HmiTarget.
6FUHHQ*OREDO(OHPHQWV 6FUHHQ*OREDO(OHPHQWV
6FUHHQ2YHUYLHZ 6FUHHQ2YHUYLHZ
The following diagram describes the object which are located under HmiSoftware.
+PL6RIWZDUH
5XQWLPH6HWWLQJV
6FUHHQDQG 6FUHHQVDQG6FUHHQ,WHPV
6FUHHQ,WHPQ
The following diagram describes the objects which are located under PlcSoftware.
Note
*The Force Table must be in PlcWatch and ForceTableSystemGroup
Relationship between TIA Portal and TIA Portal Openness object model
The figure below shows the relationship between the object model and a project in the TIA
Portal:
1
5
5 5
Project DeviceItem
2 PlcSoftware
HmiTarget
3
HmiUnified
4 Software
See also
Blocks and types of the TIA Portal Openness object model (Page 57)
Hierarchy of hardware objects of the object model (Page 65)
5.1.2 Blocks and types of the TIA Portal Openness object model
Introduction
The following diagram describes the domain model of the PLCs to give an overview of the
current modeling in TIA Portal Openness.
Note
* The Force Table must be in PlcWatch and ForceTableSystemGroup
Class diagrams
In the TIA Portal Openness object model all classes are defined as abstract which aren't directly
instantiated.
Data
3OF%ORFN
*HQHUDODWWULEXWHV
$XWR1XPEHU%RROHDQ
&RGH0RGLILHG'DWH'DWH7LPH
&RPSLOH'DWH'DWH7LPH
&UHDWLRQ'DWH'DWH7LPH
+HDGHU$XWKRU6WULQJ
+HDGHU)DPLO\6WULQJ
+HDGHU1DPH6WULQJ
+HDGHU9HUVLRQ6WULQJ
,QWHUIDFH0RGLILHG'DWH'DWH7LPH
,V&RQVLVWHQW%RROHDQ
,V.QRZ+RZ3URWHFWHG%RROHDQ
0HPRU\/D\RXW0HPRU\/D\RXW
0RGLILHG'DWH'DWH7LPH
1DPH6WULQJ
1XPEHU,QW
3DUDPHWHU0RGLILHG'DWH7LPH
3URJUDPPLQJ/DQJXDJH3URJUDPPLQJ/DQJXDJH
6WUXFWXUH0RGLILHG'DWH7LPH
6HUYLFHV
,&RPSLODEOH
([SRUW
6KRZ,Q(GLWRU
'HOHWH
'DWD%ORFN
6SHFLILFDWWULEXWHV
,V2QO\6WRUHG,Q/RDG0HPRU\%RROHDQ
,V:ULWH3URWHFWHG,Q$6%RROHDQ
6SHFLILFDWWULEXWHV
'RZQORDG:LWKRXW5HLQLW%RROHDQ
,QVWDQFH2I1XPEHU,QW
,QVWDQFH2I7\SH%ORFN7\SH
,V5HWDLQ0HP5HV(QDEOHG%RROHDQ
0HPRU\5HVHUYH8,QWSOXV
5HWDLQ0HPRU\5HVHUYH8,QWSOXV
8'$(QDEOH7DJ5HDGEDFN%RROHDQ
8'$%ORFN3URSHUWLHV6WULQJ
3OF%ORFN
1RWH$
WKHIROOR
,&RPS
([SRU
6KRZ,
'HOHWH
2%
*HQHUDODWWULEXWHV
6HFRQGDU\7\SH6WULQJ
6SHFLILFDWWULEXWHV
&RQVWDQW1DPH6WULQJ
3URFHVV,PDJH3DUW1XPEHU8,QW
(YHQW&ODVV6WULQJ
3ULRULW\1XPEHU,QW )%
(YHQWV7R%H4XHXHG,QW
5HSRUW(YHQWV%RRO 6SHFLILFDWWULEXWHV
(QDEOH7LPH(UURU%RRO $FNQRZOHGJH(UURUV5HTXLUHG%RROHDQ
(YHQW7KUHVKROG)RU7LPH(UURU,QW &UHDWH0LQLPL]HG'%%RROHDQFODVVLF
&\FOLF7LPH,QW 'RZQORDG:LWKRXW5HLQLW%RROHDQ
3KDVH2IIVHW,QW *UDSK9HUVLRQ6WULQJSOXV
$SSOLFDWLRQ&\FOH6LQJOH ,V0XOWL,QVWDQFH&DSDEOH%RROHDQ
$XWRPDWLF0LQLPXP%RRO
,V5HWDLQ0HP5HV(QDEOHG%RROHDQ
)&
'HOD\7LPH'RXEOH
'LVWULEXWLRQ,21DPH,QW /DQJXDJH,Q1HWZRUNV6WULQJ 6SHFLILFDWWULEXWHV
'LVWULEXWLRQ,21XPEHU,QW /RFN2SHUDWLQJ0RGH%RROHDQ
3DUDPHWHU3DVVLQJ%RROHD
([HFXWLRQ2%([HFXWLRQ 0HPRU\5HVHUYH8,QWSOXV
8'$(QDEOH7DJ5HDGEDFN
6WDUW'DWH'DWH7LPH 3DUDPHWHU3DVVLQJ%RROHDQSOXV
8'$%ORFN3URSHUWLHV6WULQ
7LPH2I'D\'DWH7LPH 3HUPDQHQW,/3URFHVVLQJ,Q0$10RGH%RROHDQ
/LEUDU\&RQIRUPDQFH6WDWXV
7LPH0RGH2%7LPH0RGH 5HWDLQ0HPRU\5HVHUYH8,QWSOXV
'DWD([FKDQJH0RGH2%'DWD([FKDQJH0RGH 6HW(12$XWRPDWLFDOO\%RROHDQSOXV
&\FOLF7LPH'LVWULEXWHG,26LQJOH 6NLS6WHSV%RROHDQ
)DFWRU6LQJOH 8'$(QDEOH7DJ5HDGEDFN%RROHDQ
6\QFKURQRXV$SSOLFDWLRQ&\FOH7LPH6LQJOH 8'$%ORFN3URSHUWLHV6WULQJ
&\FOLF$SSOLFDWLRQ&\FOH7LPH6LQJOH :LWK$ODUP+DQGOLQJ%RROHDQ
/LEUDU\&RQIRUPDQFH6WDWXV6WULQJ
7UDQVIRUPDWLRQ'%1XPEHU8,QW
Representation of groups for blocks and types in the TIA Portal Openness API
The two high level groups "PlcBlocks" ("Program blocks" in the GUI of TIA Portal) and "PlcTypes"
("Plc data types" in the GUI of TIA Portal) contain blocks and type definitions. These groups
provide the import and the compile functions for blocks. Due to the fact that most of the
methods of functionalities of the groups are only achievable via collections, there is an
"embedded" or "compacted" representation of the collections and their methods at the "host"
classes.
3OF%ORFN*URXS
3OF6RIWZDUH
&RPSRVLWLRQV
%ORFNV3OF%ORFN&RPSRVLWLRQ 7\SHV3OF7
*URXSV3OF%ORFN8VHU*URXS&RPSRVLWLRQ *URXSV3O
6HUYLFHV
,&RPSLODEOH ,&RPSLODEOH
1DPH6WULQJJHW 1DPH6WUL
0HWKRGVRQ3OF%ORFN&RPSRVLWLRQ
,PSRUW ,PSRUW
0HWKRGVRQ3OF%ORFN8VHU*URXS&RPSRVLWLRQ 0HWK
&UHDWH &UHDWH
3OF6\VWHP%ORFN*URXS
&RPSRVLWLRQV
%ORFNV3OF%ORFN&RPSRVLWLRQ
*URXSV3OF6\VWHP%ORFN*URXS&RPSRVLWLRQ
1DPH6WULQJJHW
0HWKRGVRQ3OF%ORFN&RPSRVLWLRQ
,PSRUW
3OF%ORFN
External Sources
3OF([WHUQDO6RXUFH*URXS
&RPSRVLWLRQV
*URXSV3OF([WHUQDO6RXUFH8VHU*URXS&RPSRVLWLRQ
([WHUQDO6RXUFHV3OF([WHUQDO6RXUFH&RPSRVLWLRQ
3OF6RIWZDUH
1DPH6WULQJJHW
0HWKRGVRQ3OF([WHUQDO6RXUFH&RPSRVLWLRQ
&UHDWH)URP)LOH
0HWKRGVRQ3OF([WHUQDO6RXUFH8VHU*URXS&RPSRVLWLRQ
&UHDWH
3OF([WHUQDO6RXUFH6\VWHP*URXS 3OF([WHUQDO6RXUFH8VHU*URXS 3OF([
1DPH6WULQJ
'HOHWH
*HQHUDWH%ORFN
See also
TIA Portal Openness object model (Page 51)
Hierarchy of hardware objects of the object model (Page 65)
Relation between the visible elements in the TIA Portal and the modeled elements in the object
model
The container relation is comparable to the relation of the modules for the device item objects.
Example: A device includes one or more slots. A slot includes modules. A module includes
submodules.
This is the relation similar to the representation in the network view and device view of the TIA
Portal. The "PositionNumber" attribute of a device item is unique in the items area, within a
container.
The parent-child relation between device item objects is a purely logical relation in the object
model. A child cannot exist without its parents.
• If a submodule is modeled as part of a module (child), the submodule cannot be removed
without the module.
• If you add and then remove a submodule from the module, this child has the same parents
as the module.
The diagrams below show the hierarchy relationship between devices, and device items of PLC
and HMI devices.
Hierarchy when iterating via .Items Hierarchy when iterating via .DeviceItems
'HYLFH 'HYLFH
6RIWZDUH&RQWDLQHU 6RIWZDUH&RQWDLQHU
3OF6RIWZDUH 3OF6RIWZDUH
Hierarchy when iterating via .Items Hierarchy when iterating via .DeviceItems
'HYLFH 'HYLFH
6RIWZDUH&RQWDLQHU 6RIWZDUH&RQWDLQHU
+PL7DUJHW +PL7DUJHW
See also
TIA Portal Openness object model (Page 51)
Blocks and types of the TIA Portal Openness object model (Page 57)
Introduction
The following tables show the available objects up to and including Runtime Advanced, and
indicate whether these objects are supported by TIA Portal Openness.
Neither Runtime Professional nor device proxy files are supported by TIA Portal Openness in
WinCC.
Objects
You can control the following project data depending on which HMI device you are using:
1) Only Mobile Panels with the device version greater than 12.0.0.0 support this screen object
TIA Portal Openness also supports all value ranges which are supported by the communication
drivers.
Connections
TIA Portal Openness supports non-integrated connections that are also supported by the
respective HMI devices. You can find additional information in the online help for the TIA Portal
under "Process visualization > Controller communication > Device-dependent".
5.2.1 Introduction
Overview
TIA Portal Openness supports a selection of functions for defined tasks that you can call outside
the TIA Portal by means of the TIA Portal Openness API.
Note
If a previous version of TIA Portal Openness is already installed, the current version will be
installed side by side.
You are provided with an overview of the typical programming steps in the sections below. You
can learn how the individual code sections interact and how to integrate the respective
functions into a complete program. You also get an overview of the code components that have
to be adapted for each task.
Example program
The individual programming steps are explained using the "Creating API access in a console
application" function as an example. You integrate the provided functions in this program code
and adapt the respective code components for this task.
Functions
The section below lists the functions for defined tasks that you can call with TIA Portal Openness
outside the TIA Portal.
See also
Applications (Page 48)
Object list (Page 67)
Requirement
• TIA Portal Openness and TIA Portal are installed
Application
Starting from TIA Portal Openness V14 each installed version has a registry key that contains
information about the version. This enables an automatic generation of app.config files for each
installed version of TIA Portal Openness.
The registry keys can be located under the following path:
HKEY_LOCAL_MACHINE\Software\Siemens\Automation\Openness\xx.x
\PublicAPI
Note
The version number in this path, is always the number of the currently installed version of TIA
Portal. If there are multiple side-by-side installations there are multiple sets of entries for TIA
Portal Openness in the registry.
There is a single key for each version of TIA Portal Openness. The names of the Versions will be
the same as in the assembly described, for example, the registry entries for TIA Portal Openness:
[HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\Automation\Openness\xx.x\PublicAPI
\xx.x.x.x]"PublicKeyToken"="d29ec89bac048f84"
"Siemens.Engineering"="C:\Program Files\Siemens\Automation\Portal Vxx\PublicAPI\Vxx
\Siemens.Engineering.dll"
"Siemens.Engineering.Hmi"="C:\Program Files\Siemens\Automation\Portal Vxx\PublicAPI\Vxx
\Siemens.Engineering.Hmi.dll"
"EngineeringVersion"="xx"
"AssemblyVersion"="xx.x.x.x"
Note
If you want to generate an app.config file (Page 81) you can get the path of the
Siemens.Engineering.dll, the Siemens.Engineering.Hmi.dll and the public key token from the
registry key.
Application
The Intellisense support of TIA Portal Openness helps you at available attributes or methods via
tooltip information. It could contain information about the number, names and types of the
required parameters. At the following example the bold parameter in the first line indicates the
next parameter that is required as you type the function.
You can manually invoke Parameter Info by clicking Edit IntelliSense/Parameter Info, typing CTRL
+SHIFT+SPACE, or clicking the Parameter Info button on the editor toolbar.
using System;
using System.Collections.Generic;
using System.IO;
using Siemens.Engineering;
using Siemens.Engineering.Cax;
using Siemens.Engineering.Compiler;
using Siemens.Engineering.Compare;
using Siemens.Engineering.Download;
using Siemens.Engineering.Hmi;
using Siemens.Engineering.Hmi.Cycle;
using Siemens.Engineering.Hmi.Communication;
using Siemens.Engineering.Hmi.Globalization;
using Siemens.Engineering.Hmi.RuntimeScripting;
using Siemens.Engineering.Hmi.Screen;
using Siemens.Engineering.Hmi.Tag;
using Siemens.Engineering.Hmi.TextGraphicList;
using Siemens.Engineering.HW;
using Siemens.Engineering.HW.Extensions;
using Siemens.Engineering.HW.Features;
using Siemens.Engineering.HW.Utilities;
using Siemens.Engineering.Library;
using Siemens.Engineering.Library.MasterCopies;
using Siemens.Engineering.Library.Types;
using Siemens.Engineering.SW;
using Siemens.Engineering.SW.Blocks;
using Siemens.Engineering.SW.ExternalSources;
using Siemens.Engineering.SW.Tags;
using Siemens.Engineering.SW.TechnologicalObjects;
using Siemens.Engineering.SW.TechnologicalObjects.Motion;
using Siemens.Engineering.SW.Types;
using Siemens.Engineering.Upload;
Note
When you specify directory paths, use the absolute directory path, for example, "C:/path/file.txt".
Relative directory paths are only allowed in the XML files for import and export, for example,
"file.txt" or "C:/path01/.../path02/file.txt".
//In the sample program "Hello TIA" replace the function call
//"IterateThroughDevices(project)" by the following functions calls:
HmiTarget hmiTarget = GetTheFirstHmiTarget(project);
DeleteScreenFromFolder(hmiTarget);
Note
The application example requires an application configuration file (Page 81).
using System;
using Siemens.Engineering;
using Siemens.Engineering.HW;
using Siemens.Engineering.HW.Features;
using Siemens.Engineering.SW;
using Siemens.Engineering.SW.Blocks;
using Siemens.Engineering.SW.ExternalSources;
using Siemens.Engineering.SW.Tags;
using Siemens.Engineering.SW.Types;
using Siemens.Engineering.Hmi;
using HmiTarget = Siemens.Engineering.Hmi.HmiTarget;
using Siemens.Engineering.Hmi.Tag;
using Siemens.Engineering.Hmi.Screen;
using Siemens.Engineering.Hmi.Cycle;
using Siemens.Engineering.Hmi.Communication;
using Siemens.Engineering.Hmi.Globalization;
using Siemens.Engineering.Hmi.TextGraphicList;
using Siemens.Engineering.Hmi.RuntimeScripting;
using System.Collections.Generic;
using Siemens.Engineering.Compiler;
using Siemens.Engineering.Library;
using System.IO;
namespace HelloTIA
{
internal class Program
{
private static void Main(string[] args)
{
RunTiaPortal();
}
Console.WriteLine("Opening Project...");
// please adapt the path and the extension apx to the installed version of
TIA Portal
FileInfo projectPath = new FileInfo("C:\Demo\AnyCompanyProject.apx"); //edit
the path according to your project
Project project = null;
try
{
project = projects.OpenWithUpgrade(projectPath);
}
catch (Exception)
{
Console.WriteLine(String.Format("Could not open project {0}",
projectPath.FullName));
Console.WriteLine("Demo complete hit enter to exit");
Console.ReadLine();
return;
}
IterateThroughDevices(project);
project.Close();
Console.WriteLine();
}
}
}
Procedure in steps
Note
Ensure that parameter "CopyLocal" is assigned the value "False" in the reference attributes.
using Siemens.Engineering;
4. Open project
You can use the following code, for example, to open a project:
Console.WriteLine();
Console.WriteLine(String.Format("Iterate through {0} device(s)",
project.Devices.Count));
foreach (Device device in project.Devices)
{
Console.WriteLine(String.Format("Device: \"{0}\".", device.Name));
}
Console.WriteLine();
}
project.Save();
project.Close();
Overview
TIA Portal Openness requires the following programming steps for access by means of the TIA
Portal Openness API:
1. Make the TIA Portal known in the development environment
2. Set up program access to the TIA Portal
3. Activate program access to the TIA Portal
4. Publish and start the TIA Portal
5. Open project
6. Execute commands
7. Save and close the project
8. Terminate the connection to the TIA Portal
Note
Permitted strings
Only certain characters are allowed in strings in the TIA Portal. All strings passed to the TIA Portal
via the TIA Portal Openness application are subject to these rules. If you pass an invalid character
in a parameter, an exception is thrown.
See also
Example program (Page 76)
Use of the code examples (Page 74)
Introduction
You start the TIA Portal with TIA Portal Openness or connect to a TIA Portal already running.
When using a TIA Portal Openness application to start the TIA Portal, you specify if the TIA Portal
should be started with or without graphical user interface. When you operate the TIA Portal
without user interface, the TIA Portal is only started as a process by the operating system. You
create several instances of the TIA Portal with a TIA Portal Openness application, if necessary.
Note
If you use TIA Portal Openness with the TIA Portal interface, you cannot use an HMI editor. You
can open the "Devices & Networks" editors or the programming editor manually or with TIA
Portal Openness API.
You have the following options to start the TIA Portal with a TIA Portal Openness application:
• Use an application configuration file (recommended in most use cases).
• Use the "AssemblyResolve" method (recommended when you use copy deploy etc.).
• Copy the Siemens.Engineering.dll in the TIA Portal Openness application directory.
Note
It is recommended to load the Siemens.Engineering.dll by using the app.config file. By using this
method the strong names are considered and malicious modifications to the engineering.dll will
result in a loading error. By using the AssemblyResolve method this can't be detected.
Store the application configuration file "app.config" in the same directory as the TIA Portal
Openness application and likewise incorporate this in your application. Check whether the file
path in each code matches the TIA Portal installation path.
You can use the following code snippet for the application configuration file:
<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Siemens.Engineering" culture="neutral"
publicKeyToken="d29ec89bac048f84"/>
<!-- Edit the following path according to your installed version of TIA Portal
-->
<codeBase version="Vxx.x.x.x" href="FILE://C:\Program Files\Siemens
\Automation\Portal Vxx\PublicAPI\Vxx\Siemens.Engineering.dll"/>
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Siemens.Engineering.Hmi" culture="neutral"
publicKeyToken="d29ec89bac048f84"/>
<!-- Edit the following path according to your installed version of TIA Portal
-->
<codeBase version="Vxx.x.x.x" href="FILE://C:\Program Files\Siemens
\Automation\Portal Vxx\PublicAPI\Vxx\Siemens.Engineering.Hmi.dll"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Use the following program code to open a new TIA Portal Instance by means of the application
configuration file:
namespace UserProgram
{
internal class MyProgram
{
public static void Main(string[] args)
{
// To start TIA Portal with user interface:
// using (TiaPortal tiaPortal = new TiaPortal(TiaPortalMode.WithUserInterface))
//
// To start TIA Portal without user interface:
// using (TiaPortal tiaPortal = new
TiaPortal(TiaPortalMode.WithoutUserInterface))
using (TiaPortal tiaPortal = new TiaPortal(TiaPortalMode.WithUserInterface))
{
//begin of code for further implementation
//...
//end of code
}
}
}
}
Use the following program code to open a new TIA Portal Instance.
using System;
using System.IO;
using System.Reflection;
using Siemens.Engineering;
namespace UserProgram
{
static class MyProgram
{
public static void Main(string[] args)
{
AppDomain.CurrentDomain.AssemblyResolve += MyResolver;
RunTiaPortal();
}
private static void RunTiaPortal()
{
// To start TIA Portal with user interface:
// using (TiaPortal tiaPortal = new TiaPortal(TiaPortalMode.WithUserInterface))
//
// To start TIA Portal without user interface:
// using (TiaPortal tiaPortal = new
TiaPortal(TiaPortalMode.WithoutUserInterface))
using (TiaPortal tiaPortal = new TiaPortal(TiaPortalMode.WithUserInterface))
{
//begin of code for further implementation
//...
//end of code
}
}
private static Assembly MyResolver(object sender, ResolveEventArgs args)
{
int index = args.Name.IndexOf(',');
if (index == -1)
{
return null;
}
string name = args.Name.Substring(0, index) + ".dll";
// Edit the following path according to your installed version of TIA Portal
string path = Path.Combine(@"C:\Program Files\Siemens\Automation\Portal Vxx
\PublicAPI\Vxx\", name);
string fullPath = Path.GetFullPath(path);
if (File.Exists(fullPath))
{
return Assembly.LoadFrom(fullPath);
}
return null;
}
}
}
If you know the process ID of the instance of the TIA Portal, use this process ID to access the
object. TIA Portal requires a certain amount of time to start up before you can connect the TIA
Portal Openness application to the TIA Portal.
When you connect to a running instance of the TIA Portal, a connection prompt of the TIA Portal
Openness firewall appears. The connection prompt offers the following options:
• Allow connection once
• Do not allow connection
• Always allow connections from this application
See TIA Portal Openness firewall (Page 86) for further information.
Note
If the registry prompt is rejected three times, the system throws an exception of the
type EngineeringSecurityException.
Once you have connected to the process, you can use the following attributes to retrieve
information on the instances of the TIA Portal:
Attribute Information
InstalledSoftware as Returns information about the installed products.
IList<TiaPortalProduct>
Mode as TiaPortalMode Returns the mode in which the TIA Portal was started (WithoutUserInterface/WithUserIn‐
terface).
AttachedSessions as Returns a list of applications connected to the TIA Portal.
IList<TiaPortalSession>
ProjectPath as FileInfo Returns the file name of the project opened in the TIA Portal, including the folder, for ex‐
ample,
"D:\WinCCProjects\ColorMixing\ColorMixing.ap*"
If no project is open, a null string is returned.
ID as int Returns the process ID of the TIA Portal instance
Path as FileInfo Returns the path to the TIA Portal executable
The following example shows how you can calculate the file hash and last modified date:
Event Response
Disposed Use this event to respond to the closing of the TIA Portal with a TIA Portal Openness appli‐
cation.
Notification Use this event to respond to notifications of the TIA Portal with a TIA Portal Openness
application. Notifications require only an acknowledgment, e.g. "OK".
Confirmation Use this event to respond to confirmations of the TIA Portal with a TIA Portal Openness
application. Confirmations always require a decision, e.g. "Do you want to save the project?".
Program code
Modify the following program code to register event handlers in a TIA Portal Openness
application:
{
....
}
Attribute Description
Caption Returns the name of the confirmation.
DetailText Returns the detail text of the confirmation.
Icon Returns the icon of the confirmation.
IsHandled Returns the confirmation or specifies if it is still pending.
Text Returns the text of the confirmation.
Attributes of confirmations
Confirmations have the following attributes:
Attribute Description
Caption Returns the name of the confirmation.
Choices Returns the option to acknowledge the confirmation.
DetailText Returns the detail text of the confirmation.
Icon Returns the icon of the confirmation.
IsHandled Returns the confirmation or specifies if it is still pending.
Result Returns the result of the acknowledgment or specifies it.
Text Returns the text of the confirmation.
See also
Program-controlled acknowledgement of dialogs with system events (Page 89)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• Event handlers are registered.
See Connecting to the TIA Portal (Page 81)
Application
When you operate the TIA Portal with the user interface, dialogs with system events are
displayed for some program sequences. You decide how you want to proceed based on these
system events.
When the TIA Portal is accessed with a TIA Portal Openness application, these system events
must be acknowledged by means of corresponding ".NET" events.
The permitted confirmations are contained in the Choices list:
• Abort
• Cancel
• Ignore
• No
• NoToAll
• None
• OK
• Retry
• Yes
• YesToAll
The value of ConfirmationEventArgs.Result must be one of the above-mentioned
entries. Otherwise, an exception is thrown.
Program code
Modify the following program code to respond to a confirmation event:
...
tiaPortal.Confirmation += TiaPortalConfirmation;
...
private void TiaPortalConfirmation(object sender, ConfirmationEventArgs e)
{
...
}
Modify the following program code to notify the project engineer about executed actions of a
TIA Portal Openness application:
//Handles notifications
using (TiaPortal tiaPortal = new TiaPortal())
{
tiaPortal.Notification += Notification;
try
{
//perform actions that will result in a notification event
}
finally
{
tiaPortal.Notification -= Notification;
}
}
Introduction
If you started the TIA Portal instance without a user interface and if your application is the only
TIA Portal Openness client attached to the TIA Portal, you can close the TIA Portal instance with
the TIA Portal Openness application. Otherwise, you disconnect the TIA Portal Openness
application from the TIA Portal instance.
Use the IDisposable.Dispose() method to separate or close the active instance of the TIA
Portal.
Note
When a configuration engineer closes the TIA Portal instance despite ongoing access of a TIA
Portal Openness application, an exception of the class "NonRecoverableException" is thrown in
the TIA Portal Openness application on the next API access. You can subscribe to the dispose
event to get a call when the TIA Portal is closed.
Program code
Modify the following program code to separate or close the connection to the TIA Portal:
See also
Event handlers (Page 87)
Application
You can retrieve certain diagnostic information from running instances of TIA Portal via a static
method. The diagnostic interface is implemented on the TiaPortalProcess object, which can be
retrieved for any currently running instance of the TIA Portal.
The diagnostic interface is not blocking, so you can retrieve the TiaPortalProcess object and
access it's members, regardless of if the TIA Portal is busy or not. The diagnostic interface
includes the following Members:
Class TiaPortalProcess
Class TiaPortalSession
Enum TiaPortalAccessLevel
Enum TiaPortalTrustAuthority
Class TiaPortalProduct
The following code snippet provides an example of how to use the diagnostic Interface to query
information and of how to use them in your application.
Because of the fact that no connection to the TIA Portal is needed to use the diagnostics
interface, it's possible to write a Windows service that uses the attaching event to check any
application attempting to attach to a TIA Portal, e.g. only applications that begin with your
company's name are allowed to attach. Another option might be to always grant access, but
write information about attaching processes to a log. The following program code is an example
event handler to check incoming connections:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The "TIA Portal" class provides the method "ExclusiveAccess(String text)" to establish an
exclusive access to an attached TIA Portal process. The usage of an exclusive access is highly
recommended even if it is not mandatory.
Use "ExclusiveAccess" in an "using" statement to ensure it is disposed attribute even when
exceptions occur or the application is shutdown.
Note
Any attempt to create a second exclusive access within the scope of an open exclusive access will
result in an recoverable exception being raised.
...
[assembly: AssemblyTitle("MyApplication")]
// This will be used for the exclusive access dialog when present....
TiaPortal tiaPortal = ...;
using (ExclusiveAccess exclusiveAccess = tiaPortal.ExclusiveAccess("My Activity"))
{
...
}
After acquiring an "ExclusiveAccess" instance for a given TIA Portal process a dialog will be
displayed. This dialog will display the message provided during instantiation. In addition the
following information of the client application will be displayed:
• the assembly title of the manifest data if available; otherwise, the process name
• the process ID
• the SID (Openness Session ID of the client application's TiaPortal instance)
Note
There can be multiple sessions active for a given TIA Portal Openness client application because
there can be multiple instances of TiaPortal each associated with the same TIA Portal process.
The client application can also update the displayed content of the exclusive access dialog by
setting the "Text" attribute with new values. Modify the following program code to invoke this
behavior:
exclusiveAccess = ...;
...
exclusiveAccess.Text = "My Activity Phase 1";
...
exclusiveAccess.Text = "My Activity Phase 2";
...
exclusiveAccess.Text = String.Empty; // or null;
...
You can request that the exclusive access could be cancelled by selecting the "Cancel" button.
Modify the following program code to invoke this behavior:
exclusiveAccess = ...;
...
if (exclusiveAccess.IsCancellationRequested)
{
// stop your activity
...
}
else
{
// continue your activity
...
}
...
IEngineeringInstance
The interface that allows up navigation in the Object Model.
Properties:
• IEngineeringObject Parent - Parent object of an instance instance.
IEngineeringCompositionOrObject
The interface is implemented by both engineering objects and compositions.
IEngineeringObject
The interface is implemented by the majority of objects that are available for the Openness
users. IEngineeringObject interface is derived from IEngineeringCompositionOrObject and
IEngineeringInstance:
Methods:
• IList<EngineeringCreationInfo> GetCreationInfos(string compositionName) - Gets the list of
composition infos available for the object.
• IEngineeringObject Create(string compositionName, Type type,
IEnumerable<KeyValuePair<string, object>> parameters) - Creates an IEngineeringObject of
indicated type initialized with values as indicated compositionName within the parameters
• object GetAttribute(string name) - Gets an attribute with the given name.
• IList<EngineeringAttributeInfo> GetAttributeInfos() - Returns a collection of
EngineeringAttributeInfo objects describing the different attributes on this object.
• IList<object> GetAttributes(IEnumerable<string> names) - Gets a list of attributes for the
given names
• IEngineeringCompositionOrObject GetComposition(string name) - Gets an
IEngineeringCompositionOrObject with the given name.
• IList<EngineeringInvocationInfo> GetInvocationInfos() - Returns a collection of
EngineeringInvocationInfo objects describing the different actions on this object.
• object Invoke(string name, IEnumerable<KeyValuePair<Type, object>> parameters) -
Invokes the method represented by the current instance, using the specified parameters.
• void SetAttribute(string name, object value) - Sets an attribute with the given name to the
given value
• void SetAttributes(IEnumerable<KeyValuePair<string, object>> attributes) - Sets the
attributes with the given names to the given values as indicated in attributes.
• EngineeringObjectHandle GetHandle() - Gets the object's unique handle.
IEngineeringRoot
This interface is implemented by TiaPortal objects and indicates that the user is at the top object
in the hierarchy. IEngineeringRoot is derived from IEngineeringObject,
IEngineeringCompositionOrObject and IEngineeringInstance.
Methods:
• IEngineeringObject GetObject(EngineeringObjectHandle objectHandle) - Gets the object
from a handle
IEngineeringComposition
The interface is implemented by the majority of objects that are available for the Openness
users. IEngineeringObject interface is derived from IEngineeringCompositionOrObject and
IEngineeringInstance. In addition to the properties and methods described in Working with
compositions (Page 101), the following methods are supported.
Methods:
• IEngineeringObject Create(Type type, IEnumerable<KeyValuePair<string, object>>
parameters) - Creates an IEngineeringObject of indicated type initialized with values as
indicated in parameters..
• IList<EngineeringCreationInfo> GetCreationInfos() - Gets the collection of
EngineeringCreateInfo objects describing the different CreateInfos on this object.
• IList<EngineeringInvocationInfo> GetInvocationInfos() - Returns a collection of
EngineeringInvocationInfo objects describing the different actions on this object.
• object Invoke(string name, IEnumerable<KeyValuePair<Type, object>> parameters) -
Invokes the method represented by the current instance, using the specified parameters.
IEngineeringObjectAssociation
This interface is implemented by the collection of associated engineering objects. This interface
is derived from IEngineeringAssociation and IEngineeringInstance. See Working with
associations (Page 101)
IEngineeringServiceProvider
The interface is implemented by engineering objects that can provide service(s).
Methods:
• T GetService<T>() where T : class, IEngineeringService - Gets an instance of type T.
• IList<EngineeringServiceInfo> GetServiceInfos() - Returns a collection of
EngineeringServiceInfo objects describing the different services on this object.
IEngineeringService
The interface representing an engineering service that is provided by
IEngineeringServiceProvider.
EngineeringObjectHandle
The structure that provides a unique object handle.
See also
Working with compositions (Page 101)
Working with associations (Page 101)
Accessing associations
An association describes the relationship between two or more objects at type level.
TIA Portal Openness supports access to associations via index and via "foreach" loops. Direct
access, for example via string name, is not supported.
Attributes
The following attributes are available:
• int Count
• bool IsReadonly
• IEngineeringObject Parent
• retType this [ int index ] { get; }
Methods
TIA Portal Openness supports the following methods:
• int IndexOf ( type ): Returns the index in the association for a transferred instance.
• bool Contains ( type ): Determines whether the transferred instance is contained in
the association.
• IEnumerator GetEnumerator <retType>(): Employed within "foreach" loops to
access an object.
• void Add ( type )1: Adds the transferred instance to the association.
• void Remove ( type )1: Removes the transferred instance from the association.
1
: Not supported by all associations.
Accessing compositions
A composition is the special case of an association. A composition expresses a semantic
relationship of two objects, of which one is part of the other.
Attributes
The following attributes are available:
• int Count
• bool IsReadonly
• IEngineeringObject Parent
• retType this [int index] {get;}: Indexed access to an object of the composition.
This type of access should only be used in a targeted manner, as each indexed access
operation exceeds process boundaries.
Methods
TIA Portal Openness supports the following methods:
• retType Create (id, …): Creates a new instance and adds this instance to the
composition.
The signature of the method depends on the way in which the instance is created. This
method is not supported by all compositions.
• type Find (id, …): Scans a composition for the instance with the transferred ID.
The search is not recursive. The signature of the method depends on the way in which the
instance is searched for. This method is not supported by all compositions.
• IEnumerator GetEnumerator<retType> (): Employed within "foreach" loops to
access an object.
• Delete (type)1: Deletes the instance specified by the current object reference.
• int IndexOf (type): Returns the index in the composition for a transferred instance.
• bool Contains (type): Determines whether the transferred instance is contained in the
composition.
• void Import(string path, ImportOptions importOptions)1: Used for each
composition that contains importable types.
Each import signature includes a configuration parameter of the type "ImportOptions
(Page 885)" ("None", "Overwrite") by which the user controls the import behavior.
1
: Not supported by all compositions.
Application
As user of a TIA Portal Openness API, you can check that objects are the same with program code:
• You check whether two object references are the same with the operator "==".
• Use the System.Object.Equals() method to check if both objects are really identical
with regard to the TIA Portal.
Program code
Modify the following program code to check for object reference types:
...
//Composition
DeviceComposition sameCompA = project.Devices;
DeviceComposition sameCompB = project.Devices;
if (sameCompA.Equals(sameCompB))
{
Console.WriteLine("sameCompA is equal to sameCompB");
}
if (!(sameCompA == sameCompB))
{
Console.WriteLine("sameCompA is not reference equal to sameCompB");
}
DeviceComposition sameCompAsA = sameCompA;
if (sameCompAsA.Equals(sameCompA))
{
Console.WriteLine("sameCompAsA is equal to sameCompA");
}
if (sameCompAsA == sameCompA)
{
Console.WriteLine("sameCompAsA is reference equal to sameCompA");
}
MultiLingualGraphicComposition notSameComp = project.Graphics;
if (!sameCompA.Equals(notSameComp))
{
Console.WriteLine("sameCompA is not equal to notSameComp");
}
Note
Dynamic attributes are not shown in IntelliSense because their availability depends on the status
of the object instance.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Operation
A persistence (project, library, etc.) opened within an associated TIA Portal process can be
modified by a TIA Portal Openness client application. You can produce this modification from a
single operation or by a series of operations. Depending on the activity, it is reasonable to group
these operations into a single undo unit for more logical workflows. Additionally there are
performance advantages provided by grouping operations into a single undo unit. To support
this, the "ExclusiveAccess" class provides the method "Transaction(ITransactionSupport
persistence, string undoDescription)". The invocation of this method results in the instantiation
of a new disposable object of type "Transaction". You have to provide a description of the
transaction's contents (the text attribute cannot be null or Empty). While this instance has not
been disposed, all client application operations will be grouped into a in a single undo unit
within the associated TIA Portal process.
Modify the following program code to acquire a "Transaction" instance:
Note
Use a "using" statement to instatiate a "Transaction" to ensure it is disposed properly even when
exceptions occur, thus rolling back the transaction.
Modify the following program code to create a single undo unit in the attached TIA Portal
containing two "Create" modifications:
Restrictions
The following actions are not allowed inside of a transaction. Calling these will result in a
recoverable exception:
• Compile
• Go Online
• Go Offline
• ProjectText Import
• ProjectText Export
• Open Global Library
• Close Global Library
• Project Create
• Project Open
• Project OpenWithUpgrade
• Project Save
• Project SaveAs
• Project Close
Undo behavior
Actions performed by a TIA Portal Openness client application can result in undo units within the
attached TIA Portal process. Each of these undo entries will be grouped under a location entry.
This location entry will compose the following information from the client application:
• the assembly title from the manifest data if available; otherwise, the process name
• the process ID
• the SID (Openness Session ID of the client application's TiaPortal instance)
• optionally an indication that the client process is still running
2. The operations that are executed individually have individual undo entries describing the
operation as defined in the respective command meta data.
– Undo entry for a running client application:
Application
The instances of DirectoryInfo and FileInfo classes have to contain an absolute path.
Otherwise the methods using the DirectoryInfo or FileInfo objects.will lead to an
exception.
Program code
Modify the following program code to create a DirectoryInfo or a FileInfo object.
..
//Create a DirectoryInfo object
string directoryPath = @"D:\Test\Project 1";
DirectoryInfo directoryInfo = new DirectoryInfo(directoryPath);
Application
In TIA Portal Openness each IEngineeringServiceProvider of the TIA Portal Openness API
describes its capabilities to potential calls.
Self-description Support on IEngineeringObject
Class EngineeringCompositionInfo
Class EngineeringAttributeInfo
Class EngineeringInvocationInfo
Class EngineeringServiceInfo
Enum AccessMode
Class EngineeringInvocationParameterInfo
Class EngineeringCreationInfo
Class EngineeringCreationParameterInfo
Program code
AccessMode is a flags enum and its values can be combined like the following program code:
Modify the following program code to find all attributes of an IEngineeringObject and to do
changes on the access mode of those attributes.
...
IEngineeringObject engineeringObject = ...;
IList<EngineeringAttributeInfo> attributeInfos = engineeringObject.GetAttributeInfos();
foreach(EngineeringAttributeInfo attributeInfo in attributeInfos)
{
switch (attributeInfo.AccessMode)
{
case EngineeringAttributeAccessMode.Read:
...
break;
case EngineeringAttributeAccessMode.Write:
...
break;
case EngineeringAttributeAccessMode.Read|EngineeringAttributeAccessMode.Write:
...
break;
}
}
...
Modify the following program code of how Create and GetCreationInfos are intended to be used
together.
...
Project project = tiaPortal.Projects.Open(projectPath);
IEngineeringComposition deviceGroupComposition = project.DeviceGroups;
EngineeringCreationInfo deviceGroupCreationInfo = deviceGroupComposition.GetCreationInfos()
[0];
EngineeringCreationParameterInfo deviceGroupCreationParameterInfo =
deviceGroupCreationInfo.ParameterInfos[0];
string deviceGroupCreationParameterName = deviceGroupCreationParameterInfo.Name;
string groupName = "Example";
IDictionary<string, object> createParameters = new Dictionary<string, object>
{
{deviceGroupCreationParameterName, groupName }
};
IEngineeringObject group = deviceGroupComposition.Create(deviceGroupCreationInfo.Type,
createParameters);
...
Introduction
It is possible to write and read (general) attributes of the Blocks (written in any programming
language), DBs and UDTs via the Openness API.
TechnologicalObjects are internally DBs, so this feature is also valid for TOs.
The same checking rules are to be applied on Name by using SetAttribute of the Openness API
on block, DB (TO) or UDT which are applied in the GUI.
In case of rule violation an appropriate user exception will be thrown and the attribute value
won't be changed.
This extension of the API doesn't affect the XML export / import.
General Attributes
Legend
• X: The attribute is relevant, write to xml, accessible with API
• -: The attribute is not accessible, the attribute does not exist
Root objects
You can specify several root objects in import files.
Example: You can create several text lists in an XML file instead of one text list for each XML file.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• The project to be opened is not open in any other instance of the TIA Portal.
Note
Undo of project upgrade
If you undo an upgrade of a project to V14SP1 after you have connected it to TIA Portal
Openness, conflicts will occur.
Application
Use the Projects.Open method to open a project. Enter a path to the desired project in
the Projects.Open method.
The Projects.Open method only accesses projects that were created with the current
version of TIA Portal or which have been upgraded to the current version. If you access a project
of a previous version with the Projects.Open method, an exception will be returned. Use the
OpenWithUpgrade method, to open projects which have been made with previous versions of
TIA Portal.
Note
No access to read-only projects
TIA Portal Openness can only access projects with read and write privileges.
Program code
Modify the following program code to open a project:
Program code
...
Siemens.Engineering.Project project = tiaPortal.Projects.Open(new
FileInfo(@"D:\Project_3\Project_2.apXX"), MyUmacDelegate);
if (project != null)
{
try
{
...
}
finally
{
project.Close();
}
}
...
private static void MyUmacDelegate(UmacCredentials umacCredentials)
{
SecureString password = ...; // Get password from a secure location
umacCredentials.Type = UmacUserType.Project;
umacCredentials.Name = "SomeUser";
umacCredentials.SetPassword(password);
}
...
}
script, will be executed when open project is called. The Event "Authentication" will be executed
only for Open Protected Project.
You would be able to use the Additional Authentication Methods using the
AuthenticationEventArgs event args. Using AuthenticationTypeProvider ,the mode of
authentication is provided. From the above example , the crediantial mode is set.
Below are the values for AuthenticationTypeProvider.
• AuthenticationTypeProvider.DesktopSso : Open project with Single sign on user , no
password asked
• AuthenticationTypeProvider.Anonymous : Open project with anonymous user , no password
asked
• AuthenticationTypeProvider.Interactive : Open project with Interactive logon, User name and
password to be given in user interface
• AuthenticationTypeProvider.Credentials : Open Project with User name and password given.
The event is applicable for opening the project in Multiuser user environment.The above
authentication methods is applicable when a protected project is opened in Local session or
Server View.
If there are exceptions for example, a single sign-on session or a user name / password invalid
scenarios are handled by Openness exception EngineeringTargetInvocationException.
Program code
Note
If you access a project created with the current version the project will just be opened.
Program code
Modify the following program code to open a project via the OpenWithUpgrade method:
...
Siemens.Engineering.Project project = tiaPortal.Projects.OpenWithUpgrade(new
FileInfo(@"D:\Project_1\Project.apXX"), MyUmacDelegate);
...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
Application
Projects can be created via TIA Portal Openness API
• by calling the Create method on ProjectComposition
• by calling the Create method on IEngineeringComposition
ProjectComposition.Create
Modify the following program code:
Note
About parameter targetDirectory
The parameter targetDirectory can also represent an UNC (Universal Naming Convention) path,
therefore a project can also be created on a network shared drive.
IEngineeringComposition.Create
Modify the following program code:
//allows the user to give optional create parameters like author, comment in addition to
mandatory create parameters (targetdirectory, projectname)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Via TIA Portal Openness you can access general settings of the TIA Portal:
• Current user interface language
• "Search in project" option to create the search index needed for searching within a project.
The following table shows the details of the accessible settings in the "General" section of the TIA
Portal settings. The TiaPortalSettingsFolder instance will have the name "General".
The access to these settings is provided via the TiaPortalSettingsFolder class. The
TiaPortalSettingsFolder class will be accessible via the Settings attribute on the
TiaPortal class.
The following figure shows the specific settings in TIA Portal Openness:
7LD3RUWDO
6HWWLQJV)ROGHUV7LD3RUWDO6HWWLQJV)ROGHU&RPSRVLWLRQ
6HWWLQJV)ROGHUV
7LD3RUWDO6HWWLQJV)ROGHU&RPSRVLWLRQ
)ROGHUV
7LD3RUWDO6HWWLQJV)ROGHU
1DPH 6WULQJ
6HWWLQJV 7LD3RUWDO6HWWLQJ&RPSRVLWLRQ
)ROGHUV 7LD3RUWDO6HWWLQJV)ROGHU&RPSRVLWLRQ
6HWWLQJV
7LD3RUWDO6HWWLQJ&RPSRVLWLRQ
7LD3RUWDO6HWWLQJ
1DPH6WULQJ
9DOXH2EMHFW
if (((bool)searchSetting.Value))
{
searchSetting.Value = false;
}
}
TiaPortalSettingsFolder generalSettingsFolder =
tiaPortal.SettingsFolders.Find("General");
TiaPortalSetting UILanguageSetting =
generalSettingsFolder.Settings.Find("UserInterfaceLanguage");
if (((CultureInfo)UILanguageSetting.Value) != CultureInfo.GetCultureInfo("de-DE"))
{
UILanguageSetting .Value = CultureInfo.GetCultureInfo("de-DE");
}
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
• A project is save
See Saving a Project (Page 141)
Application
You can use the TIA Portal Openness to archive the opened and saved project state prior to
further any changes and then later you can retrieve the archived project.
Archiving a project
You can archive a TIA Portal project using TIA Openness API available on
Siemens.Engineering.Project object.
'targetName' is the name of the file created may it be archived or non archived. This file may or
may not contain any file extensions. For ProjectArchivationMode value as Compressed and
DiscardRestorableDataAndCompressed, the archived file name is as it is provided by you. If you
don't provide any extension or extension apart from "zap15_1" or "zap14" etc., then this archived
project could not be retrieved from TIA Portal outside the Openness API. If you don't not choose
Compressed or DiscardRestorableDataAndCompressed the result will be the default file
structure of a project of the current version.
Note
You must have saved the project before calling Archiving API. In case the project contains any
unsaved changes, archive would throw an EngineeringTargetInvocationException.
Project ArchivationMode
The ProjectArchivationMode enumeration have four values.
ProjectArchivationMode Description
None • No special action are taken with the orginial files. Mode is
similiar to a "save as" operation.
• No compressed zip file is created in this mode.
• The difference with SaveAs in this case is that the Archive
will not change the persistence location to the new Ar‐
chived folder whereas SaveAs does that
DiscardRestorableData • The file storage stores the project in an internal data file
and this file grows whenever a project data modification
happens. In the case of DiscardRestorableData mode this
data file is reorganized (only latest version of the objects
are stored and history is removed from the file) and Inter‐
mediate data, the files of the IM directory and tmp direc‐
tory are not copied to the archive location.
• No compressed zip file is created in this mode.
Compressed • The tmp project folder structure, created by Archiving, is
compressed into a zip compatible archive. The tmp folder
structure is removed after creation of the zip file.
DiscardRestorableDataAndCompressed • In the tmp project folder structure, created by Archiving,
the restorable data is discarded and then compressed into
a zip compatible archive. The tmp folder structure is re‐
moved after creation of the zip file.
Modify the following program code to access the archive project with an extension as '.archive':
Note
You are free to use any extension. The behavior of Archive would be same with/without
extension.
Retrieving a project
You can use the Openness API to retrieve an archived TIA Portal project. You can only retrieve a
compressed archive. For Archived project with 'ProjectArchivationMode.None' or
'ProjectArchivationMode.DiscardRestorableData' enumeration value cannot be retrieved by this
API. This API is available on the "Siemens.Engineering.ProjectComposition" object.
For retrieving a UMAC protected project an overloaded API with the UmacDelegate is provided
for getting the credentials, then the following API definition is used
Retrieve also supports ProjectOpenMode that can be specified as "Primary" or "Secondary", then
the following API definition is used
Note
umacDelegate could be passed as null if the project is not protected
If the archived project is of a previous TIA Portal version then you have to call the
RetrieveWithUpgrade API, then the following API definition is used
If the archived project is of a previous TIA Portal version and UMAC protected then another
overloaded API with UmacDelegate is available, then the following API definition is used.
If the archived project is of a previous TIA portal version and project open mode also needs to be
specified, then the following API definition is used.
Note
umacDelegate could be passed as null if the project is not protected. If the project is protected
then the user credentials of an admin user is required to perform the RetrieveWithUpgrade
action
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Saving a project (Page 141)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
Using TIA Portal Openness, you can perform select operations while working with a read-only
TIA Portal project. You can have access to read-only project, but you will not be able to use full
set of features that are available to a user with read-write access. For example, a user with read-
only credentials can use Openness to open a UMAC protected project as described in Opening
a project (Page 113). This functionality does not include Reference projects.
The list of Openness features that are available to you while accessing a read-only project can be
categorized into two sets of features - Inherent and Enabled non-modifying actions:
Inherent functionality
• GetAttribute(s) or using the getter for any attribute on any accessible object
• GetComposition on any accessible object
• GetService on any accessible object
• Find actions on any accessible object
• Navigation on any accessible object
• Determining the existence of accessible objects and accessing those objects in compositions
and associations
• System.Object methods on any accessible object
Enabled non-modifying actions
• Project.Close (...)
• PlcBlock.ShowInEditor ()
• CaxProvider.Export (Device,...)
• CaxProvider.Export (Project,...)
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
In the TIA Portal you can set and manage the project language in the Editor "Project languages".
TIA Portal Openness supports the following access to the project languages:
• Iterating through supported languages.
• Searching through the collection of supported languages
by System.Globalization.CultureInfo.
• Accessing individual languages. Each Language object will contain a single read-only
attribute Culture of type System.Globalization.CultureInfo.
• Accessing a collection of active languages.
• Searchring through the collection of active languages
by System.Globalization.CultureInfo.
• Adding a language to a collection of active languages.
• Removing a language from a collection of active languages.
• Setting an editing language.
• Setting a reference language.
The functionalities are provided by the LanguageSettings object. The following figure shows
model, which is provided by TIA Portal Openness:
3URMHFW
/DQJXDJH6HWWLQJV/DQJXDJH6HWWLQJV
/DQJXDJH6HWWLQJV
/DQJXDJH6HWWLQJV
(GLWLQJ/DQJXDJH/DQJXDJH
5HIHUHQFH/DQJXDJH/DQJXDJH
$FWLYH/DQJXDJHV/DQJXDJH$VVRFLDWLRQ $FWLYH/DQJXDJHV /DQJXDJHV
/DQJXDJHV/DQJXDJH&RPSRVLWLRQ
/DQJXDJH$VVRFLDWLRQ /DQJXDJH&RPSRVLWLRQ
/DQJXDJH
&XOWXUH,QIR&XOWXUHLQIR
Language supportedGermanLanguage =
supportedLanguages.Find(CultureInfo.GetCultureInfo("de-DE"));
activeLanguages.Add(supportedGermanLanguage);
languageSettings.EditingLanguage = supportedGermanLanguage;
languageSettings.ReferenceLanguage = supportedGermanLanguage;
See also
Hierarchy of hardware objects of the object model (Page 65)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can determine the navigation structure through the object hierarchy with
the IEngineeringObject interface. The result is returned as a list:
• Child objects
• Child compositions
• All attributes
Signature
Use the GetAttributeInfos method to determine attributes.
IList<EngineeringAttributeInfo>
IEngineeringObject.GetAttributeInfos();
Modify the following program code if you know the return value:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Programm code
Modify the following programm code to make a software target available:
SoftwareContainer softwareContainer =
((IEngineeringServiceProvider)deviceItem).GetService<SoftwareContainer>();
if (softwareContainer != null)
{
Software software = softwareContainer.Software;
}
SoftwareContainer softwareContainer =
((IEngineeringServiceProvider)deviceItem).GetService<SoftwareContainer>();
if (softwareContainer != null)
{
PlcSoftware software = softwareContainer.Software as PlcSoftware;
string name = software.Name;
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Multilingual texts in the TIA Portal are e. g. Project.Comment, PlcTag.Comment etc. In TIA Portal
Openness, the multilingual texts are represented by the MultilingualText object.
A MultilingualText object is composed of MultilingualTextItemComposition.
MultilingualTextItemComposition supports the following Find method:
• Find(<language:
Siemens.Engineering.Language>):MultilingualTextItem
Each MultilingualTextItem provides the following attributes:
...
Language englishLanguage = project.LanguageSettings.Languages.Find(new CultureInfo("en-
US"));
MultilingualText comment = project.Comment;
MultilingualTextItemComposition mltItemComposition = comment.Items;
MultilingualTextItem englishComment = mltItemComposition.Find(englishLanguage);
englishComment.Text = "English comment";
...
...
var mltObject = device.GetAttribute("CommentML");
MultilingualText multilingualText = mltObject as MultilingualText;
if (multilingualText != null)
{
Language englishLanguage = project.LanguageSettings.Languages.Find(new
CultureInfo("en-US"));
MultilingualTextItem multilingualTextItem =
multilingualText.Items.Find(englishLanguage);
if (multilingualTextItem != null)
{
multilingualTextItem.Text = comment;
}
}
...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to update the project property "simulation support" so that
you can create plc programs that are also used in a virtual SINUMERIK controller.
The following attributes are supported by Openness to read/write the property "simulation
support" of a TIA Portal project. The API is available on the "Siemens.Engineering.Project" object.
Program code
Modify and use the following program code to read/write the attribute value:
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
By using this function you can get project related attributes from the TIA Portal Openness API.
The provided information contains project attributes, project history and products utilized by the
project.
Project attributes
The project attributes provide the following information:
Project history
The project history is a composition of HistoryEntry objects, which contain the following
information:
Modify the following program code to enumerate through HistoryEntries and access their
attributes:
Note
The text attribute of HistoryEntry contains a string in the same language as UI. If a TIA Portal
Openness application is attached to a TIA Portal with no UI, the string is always in English
Used Products
The object UsedProduct includes the following information:
Modify the following program code to enumerate through UsedProduct and access the
attributes.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a project graphics:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• All devices are "Offline".
Application
The API interface supports the compilation of devices and program blocks. The compilation
result is returned as an object. Depending on type of the object HW or SW or HW/SW compilation
will be provided. The following object types are supported:
• Device - HW & SW
• Device with failsafe CPU - SW with switched-off F-activation property
• DeviceItem - HW
• CodeBlock - SW
• DataBlock - SW
• HmiTarget - SW
• PlcSoftware - SW
• PlcType - SW
• PlcBlockSystemGroup - SW
• PlcBlockUserGroup - SW
• PlcTypeSystemGroup - SW
• PlcTypeUserGroup - SW
Note
Time stamp format
All time stamps are in UTC. If you want to see the local time you can use DateTime.ToLocalTime().
Note
If a password has been assigned (Page 868) to the safety program, you are required to a log on
to the safety program (Page 870) to compile software changes. Otherwise, the process is
canceled and an exception is triggered.
Signature
Use the ICompilable method for compilation.
ICompilable compileService =
iEngineeringServiceProvider.GetService<ICompilable>();
CompilerResult result = compileService.Compile();
Note
All devices must be "Offline" before you start compiling.
Program code
Modify the following program code to compile the software changes of an object of the
type HmiTarget:
Modify the following program code to compile the software changes of an object of the type
PlcSoftware:
Modify the following program code to compile the software changes of an object of the type
CodeBlock:
Introduction
You can use the TIA Portal Openness to modify project in user management and access right.
With this Function Right , When a project is protected, "Modify Project via Openness API" can be
assigned to a role which in turn can be assigned to user.
There are certain behavior changes in TIA Portal Openness when you are having / without
having this function right in a protected project and affected when a protect project is opened
with a particular user credentials. The changes for Openness API is applicable only on protected
project and on project which is opened with ProjectOpenMode as primary.The
ProjectOpenMode as secondary is not considered.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
To save a project
• Use the Save() method to save a project
• Use the SaveAs() method to save a project with a different name or in a different directory
Program code
Modify the following program code open and save a project:
Modify the following program code save a project with a different name or in a different location:
...
TiaPortal portal = new TiaPortal(TiaPortalMode.WithUserInterface);
FileInfo fileInfoExistingProject = new FileInfo(@"D:\SampleProjects
\SampleProject.apXX");
DirectoryInfo dirInfoSaveAsProject = new DirectoryInfo(@"D:\SampleProjects
\SampleProjectSaveAs");
Project sampleProject = portal.Projects.Open(fileInfoExistingProject );
sampleProject.SaveAs(dirInfoSaveAsProject);
...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Program code
Modify the following program code to close a project:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Opening a project (Page 113)
• A project is open.
See Opening a project (Page 113)
Application
The attributes of a port interconnection are located at the port device item. The read and write
access of attributes via TIA Portal Openness is the same as at the UI.
The following ENUM values are provided for the attribute MediumAttachmentType:
Value Description
MediumAttachmentType.None Attachment type cannot be determined.
MediumAttachmentType.Copper Attachment type is copper.
MediumAttachmentType.FibreOp Attachment type is fiber optic.
tic
The following ENUM values are provided for the attribute CableName:
Value Description
CableName.None No cable name is specified
CableName.FO_Standard_Cable_9 FO standard cable GP (9 µm)
CableName.Flexible_FO_Cable_9 Flexible FO cable (9 µm)
CableName.FO_Standard_Cable_GP_50 FO standard cable GP (50 µm)
CableName.FO_Trailing_Cable_GP FO trailing cable / GP
CableName.FO_Ground_Cable FO ground cable
CableName.FO_Standard_Cable_62_5 FO standard cable (62.5 µm)
CableName.Flexible_FO_Cable_62_5 Flexible FO cable (62.5 µm)
CableName.POF_Standard_Cable_GP POF standard cable GP
CableName.POF_Trailing_Cable POF trailing cable
CableName.PCF_Standard_Cable_GP PCF standard cable GP
CableName.PCF_Trailing_Cable_GP PCF trailing cable / GP
CableName.GI_POF_Standard_Cable GI-POF standard cable
CableName.GI_POF_Trailing_Cable GI-POF trailing cable
CableName.GI_PCF_Standard_Cable GI-PCF standard cable
CableName.GI_PCF_Trailing_Cable GI-PCF trailing cable
The following ENUM values are provided for the attribute SignalDelaySelection:
Value Description
SignalDelaySelection.None -
SignalDelaySelection.CableLength CableLength is used to define the signal delay.
SignalDelaySelection.SignalDelayTime SignalDelayTime is used to define the signal delay.
The following ENUM values are provided for the attribute CableLength:
Value Description
CableLength.None Cable length is not specified.
CableLength.Length20m Cable length is 20m.
CableLength.Length50m Cable length is 50m.
CableLength.Length100m Cable length is 100m.
CableLength.Length1000m Cable length is 1000m.
CableLength.Length3000m Cable length is 3000m.
Port options
The following attributes are provided for port options:
The following ENUM values are provided for the attribute TransmissionRateAndDuplex:
Value Description
TransmissionRateAndDuplex.None -
TransmissionRateAndDuplex.Automatic Automatic
TransmissionRateAndDuplex.AUI10Mbps 10 Mbps AUI
TransmissionRateAndDuplex.TP10MbpsHa TP 10 Mbps half duplex
lfDuplex
TransmissionRateAndDuplex.TP10MbpsFu TP 10 Mbps full duplex
llDuplex
TransmissionRateAndDuplex.AsyncFiber async fiber 10Mbit/s half duplex mode
10MbpsHalfDuplex
TransmissionRateAndDuplex.AsyncFiber async fiber 10Mbit/s full duplex mode
10MbpsFullDuplex
TransmissionRateAndDuplex.TP100MbpsH TP 100 Mbps half duplex
alfDuplex
TransmissionRateAndDuplex.TP100MbpsF TP 100 Mbps full duplex
ullDuplex
TransmissionRateAndDuplex.FO100MbpsF FO 100 Mbps full duplex
ullDuplex
TransmissionRateAndDuplex.X1000MbpsF X1000 Mbps full Duplex
ullDuplex
TransmissionRateAndDuplex.FO1000Mbps FO 1000 Mbps full duplex LD
FullDuplexLD
TransmissionRateAndDuplex.FO1000Mbps FO 1000 Mbps full Duplex
FullDuplex
TransmissionRateAndDuplex.TP1000Mbps TP 1000 Mbps full duplex
FullDuplex
TransmissionRateAndDuplex.FO10000Mbp FO 10000 Mbps full Duplex
sFullDuplex
TransmissionRateAndDuplex.FO100MbpsF FO 100 Mbps full duplex LD
ullDuplexLD
TransmissionRateAndDuplex.POFPCF100M POF/PCF 100 Mbps full duplex
bpsFullDuplex
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
Application
Three types of Global Libraries are existing.
• System global library (Siemens.Engineering.Library.SystemGlobalLibrary): These global
libraries are included as part of a TIA Portal installation and use the .asx file extension. All
system global libraries are read only.
• Corporate global library (Siemens.Engineering.Library.CorporateGlobalLibrary): These
global libraries have been chosen by an administrator to be preloaded when TIA Portal is
started. All corporate global libraries are read only.
• User global library (Siemens.Engineering.Library.UserGlobalLibrary): These global libraries
have been created by users of TIA Portal. User global libraries can be opened either as read
only mode or readwrite mode.
If an user global library is already openned in a certain mode then the same user global library
cannot be openned with another mode.
User global libraries from previous versions can be opened only in read only mode.
Global Libraries opened using TIA Portal Openness will also be added to the TIA Portal UI's global
library collection, and seen in the TIA Portal UI if the UI is present.
Attributes of GlobalLibrary
Attributes of GlobalLibraryInfo
See also
Accessing folders in a library (Page 158)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A library is open
See Opening libraries (Page 151)
Application
You can use language setting navigator to access and manage the Global Library languages.
TIA Portal Openness supports the following access to the global library languages:
• Iterating through supported languages.
• Searching through the collection of supported languages
by System.Globalization.CultureInfo.
• Accessing individual languages. Each Language object will contain a single read-only
attribute Culture of type System.Globalization.CultureInfo.
• Accessing a collection of active languages.
• Searching through the collection of active languages
by System.Globalization.CultureInfo.
• Adding a language to a collection of active languages.
• Removing a language from a collection of active languages.
• Setting an editing language.
• Setting a reference language.
Note
Adding and modifying languages in global library language setting does not modify languages
of released versions in the global library. This behaviour holds true for updating global library
languages through UI (language editor) or LanguageSettings navigator.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application. This requirement is
only for accessing project libraries.
See Opening a project (Page 113)
Application
A global library can be opened using System.IO.FileInfo with a path to the library file on a local
storage medium or a network storage. Only user global libraries ca be opened by path. A path
obtained from a system global library or a corporate global library can not be used to open it.
As of V14 SP1 global libraries can be opened using the GlobalLibraryInfo. The OpenMode is
specified in the GlobalLibraryInfo.
A user global library from a previous version of TIA Portal can be upgraded and opened with the
current version of TIA Portal. A global library from V13 or a previous version cannot be opened
with upgrade. These libraries have to be upgraded to V13 SP1 first.
Libraries opened using TIA Portal Openness will also be added to the global library collection in
the TIA Portal, and will be visible in the user interface of TIA Portal.
OpenMode
Value Description
ReadOnly Read access to the library.
ReadWrite Read and write access to the library.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
Application
All opened global libraries in the TIA Portal, regardless if they have been opened via API or via
user interface can be enumerated.
Global Libraries from previous versions of TIA Portal will not be enumerated if they are opened
with write access.
Program code
Modify the following program code to enumerate open global libraries.
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A library is open.
See Opening libraries (Page 151)
Application
User global libraries can be closed or saved. Any changes made to the global library will not be
saved automatically. All unsaved changes will be discarded without prompting by closing a
global library.
System global libraries and corporate global library cannot be closed or saved.
To save and close a global library:
• Use the Save ( ) method to save a user global library
• Use the SaveAs ( ) method to save a user global library in a different directory
• Use the Close ( ) method to close a user global library
Feature tokens included for SaveAs ( ) are:
• PublicAPI : Necessary for any Published feature
• DenyIfTransaction : Necessary since SaveAs should not be allowed within a transaction as it
cannot be undone.
Program code
Modify the following program code to save a user global library:
Modify the following program code to save a user global library in a different location:
Note
The persistence of the library is changed after SaveAs operation. Thus, after the SaveAs is
performed, the newly saved library is available in libraries card. However, the original library on
which SaveAs operation was performed, would not be available. The newly saved library would
have the same mode as the original library on which SaveAs was performed. This means if the
existing library was opened in ReadOnly mode, then the newly saved library in the target path
would also open in the ReadOnly mode. Similar is the case for ReadWrite mode.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• A library is open.
See Opening libraries (Page 151)
• A library is save
See Saving and closing libraries (Page 153)
Application
A opened and saved global libraries can be archived prior to any further modification to prevent
from unintended result so that you can later retrieve the archived library. You can also share the
archived file across the network easily.
Archiving a library
You can use the TIA Portal Openness API interface to archive a user global library. The API is
available on the "Siemens.Engineering.UserGlobalLibrary" object.
'targetName' is the name of the file created for archived or non archived. This file may or may not
contain any file extensions. If you do not provide any extension or provide an extension apart
from "zalx" or "zal14" etc., then the archived file could not be retrieved from TIA Portal outside
the Openness API.
For LibraryArchivationMode value as Compressed and DiscardRestorableDataAndCompressed,
the archived file name is same as it is provided by you. For LibraryArchivationMode value as
None and DiscardRestorableData, the Library file extension is automatically decided by TIA
Portal Project Manager component, based on the current version of TIA Portal.
Note
You must have saved the library before calling Archive API. In case the library contains any
unsaved changes, archive would throw an EngineeringTargetInvocationException.
LibraryArchivation‐ Description
Mode
None • No special action are taken with the orginial files. Mode is similiar to a "save as" operation.
• No compressed zip file is created in this mode.
• The difference with SaveAs in this case is that the Archive will not change the persistence location
to the new Archived folder whereas SaveAs does that.
DiscardRestorableDa‐ • The file storage stores the library in an internal data file and this file grows whenever a library data
ta modification happens. In the case of DiscardRestorableData mode this data file is reorganized (only
latest version of the objects are stored and history is removed from the file) and Intermediate data,
the files of the IM directory and tmp directory (see Library Directory structure) are not copied to the
archive location.
• No compressed zip file is created in this mode.
Compressed The tmp library folder structure, created by Archiving, is compressed into a zip compatible archive. The
tmp folder structure is removed after creation of the zip file.
DiscardRestorableDa‐ The tmp library folder structure, created by Archiving, discards the restorable data and then com‐
taAndCompressed pressed into a zip compatible archive. The tmp folder structure is removed after creation of the zip file.
Retrieving a library
You can use the TIA Portal Openness API interface to retrieve an archived TIA Portal library. You
can only retrieve a compressed archive. The API is available on the
"Siemens.Engineering.GlobalLibraryComposition" object.
Note
You cannot retrieve an archived library with 'LibraryArchivationMode.None' or
'LibraryArchivationMode.DiscardRestorableData' enumeration value.
You can call RetrieveWithUpgrade API for the archived library of a previous TIA Portal version. The
API definition looks like the following:
public Siemens.Engineering.Library.UserGlobalLibrary
RetrieveWithUpgrade(System.IO.FileInfo sourcePath, System.IO.DirectoryInfo
targetDirectory, Siemens.Engineering.OpenMode openMode)
Open Mode
The OpenMode enumeration have two values:
OpenMode Description
ReadMode • Read access to the library. Data can be read from the library.
ReadWrite • Write access to the library. Data can be written to the library.
//Please adapt the path and the extension zalx to the installed version of TIA Portal
var archivePath = @"E:\Archive\Sample1.zalx";
var retrievedLibraryDirectory = @"E:\RetrievedLibraries";
var tiaPortal = new TiaPortal(TiaPortalMode.WithoutUserInterface);
tiaPortal.GlobalLibraries.Retrieve(new FileInfo(archivePath), new
DirectoryInfo(retrievedLibraryDirectory), OpenMode.ReadWrite));
See also
Opening libraries (Page 151)
Saving and closing libraries (Page 153)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
Application
Global libraries can be created via TIA Portal Openness API by calling the Create method on the
GlobalLibraryComposition. A UserGlobalLibrary will be returned
GlobalLibraryComposition.Create
Modify the following program code:
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
Application
You can use the TIA Portal Openness API interface to access the system folders for types and
master copies in a library. You can access types, type versions, master copies and user-defined
folders within the system folder.
You can access a user-defined folder at any time using the Find method, for example
libTypeUserFolder.Folders.Find("SomeUserFolder");.
Modify the following program code to access the system folder for master copies in a library:
...
LibraryTypeUserFolderComposition userFolderComposition = ...
LibraryTypeUserFolder userFolder = userFolderComposition.Find("Name of user folder");
...
Modify the following program code to enumerate user-defined subfolders in a system folder for
master copies:
Modify the following program code to create a user-defined folder for master copies:
var typeUserFolder =
project.ProjectLibrary.TypeFolder.Folders.Find("SampleTypeUserFolderName");
typeUserFolder.Name = "NewTypeUserFolderName";
Modify the following program code to create a user-defined folder for master copies:
var masterCopyUserFolder =
project.ProjectLibrary.MasterCopyFolder.Folders.Find("SampleMasterCopyUserFolderName");
masterCopyUserFolder.Name = "NewMasterCopyUserFolderName";
var masterCopyUserFolder =
ProjectLibrary.MasterCopyFolder.Folders.Find("SampleMasterCopyUserFolderName");
masterCopyUserFolder.SetAttributes(new[] {new KeyValuePair<string,object>("Name",
"NewMasterCopyUserFolderName")});
See also
Accessing master copies (Page 172)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
• You have access to a group for types.
See Accessing folders in a library (Page 158).
Application
You can access the types contained in a library via the TIA Portal Openness API interface.
• You can enumerate the types.
• You can rename types.
• You can access the following attributes for every type:
The following code is an example of how to use the library type sub-classes
Program code
Modify the following program code to enumerate all types in the system folder of a library:
Modify the following program code to enumerate all types in a user-defined folder of a library:
Modify the following program code to find an individual type by its name or GUID:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
• You have access to a group for types.
See Accessing folders in a library (Page 158).
Application
You can access type versions via the TIA Portal Openness API interface.
• You can enumerate the type versions of a type.
• You can determine the type to which a type version belongs.
• You can enumerate the instances of a type version.
• You can create a new instance of a type version.
• Vou can navigate from an instance to its connected version object.
• You can access the following attributes for every type version:
//Using the CreateFrom method to create an instance of the version in the VBScripts
composition
VBScript newScript = vbscripts.CreateFrom(scriptVersion);
//Using the CreateFrom method to create an instance of the version in the screens
composition
Screen newScreen = screens.CreateFrom(screenVersion);
//Using the CreateFrom method to create an instance of the version in the blocks composition
PlcBlock newBlock = blocks.CreateFrom(blockVersion);
PlcTypeLibraryTypeVersion plcTypVersione=...;
PlcTypeComposition types=...;
//Using the CreateFrom method to create an instance of the version in the types composition
PlcType newType = types.CreateFrom(plcTypeVersion);
Note
If you use these attributes on type versions with the "InWork" status, an exception can be
thrown.
Program code
Modify the following program code to determine the type to which a type version belongs:
Modify the following program code to determine the master copies that contain instances of a
type version:
Modify the following program code to find an individual type version by its version number:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• Opening a project
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get version information from a library object without
instantiating and compiling the object.
The following new Export Action will be provided on the LibraryTypeVersion engineering object
to export the version content.
The action will create the Exported xml file at given exportFileInfo.
Attributes ReadPublicationLevel
LibraryTypeName System
LibraryTypeGuid System
Note
This is necessary because without this info you would not be able to understand that exported
version info (in the exported xml file) belongs to which type.
Exported Content
Following content are available in the exported file:
• Library Version Info exported
Attributes SimaticMLAAccess
Author ReadWrite
Guid ReadOnly
Modified Data ReadOnly
VersionNumber ReadWrite
LibraryTypeName ReadOnly
Library TypeGuid ReadOnly
Navigators Exported:
• Comment
Note
Attributes with SimaticMLAccess readonly get exported only if you choose the exportoption as
"ExportOptions.WithReadOnly".
Program code
Modify the following program code to export version content information:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
• You have access to a group for types.
See Accessing folders in a library (Page 158).
Application
You can access instances of type versions via the TIA Portal Openness API interface.
Use the FindInstances(IInstanceSearchScope searchScope) method to find all
instances of a type version.
You can use the searchScope parameter to specify the area of the project to be searched. The
following classes implement the IInstanceSearchScope interface and can be used to
search for instances:
• PlcSoftware
• HmiTarget
The method returns a list that contains objects of the LibraryTypeInstanceInfo type. If
there are no instances, an empty list is returned.
Note
Instances of faceplates and HMI user data types are always linked to the associated type version.
Instances of all other objects, such as program blocks or screens, can be linked to a type version.
if(searchScope==null)
{
//No search possible
}
If an instance object is not connected to a version object, then it will not provide the
"LibraryTypeInstanceInfo" service.
FC fc = ...;
//Using LibraryTypeInstanceInfo service
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147)
• You have access to a group for master copies.
See Accessing folders in a library (Page 158)
Application
The TIA Portal Openness API interface supports access to master copies in a global library and the
project library:
• Creating master copies
• Enumerating master copies in system folders and user-defined folders
• Renaming master copies
• Querying information from master copies
• Querying information from objects in a master copy
Program code
Modify the following program code to enumerate all master copies in the system folder of a
library:
Modify the following program code to access an individual mastercopy by using the find method:
...
MasterCopySystemFolder systemFolder = projectLibrary.MasterCopyFolder;
MasterCopyComposition mastercopies = systemFolder.MasterCopies;
MasterCopy masterCopy = mastercopies.Find("Copy of ...");
...
Modify the following program code to enumerate master copy groups and subgroups:
Modify the following program code to access a MasterCopyUserFolder by using the find method:
...
MasterCopyUserFolderComposition userFolderComposition = ...
MasterCopyUserFolder userFolder = userFolderComposition.Find("Name of user folder");
...
//Using ContentDescriptions
MasterCopyContentDescriptionComposition masterCopyContentDescriptions =
multiObjectMasterCopy.ContentDescriptions;
MasterCopyContentDescription contentDescription= masterCopyContentDescriptions.First();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
If the library is a read-write library, you can create a MasterCopy of an IMasterCopySource at
target location.
MasterCopy
MasterCopyComposition.Create(Siemens.Engineering.Library.MasterCopies.IMasterCopySource
sourceObject);
• Tag - HMI
• TagTable - HMI
• TagUserFolder - HMI
Program code
Use the following program code:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
The TIA Portal Openness API interface supports the use of master copies in the project. You can
create an object in the object's composition from a master copy in a project library or a global
library using the CreateFrom method.
The return type will correspond to the respective composition's return type.
The CreateFrom method only supports master copies containing single objects. If the
composition where the action is called and the source master copy are incompatible (e.g. source
master copy contains a plc tag table and the composition is a plc block composition), a
recoverable exception will be thrown.
The following compositions are supported:
• Siemens.Engineering.HW.DeviceComposition
• Siemens.Engineering.HW.DeviceItemComposition
• Siemens.Engineering.SW.Blocks.PlcBlockComposition
• Siemens.Engineering.SW.Tags.PlcTagTableComposition
• Siemens.Engineering.SW.Tags.PlcTagComposition
• Siemens.Engineering.SW.Types.PlcTypeComposition
• Siemens.Engineering.SW.TechnologicalObjects.TechnologicalInstanceDBComposition
• Siemens.Engineering.SW.Tags.PlcUserConstantComposition
• Siemens.Engineering.Hmi.Tag.TagTableComposition
• Siemens.Engineering.Hmi.Tag.TagComposition
• Siemens.Engineering.Hmi.Screen.ScreenComposition
• Siemens.Engineering.Hmi.Screen.ScreenTemplateComposition
• Siemens.Engineering.Hmi.RuntimeScripting.VBScriptComposition
• Siemens.Engineering.HW.SubnetComposition
• Siemens.Engineering.HW.DeviceUserGroupComposition
• Siemens.Engineering.SW.Blocks.PlcBlockUserGroupComposition
• Siemens.Engineering.SW.ExternalSources.PlcExternalSourceUserGroupComposition
• Siemens.Engineering.SW.Tags.PlcTagTableUserGroupComposition
• Siemens.Engineering.SW.Types.PlcTypeUserGroupComposition
See also
Accessing master copies (Page 172)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The TIA Portal Openness API interface supports copying of master copies within a library and
between libraries using the CreateFrom action. The action will create a new object based on the
source master copy and place it in the composition where the action was called. The action will
try to create the new master copy with the same name as the source master copy. If such name
is not available, the system will give the new master copy a new name. Then, it will return the
new master copy.
If the composition where the "CreateFrom" action is called is in a read-only global library, a
recoverable exception will be thrown.
Program code
Modify the following program code:
MasterCopy copiedMasterCopy =
projectLibrary.MasterCopyFolder.MasterCopies.CreateFrom(sampleMasterCopy)
See also
Accessing master copies (Page 172)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147)
• You have access to a folder for types.
See Accessing folders in a library (Page 158).
Application
The TIA Portal Openness API interface allows you to determine type versions which belong to the
instances in the open project. The TIA Portal Openness API returns one of the following two
states per instance:
• The instance refers to an out-of-date type version.
• The instance refers to the latest type version.
The following rules apply when determining the version:
• You determine the version based on a library and the project that you want to open via the
TIA Portal Openness API interface.
• Instances are not updated when you determine the version.
Signature
Use the UpdateCheck method to determine the instances of a type version:
UpdateCheck(Project project, UpdateCheckMode updateCheckMode)
Parameter Function
Project Specifies the project in which the type versions of instances are determined.
UpdateCheckMode Specifies the versions that are determined:
• ReportOutOfDateOnly: Returns only status of the "out of date" type.
• ReportOutOfDateAndUpToDate:
Returns status of the type "out of date" and "up to date".
Result
The devices of the project are scanned from top to bottom when determining the version. Each
device is checked to determine whether its configuration data contain an instance of a type
version from the specified library. The UpdateCheck method returns the result of the version
check in hierarchical order.
The table below shows a result of a version check with the parameter
UpdateCheck.ReportOutOfDateAndUpToDate:
Program code
There is no difference between project and global libraries in handling the update check.
Modify the following program code to determine the type versions from a global or project
library for instances in the project:
//Alternatively, check for out of date instances and report both out of date and up to
date instances in the returned feedback
UpdateCheckResult alternateResult = library.UpdateCheck(project,
UpdateCheckMode.ReportOutOfDateAndUpToDate);
//Show result
RecursivelyWriteMessages(result.Messages);
Modify the following program code to output the result of the version check and process the
messages individually:
Modify the following program code to access individual message parts in the result of the
version check:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
• You have access to a folder for types.
See Accessing folders in a library (Page 158).
Application
The TIA Portal Openness API interface allows you to update instances of a selected type within
a type folder in a project.
When updating, the instances used in the project are updated based on the last released type
version. If you start updating the instances from a global library, synchronization is performed
beforehand.
Signature
Use the UpdateProject method to update instances.
Use the following call for classes which implement the LibraryTypes interface:
void UpdateProject(IUpdateProjectScope updateProjectScope)
Use the following call for classes which implement the ILibrary interface:
void UpdateProject(IEnumerable<ILibraryTypeOrFolderSelection>
selectedTypesOrFolders, IEnumerable <IUpdateProjectScope>
updateProjectScope)
Each call is entered in the log file in the project directory.
Parameter Function
IEnumerable<ILibraryTypeOrFolderSele Specifies the folder or types to be synchronized or
ction> selectedTypesOrFolders their instances in the project to be updated.
IUpdateProjectScope Specifies the object(s) in the project in which the
updateProjectScope uses of instances are to be updated. The following
IEnumerable <IUpdateProjectScope> objects are supported:
updateProjectScope • PlcSoftware
• HmiTarget
Program code
Modify the following program code to update instances of selected types within a type folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
• You have access to the required library.
See Accessing global libraries (Page 147).
• You have access to a folder for types.
See Accessing folders in a library (Page 158).
Application
The TIA Portal Openness API interface supports the following updates in the project library:
• Synchronize selected types between libraries.
The folder structure is not adapted when you perform synchronization. The types to be updated
are identified by their GUID and updated:
• If a type in a library includes a type version that is missing in the library to be updated, the
type version is copied.
• If a type in a library includes a type version with the different GUID, the process is aborted and
an Exception is thrown.
Signature
Use the UpdateLibrary method to synchronize type versions.
Use the following call for classes which implement the LibraryTypes interface:
void UpdateLibrary(ILibrary targetLibrary)
Use the following call for classes which implement the ILibrary interface:
void UpdateLibrary(IEnumerable<LibraryTypeOrFolderSelection>
selectedTypesOrFolders, ILibrary targetLibrary)
Parameter Function
IEnumerable<ILibraryTypeOrFolderSele Specifies the folder or types to be synchronized or
ction> selectedTypesOrFolders their instances in the project to be updated.
ILibrary targetLibrary Specifies the library whose contents will be
synchronized with a library.
If source library and destination library are identi‐
cal, an exception is thrown.
Program code
Modify the following program code to synchronize a type from the project library with a global
library:
sourceType.UpdateLibrary(projectLibrary);
Modify the following program code to synchronize selected types within a type folder between
a global library and the project library:
globalLibrary.UpdateLibrary(new[]{globalLibrary.TypeFolder}, projectLibrary);
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness application to delete the unused versions of the specified
types in a library and/ or all the types in a specified folder in a library.
The Cleanup API is available for both project and global libraries (libraries must be read-write).
It is analogous to the Clean up Library feature present in TIA Portal user interface.
The Cleanup is handled according to the specified CleanupLibraryMode flag.
A version is cleaned up based on the specified behavior of the two CleanupLibraryModes:
CleanupLibraryMode Description
CleanupLibraryMode.AllowTypeDeletion Allow deletion of all the versions on a type to be cleaned up. If
all versions on a type have been cleaned up, the type too will
be cleaned up.
CleanupLibraryMode.PreserveHighestVersion Preserve the highest version on a type
Program code
Modify the following program code to invoke cleanup action for a subset of types and folders:
...
ILibrary myLibrary = ...;
CleanupLibraryMode cleanupLibraryMode = ...;
ILibraryType typeA = ...;//from myLibrary
ILibraryType typeB = ...; //from myLibrary
LibraryTypeFolder singleFolderContainingTypes = ...;//from myLibrary
myLibrary.Cleanup(new[]{typeA, singleFolderContainingTypes}, cleanupLibraryMode);
...
Modify the following program code to invoke cleanup action for all types in a library:
...
ILibrary myLibrary = ...;
CleanupLibraryMode cleanupLibraryMode = ...;
myLibrary.Cleanup(new [] {myLibrary.TypeFolder}, cleanupLibraryMode);
...
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to harmonize the names and / or paths of type instances
with the types in a specified library.
The HarmonizeProject API is available for both project and global libraries. This feature is
analogous to the Harmonize feature present in TIA Portal user interface.
You can specifiy which devices in the project to harmonize along with the choosing whether to
harmonize names, paths, or both.
If the HarmonizeProject feature is called on a global library, the project library will be first
harmonized and then the project.
HarmonizeProjectOptions Description
HarmonizePaths Harmonize paths of the specified types or the types under the
specified folders. The instances in the project are renamed to
the type names of the library
HarmonizeProjectOptions.HarmonizeNames Harmonize names of the specified types or the types under the
specified folders. The folder structure of the library types are
applied to the project instances
HarmonizeProjectOptions.HarmonizeNames | HarmonizePro‐ Harmonize names and paths of types selected or the types
jectOptions.HarmonizePaths under a selected folder
HarmonizeProjectOptions.None This is not to be used and exception is thrown on usage
Program code
Modify the following program code to perform Harmonize names for a subset of types and
folders:
...
ILibrary myLibrary = ...;
HarmonizeProjectOptions harmonizeProjectOptions = ...;
ILibraryType typeA = ...; //from myLibrary
ILibraryType typeB = ...; //from myLibrary
LibraryTypeFolder singleFolderContainingTypes = ...; //from myLibrary
IUpdateProjectScope harmonizeProjectScope = ....... //scope of device in project to be
harmonized
myLibrary.HarmonizeProject(new[]{typeA, singleFolderContainingTypes}, new[]
{harmonizeProjectScope}, HarmonizeProjectOptions.HarmonizeNames);
...
Modify the following program code to perform Harmonize paths for a subset of types and
folders:
...
ILibrary myLibrary = ...;
HarmonizeProjectOptions harmonizeProjectOptions = ...;
ILibraryType typeA = ...; //from myLibrary
ILibraryType typeB = ...; //from myLibrary
LibraryTypeFolder singleFolderContainingTypes = ...; //from myLibrary
IUpdateProjectScope harmonizeProjectScope = ....... //scope of device in project to be
harmonized
myLibrary.HarmonizeProject(new[]{typeA, singleFolderContainingTypes}, new[]
{harmonizeProjectScope}, HarmonizeProjectOptions.HarmonizePaths);
...
Modify the following program code to perform Harmonize names and paths for a subset of types
and folders:\
...
ILibrary myLibrary = ...;
HarmonizeProjectOptions harmonizeProjectOptions = ...;
ILibraryType typeA = ...; //from myLibrary
ILibraryType typeB = ...; //from myLibrary
LibraryTypeFolder singleFolderContainingTypes = ...; //from myLibrary
IUpdateProjectScope harmonizeProjectScope = ....... //scope of device in project to be
harmonized
myLibrary.HarmonizeProject(new[]{typeA, singleFolderContainingTypes}, new[]
{harmonizeProjectScope}, HarmonizeProjectOptions.HarmonizeNames |
HarmonizeProjectOptions.HarmonizePaths);
...
Exception Handling
The exception scenarios are stated below:
NULL in sourceTypesAndFolder collection:
HarmonizeProjectOptions is None
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to update/retain the structure if there are conflicts and also
retain/delete unused versions from target library.
With TIA Portal Openness 17, UpdateLibrary API is introduced with the following signature on
Project Library and Global Library:
• public void UpdateLibrary(IEnumerable<ILibraryTypeOrFolderSelection>
sourceTypesAndFolders, ILibrary targetLibrary, ForceUpdateMode forceUpdateMode,
DeleteUnusedVersionsMode updateMode, StructureConflictResolutionMode
structureConflictResolutionMode);
Another UpdateLibrary api is introduced on Single Types with the following signature :
• public void UpdateLibrary(ILibrary targetLibrary, DeleteUnusedVersionsMode updateMode,
StructureConflictResolutionMode structureConflictResolutionMode,ForceUpdateMode
forceUpdateMode);
With this new API, You can now pass delete unused version mode, structure conflict resolution
mode and forceUpdate mode
• DeleteUnusedVersionsMode - Options used to control whether to delete/retain unused
versions from the Target library.
• StructureConflictResolutionMode - Options used to control whether to update the target
library structure, retain the existing structure or to cancel the operation if there is a structural
conflict.
• ForceUpdateMode - Options used to control whether to set the updated version on the
target library as default/latest.
UpdateLibrary is processed based on the ENUM values provided as input :
• DeleteUnusedVersionsMode.AutomaticallyDelete : Unused versions will be deleted in the
Target Library <if there are unused version in target libraries>
• DeleteUnusedVersionsMode.DoNotDelete : Unused versions will not be deleted in the
Target Library <if there are unused version in target libraries>
• StructureConflictResolutionMode.UpdateStructure : Source Library structure will be
updated in the Target Library <if there are structural differnces between source and target
libraries>
• StructureConflictResolutionMode.RetainStructure : Source Library structure will be same
in the Target Library <if there are structural differnces between source and target libraries>
• StructureConflictResolutionMode.CancelIfStructureConflicts : If a structure conflict
occurs, it throws the EngineeringTargetInvocationException and cancel the operation.
• ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault : Default version in source
library is updated to target and the updated version is marked as default version in target only
if source version number is higher than target version number
• ForceUpdateMode.ForceSetAnyUpdatedVersionAsDefault : Default version in source
library is updated to target as default/latest version, irrespective of version number.
• ForceUpdateMode.NoDefaultVersionChange : This enum value should be used during
update from project library to project where force update option is not applicable.
Modify the program code to perform update libraryUpdateLibrary for a single type from Project
Library to Global Library(delete unused version , update existing target library structure and
force update target version as default irrespective of version number):
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeUserFolder singleFolderContainingTypes =
myProjectLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1");
// block1 has lower version.
DeleteUnusedVersionsMode deleteUnusedVersionsMode =
DeleteUnusedVersionsMode.AutomaticallyDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.UpdateStructure;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.ForceSetAnyUpdatedVersionAsDefault;
ILibrary globalLibrary = ...;
typeA.UpdateLibrary(globalLibrary, deleteUnusedVersionsMode,
structureConflictResolutionMode, forceUpdateMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Project
Library to Global Library(do not delete unused version, retain existing target library structure
and do not perform force update):
...
ILibrary globalLibrary = ...;
LibraryTypeUserFolder singleFolderContainingTypes =
globalLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1");// block1 has lower
version.
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.RetainStructure;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
ILibrary myProjectLibrary = Project.ProjectLibrary;
typeA.UpdateLibrary(myProjectLibrary, deleteUnusedVersionsMode,
structureConflictResolutionMode, forceUpdateMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Global
Library to Project Library(do not delete unused version, retain existing target library structure
and do not perform force update):
...
ILibrary globalLibrary = ...;
LibraryTypeUserFolder singleFolderContainingTypes =
globalLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1"); // block1 has lower
version.
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.RetainStructure;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
ILibrary myProjectLibrary = Project.ProjectLibrary;
typeA.UpdateLibrary(myProjectLibrary, deleteUnusedVersionsMode,
structureConflictResolutionMode, forceUpdateMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Global
Library to Project Library(delete unused version, update existing target library structure and do
not perform force update):
...
ILibrary globalLibrary = ...;
LibraryTypeUserFolder singleFolderContainingTypes =
globalLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1"); // block1 has lower
version.
DeleteUnusedVersionsMode deleteUnusedVersionsMode =
DeleteUnusedVersionsMode.AutomaticallyDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.UpdateStructure;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
ILibrary myProjectLibrary = Project.ProjectLibrary;
typeA.UpdateLibrary(myProjectLibrary, deleteUnusedVersionsMode,
structureConflictResolutionMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Project
Library to Global Library:
Modify the following program code to perform UpdateLibrary for multiple types from Project
Library to Global Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeUserFolder singleFolderContainingTypes =
myProjectLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1"); // block1 has lower
version.
ILibraryType typeB = ...;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode=
StructureConflictResolutionMode.UpdateStructure;
ILibrary globalLibrary;myProjectLibrary.UpdateLibrary(new[] { typeA, typeB },
globalLibrary, forceUpdateMode, deleteUnusedVersionsMode, structureConflictResolutionMode);
...
Modify the following program code to perform UpdateLibrary for a user folder containing type
from Project Library to Global Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeUserFolder singleFolderContainingTypes =
myProjectLibrary.TypeFolder.Folders.Find("folder1");
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.UpdateStructure;
ILibrary globalLibrary;
myProjectLibrary.UpdateLibrary(new[]
{ (ILibraryTypeOrFolderSelection)singleFolderContainingTypes }, globalLibrary,
forceUpdateMode, deleteUnusedVersionsMode, structureConflictResolutionMode);
...
Modify the following program code to perform UpdateLibrary on "Types" system folder from
Project Library to Global Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeSystemFolder typeFolder = myProjectLibrary.TypeFolder;
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.RetainStructure;
ILibrary globalLibrary;
myProjectLibrary.UpdateLibrary(new[] { (ILibraryTypeOrFolderSelection)typeFolder },
globalLibrary, forceUpdateMode, deleteUnusedVersionsMode, structureConflictResolutionMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Global
Library to Project Library:
...
ILibrary globalLibrary = ...;
LibraryTypeUserFolder singleFolderContainingTypes =
globalLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1"); // block1 has lower
version.
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.UpdateStructure;
ILibrary myProjectLibrary = Project.ProjectLibrary;
globalLibrary.UpdateLibrary(new[] { typeA }, myProjectLibrary, forceUpdateMode,
deleteUnusedVersionsMode, structureConflictResolutionMode);
...
Modify the following program code to perform UpdateLibrary for a single type from Global
Library to Global Library:
...
ILibrary globalLibrarySource = ...;
LibraryTypeUserFolder singleFolderContainingTypes =
globalLibrarySource.TypeFolder.Folders.Find("folder1");
ILibraryType typeA = singleFolderContainingTypes.Types.Find("block1"); // block1 has lower
version.
ForceUpdateMode forceUpdateMode = ForceUpdateMode.SetOnlyHigherUpdatedVersionAsDefault;
DeleteUnusedVersionsMode deleteUnusedVersionsMode = DeleteUnusedVersionsMode.DoNotDelete;
StructureConflictResolutionMode structureConflictResolutionMode =
StructureConflictResolutionMode.UpdateStructure;
ILibrary globalLibraryTarget = ...;
globalLibrarySource.UpdateLibrary(new[] { typeA }, globalLibraryTarget, forceUpdateMode,
deleteUnusedVersionsMode, structureConflictResolutionMode);
...
StructureConflictResolutionMode is CancelIfStructureConflicts
Note
Other cases in which EngineeringTargetInvocationException is thrown are as below:
• Any Update Library operations targeting a read-only global library will result in an exception
being thrown.
• An exception will be thrown if any of the selected types or folders are null or not part of the
source library.
See also
Opening a project (Page 113)
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can delete the following project library content using the TIA Portal Openness API interface:
• Types
• Type version
• User-defined folders for types
• Master copies
• User-defined folders for master copies
Note
Deleting of types and user-defined type folders
If you want to delete a type or user-defined folder type, the "Rules for deleting versions" must be
met. You can always delete an empty type folder.
Note
Rules for deleting versions
You can only delete versions with "Committed" status. The following rules also apply when
deleting versions:
• If a new version with the "InWork" status has just been created from a version with
"Committed" status , you can only delete the version with "Committed" status when the
new version is discarded or it obtains the "Committed" status.
• If a type only has one version, the type is deleted as well.
• If Version A is dependent on Version B of another type, first delete Version A and then Version
B.
• If there are instances of Version A, you can only delete Version A if the instances are deleted
as well. If an instance is also contained in a master copy, the master copy is deleted as well.
Program code
Modify the following program code to delete types or user-defined type folders:
Modify the following program code to delete an individual type or user-defined type folder:
Modify the following program code to delete a master copy or a user-defined master copy folder:
See also
Accessing master copies (Page 172)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 81)
Application
You can use the TIA Portal Openness to set any released version as default version of that type
for project library and user global library.
Default version is considered as preferred version of a type.
Program code
Exception Handling
An exception "EngineeringTargetInvocationException" will be thrown to you if a failure
happened during the invocation of SetAsDefault API.
You can encounter exception in the following scenarios:
• In project library, when SetAsDefault() is called on in-test/in-work version
• When Global Library is read-only
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get default version of a type for project library and global
library. You can also use the TIA Portal Openness application to check if a version is default or not.
Default version is considered as preferred version of a type.
Program code
...
ILibrary myLibrary = ...;
LibraryType typeA = ...;// from myLibrary
var typeADefaultVersion = typeA.Versions.First((version) => version.IsDefault);
//from default version , user can get details related to version like Author, Guid, etc.
var nameofType = typeADefaultVersion.LibraryTypeName;
var guid = typeADefaultVersion.Guid;
var versionNumber = typeADefaultVersion.VersionNumber;
var authoroftheVersion = typeADefaultVersion.Author;
var status = typeADefaultVersion.State;
...
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to check types for a inconsistencies. Types can have
different consistency status. It is Consistent, if Dependent Type is using default version of
Dependency.Type and is Inconsistent if Dependent Type is not using the default version of
Dependency Type.
The folder level consistency Status shows if any type under the structure is Consistent or
Inconsistent.
The Status API is part of Siemens.Engineering.Library.Types.LibraryType and
Siemens.Engineering.Library.Types.LibraryTypeFolder class and will be of
ConsistencyStatustype.
To allow TIA Portal Openness user to check the consistency status of type/folders a "Status"
attribute will be introduced for the following:
• SystemFolder
• UserFolder
• Type
Using this, you can prepare the list of inconsistent types to perform special operations on them:
Value Description
DefaultVersionInConsistent Dependent Types are not using the default version of Depend‐
ency Types
Consistent Dependent Types are using the defautt version of Dependency
Types
Program code
Modify the following program code to read status attribute support on "Types" system folder
from Project Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeSystemFolder typeFolder = myProjectLibrary.TypeFolder;
var systemTypeFolderConsistencyStatus = typeFolder.Status;
if(systemTypeFolderConsistencyStatus == ConsistencyStatus.DefaultVersionInConsistent)
{
//Do something.
}
// List of InConsistentType
var listOfInCosistentTypes = typeFolder.Types.Where(x => x.Status ==
ConsistencyStatus.InConsistent);
foreach(var type in listOfInCosistentTypes)
{// From type, user can get details like Author, Guid etc
var nameOfType = type.LibraryTypeName;
var guid = type.Guid;
var authorOfTheVersion = type.Author;
var status = type.State;
}
...
Modify the following program code to read Status Attribute on "User Folder" from Project Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeUserFolder userFolder = myProjectLibrary.TypeFolder.Folders.Find("folder1");
var userTypeFolderConsistencyStatus = userFolder.Status;
if(userTypeFolderConsistencyStatus == ConsistencyStatus.DefaultVersionInConsistent)
{
//Do something.
}
...
Modify the following program code to read Status Attribute on "Individual Type" from Project
Library:
...
ILibrary myProjectLibrary = Project.ProjectLibrary;
LibraryTypeUserFolder userFolder = myProjectLibrary.TypeFolder.Folders.Find("folder1");
ILibraryType blockType = userFolder.Types.Find("block1");
var blockTypeConsistencyStatus = blockType.Status;
if(blockTypeConsistencyStatus == ConsistencyStatus.DefaultVersionInConsistent)
{
//Do something.
}
...
Note
This attribute can also be used in similar way in Global Library.
Exception Handling
An ArgumentNullException exception will be thrown to you if any of the selected types or folders
are null or not part of the source library.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can open the "Devices & networks" editor via the API interface by using one of two methods:
• ShowHwEditor(View.Topology or View.Network or View.Device): Open the
"Devices & networks" editor from the project.
• ShowInEditor(View.Topology or View.Network or View.Device) : Displays
the specified device in the "Devices & networks" editor.
Use the View parameter to define the view that is displayed when you open the editor:
• View.Topology
• View.Network
• View.Device
Program code
Modify the following program code to open the "Devices & networks" editor:
Modify the following program code to open the "Devices & networks" editor for a device:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can determine whether a software base can be used as PLC target (PlcSoftware) or HMI
target in the TIA Portal Openness API.
// Returns PlcSoftware
private PlcSoftware GetPlcSoftware(Device device)
{
DeviceItemComposition deviceItemComposition = device.DeviceItems;
foreach (DeviceItem deviceItem in deviceItemComposition)
{
SoftwareContainer softwareContainer = deviceItem.GetService<SoftwareContainer>();
if (softwareContainer != null)
{
Software softwareBase = softwareContainer.Software;
PlcSoftware plcSoftware = softwareBase as PlcSoftware;
return plcSoftware;
}
}
return null;
}
See also
Enumerating devices (Page 273)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• For writing access, the PLC is offline.
Application
You can use the TIA Portal Openness API interface to get or set attributes of the address object.
Further you can assign the current process image to an OB.
The following attributes can be accessed:
Restrictions
• Attribute StartAddress
– Setting StartAddress may implicit change the StartAddress of the opposite I0
Type at the name module. Changing of input address changes the output address.
– Writing access is not supported for all devices.
– Packed addresses are not supported in TIA Portal Openness
– Changing an address via TIA Portal Openness will not rewire the assigned tags.
• Attribute InterruptObNumber
– Only accessible in settings with S7-300 or S7-400 controllers. Writing access is supported
for S7-400 controllers.
// read attribute
bool attributeValue = (bool)address.GetAttribute("IsochronousMode");
// write attribute
address.SetAttribute("IsochronousMode", true);
Modify the following program code to access the ProcessImage attribute of an address object:
// read attribute
int attributeValue = (int)address.GetAttribute("ProcessImage");
// write attribute
address.SetAttribute("ProcessImage", 7);
Modify the following program code to access the InterruptObNumber attribute of an address
object:
// read attribute
long attributeValue = (long)address.GetAttribute("InterrruptObNumber");
// write attribute
address.SetAttribute("InterrruptObNumber", 42L);
//default value = 40
Modify the following program code to access the StartAddress attribute of an address object:
// read attribute
int attributeValue = (int)address.GetAttribute("StartAddress");
// write attribute
address.StartAddress = IntValueStartAddress;
OB obX =…
Address address= ...;
address.SetAttribute("ProcessImage", 5);
try
{
address.AssignProcessImageToOrganizationBlock(obX);
} catch(RecoverableException e) {
Console.WriteLine(e.Message);
}
try
{
address.AssignProcessImageToOrganizationBlock(null);
} catch(RecoverableException e) {
Console.WriteLine(e.Message);
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Signal Modules like analog input modules usually have multiple channels within a single
module. Usually, channels provide similar functionality multiple times, e.g. an analog input
module with four channels can measure four voltage values at the same time.
To access all channels of a module, the Channels attribute of an device item is used.
Channel types
Value Description
ChannelType.None The channel type invalid.
ChannelType.Analog The channel type is analog.
ChannelType.Digital The channel type is digital.
ChannelType.Technology The channel type is technology.
Channel IO types
Value Description
ChannelIOType.None The channel IO type invalid.
ChannelIOType.Input An input channel.
ChannelIOType.Output An output channel.
ChannelIOType.Complex Complex IO types, e.g. for technological channels.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Subnets can be created in two different ways:
• Create a subnet that is connected to an interface: The type of the interface, where the subnet
is created, determines the type of the subnet
• Create a subnet not connected to an interface.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
For several network related features, e.g. assigning interfaces to a subnet, you have to access
subnets in the project. Typically, subnets are aggregated directly on project level.
Attributes of a subnet
A subnet has the following attributes:
Network types
Value Description
NetType.Unknown The type of the network is unknown.
NetType.Ethernet The type of the network is Ethernet.
NetType.Profibus The type of the network is Profibus.
NetType.Mpi The type of the network is MPI.
NetType.ProfibusIntegrated The type of the network is integrated Profibus.
NetType.Asi The type of the network is ASi.
NetType.PcInternal The type of the network is PC internal.
NetType.Ptp The type of the network is PtP.
NetType.Link The type of the network is Link.
NetType.Wan The type of the network is Wide Area Network
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
If a device item is able to compose a subnet, it provides the additional functionality "subnet
owner". To access this additional functionality, a specific service of the device item must be used.
SubnetOwner subnetOwner =
((IEngineeringServiceProvider)deviceItem).GetService<SubnetOwner>();
if (subnetOwner != null)
{
// work with the role
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The attribute TypeIdentifier is used to identify a subnet. The TypeIdentifier is a string
consisting of several parts: <TypeIdentifierType>:<SystemIdentifier>
Possible values for TypeIdentifierType are:
• System
SystemIdentifier
Program code
Modify the following program code to get the type identifier for user manageable and separately
creatable objects for GSD:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A subnet provides certain mandatory attributes that can be read and/or written. The attributes
are only available, if they are available at the UI. Writing is generally only allowed if an attribute
can also be changed by the user at the UI. This might vary depending on the type of the subnet.
For example, the user can only set the DpCycleTime, if the IsochronousMode is true and the
DpCycleMinTimeAutoCalculation is false
Program code
Modify the following program code to get or set the attributes of a subnet:
subnet.Name = "NewName";
subnet.SetAttribute("Name", "NewName");
Baud rates
Value Description
BaudRate.None The baud rate is unknown.
BaudRate.Baud9600 9.6 kBaud
BaudRate.Baud19200 19.2 kBaud
BaudRate.Baud45450 45.45 kBaud
BaudRate.Baud93700 93.75 kBaud
BaudRate.Baud187500 187.5 kBaud
BaudRate.Baud500000 500 kBaud
BaudRate.Baud1500000 1.5 MBaud
BaudRate.Baud3000000 3 MBaud
BaudRate.Baud6000000 6 MBaud
BaudRate.Baud12000000 12 MBaud
Bus profiles
Value Description
BusProfile.None The bus profile is unknown.
BusProfile.DP The type of the network is DP.
BusProfile.Standard The type of the network is Standard.
BusProfile.Universal The type of the network is Universal.
BusProfile.UserDefined The type of the network is user defined.
Communication load
Value Description
CommunicationLoad.None No valid communication load.
CommunicationLoad.Low Typically used for DP, no great data communication apart from
DP.
Value Description
CommunicationLoad.Medium Typically used for mixed operations featuring DP and other
communication services, such as for S7 communication, when
DP has strict time requirements and for average acyclic volumes
of communication.
CommunicationLoad.High For mixed operations featuring DP and other communication
services, such as for S7 communication, when DP has loose
time requirements and for high acyclic volumes of communi‐
cation.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a a global subnet within a project.:
// delete subnet
Subnet subnetToDelete = ...;
subnetToDelete.Delete();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Enumeration of all participants on a subnet.
Program code
Modify the following program code to enumerate dp master systems from subnet:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Enumeration of IoSystem provides all io systems that are present on a subnet. The class IoSystem
represents the master systems and the io systems.
Program code
Modify the following program code to enumerate dp master systems from subnet:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The role interface aggregates nodes to access attributes that are related to the address and
subnet assignment of an interface.
The name of a node can be seen in the attributes of an interface in TIA Portal . The NodeId is a
unique identifier for every node aggregated at an interface, its value can only be seen via TIA
Portal Openness.
Program code
Modify the following program code to access all nodes of an interface:
Most interfaces provide only a single node, therefore, usually the first node is used:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A device item provides certain mandatory attributes that can be read and/or written. The
attributes are only available if they are available at the UI. Writing is generally only allowed if an
attribute can also be changed by the user at the UI. This might vary depending on the type of the
device item. For example, the user can only set the RouterAddress if the RouterUsed is true. If the
user changes the SubnetMask at IO controller, Subentmask on all IO devices will be also changed
to the same value.
Protocol selection
Value Description
IpProtocolSelection.None Error value
IpProtocolSelection.Project IP suite configured within project.
IpProtocolSelection.Dhcp IP suite managed via DHCP protocol. DHCP Client ID necessary.
IpProtocolSelection.UserProgram IP suite set via FB (function block).
IpProtocolSelection.OtherPath IP suite set via other methods, for example PST tool.
IpProtocolSelection.ViaIoController IP suite set via IO Controller in runtime.
Net type
Value Description
NetType.Asi Net type is ASI.
NetType.Ethernet Net type is Ethernet.
NetType.Link Net type is Link.
NetType.Mpi Net type is MPI.
NetType.PcInternal Net type is PC internal.
NetType.Profibus Net type is PROFIBUS.
NetType.ProfibusIntegrated Net type is PROFIBUS integrated.
NetType.Ptp Net type is PTP.
NetType.Wan Net type is Wide Area Network (WAN).
NetType.Unknown Net type is Unknow.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to assign a node (device, interface) to a network:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to disconnect a node (device, interface) from a network:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
An io system is created by calling the action IoController.CreateIoSystem("name") on an object
of the type IoController. In case name is null or String.Empty the default name will be used. The
io controller is aquired by accessing the attribute IoControllers object on the NetworkInterface.
The IoControllers navigator returns one IoController object.
Prerequisites for creating an io system:
• The interface of the io controller is connected to a subnet.
• The io controller has no io system.
Program code
Modify the following program code to create an io system:
using System.Linq;
...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The master system and the io system will both be represented by the class IoSystem.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Use the action ConnectToIoSystem(IoSystem ioSystem) of IoConnector to connect a profinet or
a DP IoConnector to an existing io system.
Use the action GetIoController to navigate to the remote IoController. For further information
how to navigate to the local IoConnector and the io system see Get master system or IO system
of an interface (Page 231).
Prerequisites:
• The IoConnector is not yet connected to an io system.
• The IoConnector interface is connected to the same subnet as the interface of the desired
IoController.
Program code
Modify the following program code:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The service NetworkInterface provides the navigator IoControllers, each IoController in turn
provides the navigator IoSystem. The class IoSystem represents the master systems and the io
systems. The io device and the slave are both named io device.
• The IoControllers navigator returns IoController objects, if the network interface can have an
io system. At the moment only one io controller will be returned.
• The IoConnectors navigator returns IoConnector objects, if the network interface can be
connected to an io system as an io device. At the moment only one io connector will be
returned.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Currently only configurations with one IoController are possible. An IoController does not
provide any modelled attributes or actions.
Program code
Modify the following program code to get the io controller:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
An IoConnector does provide the modelled attributes or actions.
The following attribute and actions are available at the IoConnector:
Actions
Links
Program code
Modify the following program code to get the io connector:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Use the action DisconnectFromIoSystem() of IoConnector to disconnect an IoConnector from
an existing io system or an existing DP mastersystem.
For further information how to navigate to the local IoConnector and the io system see Get
master system or IO system of an interface (Page 231).
Program code
Modify the following program code:
ioConnector.DisconnectFromIoSystem();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A DP Mastersystem provides certain attributes that can be read and/or written. The attributes are
only available if they are available at the UI. Writing is generally only allowed if an attribute can
also be changed by the user at the UI. This might vary depending on the DP Master and the DP
Slaves which are assigned to this DP Mastersystem.
Attributes of a dp mastersystem
dpMastersystem.Name ="myDpMastersystem"
dpMastersystem.Number=42;
Application
You can use the TIA Portal Openness to access the attributes in PROFINET Interface of PN Driver
V2.2.
The following attributes can be accessed at the Real time options using TIA Portal Openness:
The following attributes can be accessed at Isochronous mode options using TIA Portal
Openness:
Note
The value of DelayTime cannot be set, unless the value of the AutomaticMinimum is set to False
beforehand.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
An IO System provides certain attributes that can be read and/or written. The attributes are only
available if they are available at the UI. Writing is generally only allowed if an attribute can also
be changed by the user at the UI. This might vary depending on the IO Controller and the IO
Devices which are assigned to this IO System.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
ioSystem.Delete();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a profinet io system:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A DP master system is created by calling the action CreateIoSystem(string nameOfIoSystem) on
an object of the type IoController. The io controller is aquired by accessing the attribute
IoControllers object on the NetworkInterface.
Prerequisites for creating a DP master system:
• The interface of the io controller is connected to a subnet.
• The io controller has no io system.
Program code
Modify the following program code to create a dp master system:
using System.Linq;
...
NetworkInterface interface = ...;
IoSystem dpMasterSystem = null;
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
NetworkPort provides the link ConnectedPorts which is an enumeration of ports to access all
interconnected partner ports of a port.
It is only possible to interconnect ports which can also be interconnected in the TIA UI, e.g. it is
not possible to interconnect two ports of the same Ethernet interface. Recoverable exception are
thrown
• if there is already an interconnection to the same partner port
• when trying to interconnect two ports which cannot be interconnected
• when trying to create a second interconnection to a port which does not support alternative
partners
Value Description
MediumAttachmentType.None Attachment type cannot be determined.
MediumAttachmentType.Copper Attachment type is copper.
MediumAttachmentType.FiberOptic Attachment type is fiber optic.
Value Description
CableName.None No cable name is specified
CableName.FO_Standard_Cable_9 FO standard cable GP (9 µm)
CableName.Flexible_FO_Cable_9 Flexible FO cable (9 µm)
CableName.FO_Standard_Cable_GP_50 FO standard cable GP (50 µm)
CableName.FO_Trailing_Cable_GP FO trailing cable / GP
CableName.FO_Ground_Cable FO ground cable
CableName.FO_Standard_Cable_62_5 FO standard cable (62.5 µm)
CableName.Flexible_FO_Cable_62_5 Flexible FO cable (62.5 µm)
CableName.POF_Standard_Cable_GP POF standard cable GP
CableName.POF_Trailing_Cable POF trailing cable
CableName.PCF_Standard_Cable_GP PCF trailing cable / GP
CableName.GI_POF_Standard_Cable GI-POF standard cable
CableName.GI_POF_Trailing_Cable GI-POF trailing cable
CableName.GI_PCF_Standard_Cable GI-PCF standard cable
CableName.GI_PCF_Trailing_Cable GI-PCF trailing cable
CableName.GI_POF_Standard_Cable GI-POF standard cable
CableName.GI_POF_Trailing_Cable GI-POF trailing cable
Value Description
CableName.GI_PCF_Standard_Cable GI-PCF standard cable
CableName.GI_PCF_Trailing_Cable GI-PCF trailing cable
Value Description
SignalDelaySelection.None -
SignalDelaySelection.CableLength CableLength is used to define the signal delay.
SignalDelaySelection.SignalDelayTime SignalDelayTime is used to define the signal delay
Value Description
CableLength.None CableLength is not specified.
CableLength.Length20m Cable length is 20m.
CableLength.Length50m Cable length is 50m.
CableLength.Length100m Cable length is 100m.
CableLength.Length1000m Cable length is 1000m.
CableLength.Length3000m Cable length is 3000m.
Value Description
TransmissionRateAndDuplex.None -
TransmissionRateAndDuplex.Automatic Automatic
TransmissionRateAndDuplex.AUI10Mbps 10 Mbps AUI
TransmissionRateAndDuplex.TP10MbpsHalfDu‐ TP 10 Mbps half duplex
plex
TransmissionRateAndDuplex.TP10MbpsFullDuplex TP 10 Mbps full duplex
TransmissionRateAndDuplex.AsyncFib‐ async fiber 10Mbit/s half duplex mode
er10MbpsHalfDuplex
TransmissionRateAndDuplex.AsyncFib‐ async fiber 10Mbit/s full duplex mode
er10MbpsFullDuplex
TransmissionRateAndDuplex.TP100MbpsHalfDu‐ TP 100 Mbps half duplex
plex
TransmissionRateAndDuplex.TP100MbpsFullDu‐ TP 100 Mbps full duplex
plex
TransmissionRateAndDuplex.FO100MbpsFullDu‐ FO 100 Mbps full duplex
plex
TransmissionRateAndDuplex.X1000MbpsFullDu‐ X1000 Mbps full Duplex
plex
TransmissionRateAndDuplex.FO1000MbpsFullDu‐ FO 1000 Mbps full duplex LD
plexLD
TransmissionRateAndDuplex.FO1000MbpsFullDu‐ FO 1000 Mbps full Duplex
plex
TransmissionRateAndDuplex.TP1000MbpsFullDu‐ TP 1000 Mbps full duplex
plex
TransmissionRateAndDuplex.FO10000MbpsFull‐ FO 10000 Mbps full Duplex
Duplex
TransmissionRateAndDuplex.FO100MbpsFullDu‐ FO 100 Mbps full duplex LD
plexLD
TransmissionRateAndDuplex.POFPCF100MbpsFull‐ POF/PCF 100 Mbps full duplex
DuplexLD
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
SeeConnecting to the TIA Portal (Page 81)
• A profect is open.
See Opening a project (Page 113)
Application
If a device item is a port, it provides additional functionality over a simple device item.
• It is possible to access the linked partner ports of the port
• It is possible to access the interface of the port
To access this additional functionality, the NetworkPort feature, a specific service of the device
item, must be used.
Attributes of a port
A port has the following attributes:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Enumeration of IoSystem provides all DP mastersystems that are present on a subnet. The class
IoSystem represents the master systems and the io systems.
Program code
Modify the following program code to enumerate DP master systems from subnet:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The class IoSystem represents the master systems and the io systems.
It is used for:
• Enumeration of io connectors of a dp mastersystem
• Enumeration of io connectors of a profinet io system
Program code
Modify the following program code to enumerate assigned io connectors of the dp
mastersystem:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Use the action ConnectToIoSystem(IoSystem ioSystem) of IoConnector to connect an
IoConnector to an existing DP mastersystem.
Use the action GetIoController to navigate to the remote IoController. For further information
how to navigate to the local IoConnector and the io system see Get master system or IO system
of an interface (Page 231).
Prerequisites:
• The IoConnector is not yet connected to an io system.
• The IoConnector interface is connected to the same subnet as the interface of the desired
IoController.
Program code
Modify the following program code:
5.7.32 Accessing AS-i profile and parameter attributes for virtual slaves
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
The TIA Portal Openness supports the following additional AS-i profile parameters for the Virtual
Slaves of the CTT5 AS-i Slave using the StructuredData names:
Name Description
AsiProfileVirtualSlave1 This contains the AS-i profile parameters for the
Virtual Slave 1
AsiProfileVirtualSlave2 This contains the AS-i profile parameters for the
Virtual Slave2
AsiProfileVirtualSlave3 This contains the AS-i profile parameters for the
Virtual Slave 3
The AS-i slave parameters for the Virtual slaves can be found below:
Name Description
AsiParameterVirtualSlave1 This contains the AS-i parameter for the Virtual
Slave 1
AsiParameterVirtualSlave2 This contains the AS-i parameter for the Virtual
Slave 2
AsiParameterVirtualSlave3 This contains the AS-i parameter for the Virtual
Slave 3
Program code
Modify the following program code to get and set the additional attributes of AS-i Slaves:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to configure an ET200SP PLC as DP slave if a CM DP has been
plugged. It is also possible in TIA Portal Openness to create, configure and delete transfer areas
at the DP interface. The handling will be similar to the handling of transfer areas at PN interface
described in Openness transfer areas for PnPn coupler (Page 256)
The following dynamic attributes are supported at the device item DP interface.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Openness transfer areas for PnPn coupler (Page 256)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to perform the following operations:
• Given a 1516 PLC with one isochron capable module and it is possible to set the PLC into
isochronous mode
• Given the previous configuration where the module is assigned to OB61 and it is possible to
set the module into isochronous mode
• Given the previous config with an additional ET200SP assigned to the PLC and a module
configured in isochronous mode assigned to the same OB61 where the source of sendclock
can be set (PLC and decentral are coupled, Source of sendclock is set to PN X1).
Attributes
Modify the following program code to set isochoronous mode properties on PLC headmodule:
Modify the following program code to set isochoronous mode properties on I/O modules:
For Setting isochoronous mode properties on PLC headmodule, It is same as in case of S71500/
ET200MP station.
Modify the following program code to set isochoronous mode properties of central module
(X142):
Modify the following program code to set isochoronous mode properties of an integrated
telegram:
Modify the following program code to set isochoronous mode properties of PROFIdrive
integrated subnet:
General
You can use the TIA Portal Openness application to configure transfer areas and transfer area
mapping rules for the communication processors CP 1604/CP 1616 as of V2.8 (also as of V2.7
depending on the article number) and CP 1626 as of V1.1.
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See "Establishing a connection to the TIA Portal".
• A project is open.
See "Open project".
• To compile the project, all devices must be "offline".
TransferArea transferAreaInput =
transferAreas.Create("Input CD", TransferAreaType.CD);
Attribute Description
name Specifies the name of the transfer area to be created.
type Specifies the type of the transfer area to be created. The following types are possible:
TransferAreaType.CD Data exchange controller device
TransferAreaType.F_PS Data exchange PROFIsafe
TransferAreaType.TM Transfer module mapping
Note: It is not possible to change the type at a later date.
Some attributes must be set or queried, but all of them can be set or queried using the general
calls "GetAttribute()" or "SetAttribute()". Use the following program code, for example:
const string myIndividualComment = "MyIndividualComment";
transferAreaTm.SetAttribute("Comment", myIndividualComment);
Int32 updateTime = transferAreaTm.GetAttribute("TransferUpdateTime")
Attribute Description
Name (string) Specifies the name of the transfer area.
Direction Specifies the direction in which the data of the transfer area is transferred. The following
directions are possible:
TransferAreaDirection.LocalToPart‐ Data of the transfer area is transferred from the IO de‐
ner vice to the higher-level IO controller.
TransferAreaDirection.partnerToLo‐ Data of the transfer area is transferred from the higher-
cal level IO controller to the IO device.
TransferAreaDirection.bidirectional Data of the transfer area can be transferred in both
directions between the higher-level IO controller and
the IO device.
The "LocalToPartnerLength" attribute determines the
length of the transferred data from IO device to the
higher-level IO controller. The "PartnerToLocalLength"
attribute determines the amount of data from the high‐
er-level IO controller to the IO device
Comment (string) Text box for a comment on the transfer area.
LocalToPartnerLength Specifies the data length of the transfer area that is transferred from the IO device to the
higher-level IO controller.
PartnerToLocalLength Specifies the data length of the transfer area that is transferred from the higher-level IO
controller to the IO device.
Attribute Description
LocalAdresses Specifies the input and output addresses of the transfer area from the local device.
PartnerAdresses Specifies the input and output addresses of the transfer area in the higher-level IO controller.
TransferUpdateTime(Int32) Specifies the update time of the transfer area. Only set or queried for a transfer area of the type
"TransferAreaType.TM".
PositionNumber Specifies the number of the virtual submodule of this transfer area.
Type Specifies the type of transfer area, read-only.
TransferAreaMappingRules Specifies the routing table of the routing area, read-only.
Configuration of IO routing
Creating IO routes
To create IO routes, use the following program code:
// Create TransferAreaMappingRule
TransferAreaMappingRuleComposition routingTable
= transferArea.TransferAreaMappingRules;
Attribute Description
Offset Bit-based offset within the routing area to which the data is to be assigned. The length of the offset is
determined by the "Begin" and "End" attributes.
Target Specifies the module or submodule of the IO device that contains the data to be assigned to the configura‐
tion of the IO device, a transfer area of the type "TM".
IoType The “IoType” attribute can only be changed in a transfer area of the “Input” type. In addition, a mixed module
must be configured as “Target” for this transfer area. Only then can you select whether the data of the inputs
(IoType.Input) are to be read or whether the data of the outputs (IoType.Output) are to be read (back).
Begin Specifies the beginning of the data to be read by the "Target" attribute.
End Specifies the end of the data to be read by the "Target" attribute.
Deleting IO routes
To delete IO routes, use the following program code:
transferAreaMappingRule.Delete();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• To compile the project, all device must be "offline"
Introduction
You can use the TIA Portal Openness to add module/submodule, delete and search transfer areas
for PnPn coupler.
Note
It is not possible to create a submodule without Positionnumber.
For example, to create module on PositionNumber and submodule at the next free
submodulepositionnumber at positionNumber, use the following program code:
Attribute Description
Type Specifies the type of the transfer area to be created. The following types are possible:
TransferAreaType.None Default value
TransferAreaType.IN Transfer area Input
TransferAreaType.OUT Transfer area Output
TransferAreaType.MSI Transfer area Shared Input (MSI)
TransferAreaType.MSO Transfer area Shared Output (MSO)
TransferAreaType.MSO_LOCAL Transfer area Local Shared Output
(MSO_LOCAL)
TransferAreaType.RECORD_WRITE_STO Transfer area for Record Data Write up to
8 data records will be buffered
TransferAreaType.RECORD_WRITE_PUB Transfer area for Record Data Write over‐
writes previous data record
TransferAreaType.RECORD_READ_STO Transfer area for Record Data Read reads
the oldest data record in the buffer
TransferAreaType.RECORD_READ_PUB Transfer area for Record Data Read reads
data record written last
TransferAreaType.MSI_MSO Transfer area Shared Input (MSI) / Trans‐
fer area Shared Output (MSO)
TransferAreaType.IN_OUT Transfer area Input / Transfer area Output
TransferAreaType.LOCAL_RECORD_STO Transfer area for local data record cou‐
pling, up to 8 data records are buffered
TransferAreaType.LOCAL_RECORD_PUB Transfer area for local data record cou‐
pling, overwrites previous data record
TransferAreaType.SUB_MSI Transfer area copy of Shared Input (MSI)
TransferAreaType.SUB_MSO Transfer area copy of Shared Output
(MSO)
TransferAreaType.SUB_LOCAL_RE‐ Transfer area for Record Data Read for
CORD_STO_READ reading the oldest data record in the buf‐
fer
TransferAreaType.SUB_LOCAL_RE‐ Transfer area for Record Data Read for
CORD_PUB_READ reading the most recently written data
record
TransferAreaType.PROFI‐ Transfer area with 12 byte input and 6
SAFE_IN12_OUT6 byte output
TransferAreaType.PROFI‐ Transfer area with 6 byte input and 12
SAFE_IN6_OUT12 byte output
Some attributes must be set or queried, but all of them can be set or queried using the general
calls TransferArea.GetAttribute() or SetAttribute(). Use the following program code, for example
Attribute Description
Name (string) Specifies the name of the transfer area
Direction Specifies the direction in which the data of the transfer area is transferred. The following direc‐
tions are possible:
TransferAreaDirection.Lo‐ Data of the transfer area is transferred from the IO device to the
calTo‐ Partner higher-level IO controller.
TransferAreaDirection.part‐ Data of the transfer area is transferred from the higherlevel IO
nerTo‐ Local controller to the IO device.
TransferAreaDirection.bidir‐ Data of the transfer area can be transferred in both directions
ectional between the higher-level IO controller and the IO device. The "Lo‐
calToPartnerLength" attribute determines the length of the trans‐
ferred data from IO device to the higher-level IO controller. The
"PartnerToLocal‐ Length" attribute determines the amount of data
from the higher-level IO controller to the IO device
Comment (string) Text box for a comment on the transfer area
LocalToPartnerLength Specifies the input data length of the transfer area
PartnerToLocalLength Specifies the output data length of the transfer area
PositionNumber Specifies the slot number of the transfer area
ExtendedPositionNumber Specifies the sub slot number of the transfer area
Type Specifies the type of transfer area
SharedDeviceAccessConfig‐ Controls the access to PLC
ured
UpdateAlarm Enable the update alarm of the transfer area
RecordIndex Set the data record number that you will be using when writing the data record
Note
ExtendedPositionNumber is only needed for TransferAreas with more than one Submodule like
MSI
To get the first TransferArea with this positionNumber, use the following program code:
Note
If one of this attributes is not available, you will encounter an exception.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to add and delete virtual modules/submodule for ET 200 SP
PN HF.
VIM1.SetAttribute("AddSubModules", (Int64)1);
VIM2.SetAttribute("AddSubModules", (Int64)2);
Note
To add a submodule, you have to set the module property "AddSubModules" to count of added
submodules. If you try to add more submodulesthan allowed, there is an exception.
SubModule3.Delete();
Note
You cannot delete the first two submodules.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to access the complete domain management. The
following two new services are added to the Subnet class for accessing domain management via
TIA Portal Openness:
• service MrpDomainOwner
• service SyncDomainOwner
Subnet subnet = …;
MrpDomainOwner mrpDomainOwner = subnet.GetService<MrpDomainOwner>();
MrpDomainComposition mrpDomainComposition = mrpDomainOwner.MrpDomains;
Modify the following program code to create a new domain with a name newMrpDomain;
Modify the following program code to read/write attributes value of a MRP domain objects:
NetworkInterface toBeAdded = …;
newMrpDomain.SetAttribute("IsDefault", true);
newMrpDomain.SetAttribute("ManagerOutsideOfProjectActive", false);
var participants = firstMrpDomain.DomainParticipants;
int count = participants.Count;
participants.Add(toBeAdded);
foreach (NetworkInterface networkIf in participants)
{
// do something at the interface
}
newMrpDomain.Delete();
Subnet subnet = …;
SyncDomainOwner syncDomainOwner = subnet.GetService<SyncDomainOwner>();
SyncDomainComposition syncDomainComposition = syncDomainOwner.SyncDomains;
Modify the following program code to create a new SyncDomain with specific name:
Modify the following program code to read/write the attribute value of Sync Domain:
NetworkInterface toBeAdded = …;
string convertedName = newSyncDomain.ConvertedName;
newSyncDomain.SetAttribute("IsDefault", true);
newSyncDomain.SetAttribute("HighPerformanceActive", true);
newSyncDomain.SetAttribute("FastForwardingActive", true);
var participants = firstSyncDomain.DomainParticipants;
int count = participants.Count;
participants.Add(toBeAdded);
foreach (NetworkInterface networkIf in participants)
{
// do something at the interface
}
newSyncDomain.Delete();
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Every device or device item provides certain mandatory attributes which can be read and/or
written. These attributes are always the same as in the TIA Portal user interface.
The following attributes are supported in Openness:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The attribute TypeIdentifier is used to identify a hardware object that is creatable via TIA
Portal Openness API. The TypeIdentifier is a string consisting of several
parts: <TypeIdentifierType>:<Identifier>
Possible values for TypeIdentifierType are:
• OrderNumber
• GSD
• System
OrderNumber
OrderNumber is the common TypeIdentifier for all modules present in the hardware
catalog.
Note
There are a few modules in the hardware catalog which use "wildcard" characters in the order
number to represent a certain cluster of real hardware, e.g. the different lengths of S7-300 racks.
In this case the specific OrderNumber and the "wildcard"-OrderNumber can both be used to
create an instance of the hardware object. However you cannot generically use wildcards at any
position.
GSD
This is the identifier used for modules that are added to the TIA Portal via GSD or GSDML.
System
This is the identifier for objects, which cannot be determined using OrderNumber or GSD.
Program code
Modify the following program code to get the type identifier for user manageable and separately
creatable objects for GSD:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal
• A project is open
See Opening a Project
Introduction
You can use the TIA Portal Openness to set the Application ID on device and device items of TIA
Portal project, so that these Application IDs are retained in the current session of TIA Portal for
later use.
You can use the TIA Portal Openness to set the Application ID by providing "Application Key" and
"Application Value" pair to the API.
The following constraints applicable for the Application ID of device and device item object:
• An object of type supporting this feature can have maximum of 64 Application IDs available
for it
• The Application IDs Key or/and Value length can be maximum 128 Characters in length.
• The Application ID Key for a given object is unique
• Only one Application ID can be set using one "Application Key"
• When different Application Value is set with the same "Application Key", the last set
Application Value is retained
Program code
Modify the following program code to set the Application ID for device and device item object:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Introduction
You can use the TIA Portal Openness to get the Application ID on device and device items of TIA
Portal project, if the device or device items is already set with an Application ID.
Application IDs are stored as "Application Key" and "Application Value" pair as part of TIA Portal.
You can use the TIA Portal Openness to get the Application ID value by providing "Application
Key".
Program code
Modify the following program code to get the Application ID value for an object, which was
already set using the Application Key:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Principle
You can use the TIA Portal Openness to remove Application ID (Custom Identity) for a device and
device items of TIA Portal project, so that device and device item objects are updated with
relevant Application ID.
A CustomIdentityNotFoundException will be thrown, if the Application ID which is passed as an
argument does not exist.
Program code
Modify the following program code to remove the Application ID for device and device items:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A device can be created via two methods, within a project or a device group:
• Create a device via a device item type identifier like in TIA hardware catalog
Device CreateWithItem(DeviceItemTypeId, DeviceItemName,
DeviceName)
• Create only the device
Device Create(DeviceTypeId, DeviceName)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Note
Observe the Hierarchy of hardware objects of the object model (Page 65).
Modify the following program code to find a specific device via "Find" method:
//Enumerate all devices which are located directly under a project that contains no device
groups
Project project = ...
foreach (Device device in project.Devices)
{
... // Work with the devices
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Every GSD or GSDML based IO device has attributes. Some of them are used to identify the
specific type of the device.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a device:
// delete device
deviceToDelete.Delete();
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Every device or device item provides certain mandatory attributes which can be read and/or
written. These attributes are always the same as in the TIA Portal user interface.
The following attributes are supported in TIA Portal Openness:
Value Description
Siemens.Engineering.HW.DeviceItem‐ No classification.
Classifications.None
Siemens.Engineering.HW.DeviceItem‐ The device item is a CPU
Classifications.CPU
Siemens.Engineering.HW.DeviceItem‐ The device item is a head module.
Classifications.HM
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The action PlugNew(string typeIdentifier, string name, int
positionNumber) of HardwareObject is used to
• create a new device item and plug it into an existing hardware object
• create a new sub device item, e.g. a submodule, and plug it into a device item
If the action was succseful it returns the created device item object, otherwise a recoverable
exception will be thrown.
By using the action CanPlugNew(string typeIdentifier, string name, int
positionNumber) you can determine if creating and plugging is possible. If executing is not
possible the action returns false.
If the method returns true, the action might still fail for the following unforeseen reasons.
• a position number is already taken by another device item
• the current device item cannot be plugged at the position although it is free
• the container does not provide the position number
• the name of the device item is already taken by an existing device item in the same container
• the device item cannot be plugged into the container
• the device is online
Program code
Modify the following program code to plug a device item into an exisitng hardware object:
NOTICE
This method works only for the modules visible in the network view.
This method works only for modules, and not for sub-modules.
• In case no "label" exists for a certain position number, the string representation of the
position number is used.
• PlugLocation objects are provided only for free slots.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The action PlugMove(DeviceItem deviceItem, int positionNumber) of HardwareObject is used to
move an existing device item and plug it to an existing hardware object. The method PlugMove
inserts the device items where the module was unable to plug in the UI. In these cases, there
PlugMove action completes with complie errors.
The action CanPlugMove(DeviceItem deviceItem, int positionNumber) is used to determine
possiblity of movement. If the movement is not possible, CanPlugMove returns false. If the
method returns true, the action might still fail for the following unforeseen reasons.
• a position number is already taken by another device item
• the current device item cannot be plugged at the position although it is free
• the container does not provide the position number
• the name of the device item is already taken by an existing device item in the same container
• the device item cannot be plugged into the container
• the device item cannot be plugged by the user
• the device item cannot be removed by the user
• the device is online
Program code
Modify the following program code:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Use the action PlugCopy(DeviceItem deviceItem, int positionNumber) of HardwareObject to
copy a device within a project and to plug it into an existing hardware. In rare cases the method
PlugCopy might work where it is not possible to plug a module in the UI. In this case compile
errors will occur after the copy. When PlugCopy was successful it returns the copy of the device
item object, otherwise a recoverable exception is thrown.
Possible reasons for a failed action:
• a position number is already used by another device item
• the current device item cannot be plugged at the position although it is free
• the container does not provide the position number
• the name of the device item is already used by an existing device item in the same container
• the device item cannot be plugged into the container
• the device item cannot be plugged in the UI
• ...
Use the action CanPlugCopy(DeviceItem deviceItem, int positionNumber) is it possible to
determine if copying should be possible. When it is not possible to execute the copy action
CanPlugCopy returns false. However if the method returns true the action might still fail for
unforeseen reasons.
Program code
Modify the following program code:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a device item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
To get to a device item use the HardwareObject. The items of a hardware objects are, what the
user of the TIA Portal sees as being plugged into the hardware object:
• a rack which resides in a device
• a module which resides in a rack
• a sub module which resides in a module
• a sub module which resides in a sub module
Note
You can find more detailed information on this topic in the section Hierarchy of hardware objects
of the object model (Page 65).
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
int dsNumber = 0; // For Profibus GSDs, dataset number zero must be used!
int byteOffset = 0;
int lengthInBytes = 5;
// The parameters byteOffset and the length of the byte array prmData define the range
within the
// dataset which is written to.
// For Profibus GSDs, dataset number zero must be used!
int dsNumber = 0;
int byteOffset = 0;
byte[] prmData = {0x05, 0x21, 0x01, 0x01, 0x01};
See also
Hierarchy of hardware objects of the object model (Page 65)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
If a device item is an interface, it provides additional functionalities over a simple device item.
Using this interface, the user can access the nodes and operation mode of the interface. Due to
this functionality, the device item can used as IoDevice (Slave) or IoController (Master) by
accessing the NetworkInterface feature (a specific Service of the device item).
The properities of the interface is accessed using enum InterfaceOperatingModes.
Value Description
InterfaceOperatingModes.None Default
InterfaceOperatingModes.IoDevice Interface operation mode "IoDevice" (Slave).
InterfaceOperatingModes.IoController Interface operation mode "IoController" (Master).
InterfaceOperatingModes.IoDevice Interface operation made both of the above.
or
InterfaceOperatingModes.IoController
NetworkInterface itf =
((IEngineeringServiceProvider)deviceItem).GetService<NetworkInterface>();
if (itf != null)
{
... // work with the interface
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• For writing access, the PLC is offline.
Application
You can use the TIA Portal Openness API interface to get or set attributes for IRT ans isochronous
mode on the I/O device interface.
Value Description
IsochronousTiToCalculationMode.None -
IsochronousTiToCalculationMode.FromOB Ti/To values of the OB (configured at the IoSystem) are used.
IsochronousTiToCalculationMode.FromSubnet This value is not used by PROFINET interfaces.
IsochronousTiToCalculationMode.AutomaticMini Ti/To values are calculated automatically for the IO Device.
mum
IsochronousTiToCalculationMode.Manual The user can enter Ti/To values for this IO Device manually.
Modify the following program code to access the Ti/To values of OB:
Modify the following program code to access the isochronous setting of an I/O device interface:
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• For writing access, the PLC is offline.
Application
You can use the TIA Portal Openness API interface to get or set attributes for IoController. The
following attributes are only available at PROFINET IoController (located below a Profinet
interface). If the user can modify an attribute in UI, then the user can set the corresponding
attribute through TIA Portal Openness.
The Synchronication role property is available in PROFINET interface of the TIA Portal UI. The
Enum SyncRole has the following values.
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• For writing access, the PLC is offline.
Application
You can use the TIA Portal Openness API interface to get or set attributes for IoConnector. The
following attributes are only available at PROFINET IoController (located below a Profinet
interface). If the user can modify an attribute in UI, then the user can set the corresponding
attribute through TIA Portal Oopenness.
There are four types of attributes such as update time attributes, watchdog time attributues,
synchronization attributes and , device number attributes.
Synchronization attributes
The synchronization attributes are given below.
connector.SetAttribute("PnUpdateTimeAutoCalculation", true);
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
If a device item is an address controller, it provides additional functionality. To access the
registered addresses of the address controller the role AddressController is used.
AddressController addressController =
((IEngineeringServiceProvider)deviceItem).GetService<AddressController>();
if (addressController != null)
{
... // work with the address controller
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Address objects are aquired via the composition link Addresses of a device item. The
attribute Addresses returns a collection of type AddressComposition which can be
enumerated.
Attributes
An address supports the following attributes:
Value Description
AddressIoType.Diagnosis The type of the address io is Diagnosis.
AddressIoType.Input The type of the address io is Input.
AddressIoType.Output The type of the address io is Output.
AddressIoType.Substitute The type of the address io is Substitute.
AddressIoType.None The type of the address io is mot specified.
Value Description
AddressContext.None The address context is not applicable.
AddressContext.Device A device address context.
AddressContext.Head A head address context.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Hardware identifier objects are acquired from the following objects:
• Device
• DeviceItem
• IoSystem
The hardware identifier is represented by the class HwIdentifier and is accessed via the
attribute HwIdentifiers.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
If a device item is an hardware identifier controller, it is possible to access the registered
hardware identifiers. To access these HwIdentifierController, a specific service of the device item,
is used.
HwIdentifierController hwIdentifierController =
((IEngineeringServiceProvider)deviceItem).GetService<HwIdentifierController>();
if (hwIdentifierController != null)
{
... // work with the hardware identifier controller
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A channel is represented by the Channel class. Channels are aquired from a device item via the
attribute Channels of the DeviceItem class. The attribute Channels returns an implementation of
ChannelComposition which can be enumerated. If the device items has no channels, the
attribute Channels returns an empty collection.
Mandatory attributes
A channel supports the following mandatory attributes:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• Opening a Project
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness API to create .psc file and download a device into it. In order
to create a.psc file and download a device configuration into it, you can use Export method from
a service CardReaderPscProvider. The service exists in namespace
Siemens.Engineering.HW.Utilities.
Program code
Modify the following program code to create and export a .psc file.
// preconditions
Device ipcDevice = myProject.Devices.Find("IPC427D");
FileInfo exportFile = new FileInfo(@"C:\Users\Ertan\Documents\Automation\PC system
configuration74.psc");
// get the card reader provider from hardware utilities
HardwareUtilityComposition utilities = myProject.HwUtilities;
HardwareUtility utility = utilities.Find("CardReaderPscProvider");
CardReaderPscProvider crp = (CardReaderPscProvider)utility;
// do the export
crp.Export(ipcDevice, exportFile);
Creating and openning a .psc file with separate commands are not supported. In case you give
already existing .psc file as a parameter, the file will not be overwritten and exception will be
thrown. If it is not an existing file, then this .psc file will be created and finally the download will
be made.
You have to make sure that the project can be compiled without problems. Otherwise, exception
will be thrown.
Note
Because of safety reasons, Export operation is not supported for f-activated devices (an
exception will be thrown during export) in V15.1
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to fetch, add, and remove extension rack connections so
that you can make use of TIA Portal Openness to implement extension rack connection support
during CAx export/import.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.10.1 Screens
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to create a user-defined screen folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Note
You cannot delete a permanent area. A permanent area is a system screen that is always present.
Program code
Modify the following program code to delete a screen from a specific folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Program code
Modify the following program code to delete a screen template from a specific folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Note
You cannot delete a permanent area. A permanent area is a system screen that is always present.
Program code
Modify the following program code to delete all screens from a specific folder:
5.10.2 Cycles
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Application
You cannot delete standard cycles.
You can identify whether cycles have actually been deleted based on the composition in the
object model (composition count) of the respective cycle. It is no longer possible to access these
cycles.
Program code
Modify the following program code to delete a cycle from an HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Program code
Modify the following program code to delete a selected text list and all associated list entries
from an HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Program code
Modify the following program code to delete a selected graphic list and all associated list entries
from an HMI device:
5.10.5 Connections
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Program code
Modify the following program code to delete a selected communication connection from an HMI
device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to create a user-defined folder for HMI tags:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to enumerate all tags of an HMI tag table:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a specific tag from an HMI tag table:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Application
You cannot delete the default tag table
Program code
Modify the following program code:
5.10.7 VB scripts
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to create a user-defined script subfolder below a system
folder or another user-defined folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains an HMI device.
Program code
Modify the following program code to delete a VB script from a specific folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete an user-defined folder of an HMI device:
5.11 Functions for accessing the data of an HMI Unified device (RT
Unified)
Introduction
The following tables show the available objects and indicate whether these objects are
supported by TIA Portal Openness.
Objects
You can control the following project data for WinCC Unified device:
Introduction
In ES TIA Portal Openness, appropriate changes are made in property names and data types, so
that it is similar to runtime Openness model.
To achieve it, changes are made in all subsystems for example Alarm, Tag, Connection, and
Logging.
To have consistency in naming the property and its data type, it is necessary that prefix Hmi is
used for defining their type and name of property should not have this prefix.
Hmi Object Name Property Name Property New Name Property Data type Property New Data
Type
Analog Alarm AnalogAlarms - AnalogAlarmComposi‐ HmiAnalogAlarmCom‐
tion position
Discrete Alarm DiscreteAlarms - DiscreteAlarmCompo‐ HmiDiscreteAlarm‐
sition Composition
OPC UA Alarm & Condi‐ OpcUaAlarmTypes - OpcUaAlarmTypeCom‐ HmiOpcUaAlarmType‐
tion types position Composition
Alarm Class AlarmClasses - AlarmClassComposi‐ HmiAlarmClassCompo‐
tion sition
Tag Table HmiTagTables TagTables HmiTagTableComposi‐ -
tion
Tag HmiTags Tags HmiTagComposition -
System Tag HmiSystemTags SystemTags HmiSystemTagCompo‐ -
sition
Logging Tag LoggingTags - LoggingTagComposi‐ HmiLoggingTagCom‐
tion position
Connection HmiConnections Connections HmiConnectionCom‐ -
position
Data Log DataLogs - DataLogComposition HmiDataLogComposi‐
tion
Alarm Log AlarmLogs - AlarmLogComposition HmiAlarmLogComposi‐
tion
Plant Object Interface PlantObjectTags - PlantObjectInterface‐ -
Composition
Screen Screens - HmiScreenComposi‐ -
tion
Note
With dash (-) character in columns 'New Name' and 'New Data Type' in above table shows no
change is required.
Note
With dash (-) character in columns 'New Class Name' in above table shows no change is required.
Introduction
You require an HMI Software object to have access to other elements like tags, connections,
alarms and screens.
Requirements
• The TIA Portal Openness application is connected to the TIA Portal
Connecting to the TIA Portal (Page 81)
• A project is open
Opening a project (Page 113)
Program code
Modify the following program code to access HMI Software object:
Note
In the above program code, the extension .apx refers to the installed version of TIA Portal.
Introduction
You can use TIA Portal Openness to get error information about properties for the following
WinCC objects:
• Analog Alarm
• Discrete Alarm
• Alarm Class
• Data Log
• Alarm Log
• Tag
• Connection
• Logging Tag
• Device runtime settings
• OPC UA Alarms
Note
This feature is not applicable to System Tag and Tag Table as they don’t have any property which
can be in error state.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Unified Software object
See HMI Unified Software object (Page 320)
Program code
Modify the following program code to query errors for tag, alarms, runtime setting and screens:
//For Tag
HmiSoftware hmiSoftware = GetHmiSoftware();
HmiTagComposition hmiTags = hmiSoftware.HmiTags;
HmiTag hmiTag = hmiTags.Find("Tag-l");
if(hmiTag != null)
{
//validate method usage
IList<HmiValidationResult> validationResult = hmiTag.Validate();
if (validationResult = null && validationResult.Count > 0)
{
foreach (HmiValidationResult propertyErrors in validationResult)
{
//browse error for different property
string propertyName = propertyErrors. PropertyName;
foreach (string propertyError in propertyErrors.Errors)
{
//work with propertyerrors
}
}
}
}
//For Discrete Alarm
HmiSoftware hmiSoftware = ...;
HmiDiscreteAlarmComposition discreteAlarms = hmiSoftware.DiscreteAlarms;
HmiDiscreteAlarm alarm = discreteAlarms.Find("Alarm_1");
if (alarm != null)
{
//Validate Method Usage
Ilist<HmiValidationResult> validationResult = alarm.Validate();
if (validationResult != null && validationResult.Count > 0)
{
foreach (HmiValidationResult propertyErrors in validationResult)
{
//browse error for different property
string propertyName = propertyErrors.PropertyName;
foreach (string propertyError in propertyErrors.Errors)
{
//work with property errors
}
}
}
}
//For Runtime Setting
HmiSoftware hmiSoftware = ...;
HmiRuntimeSetting runtimeSettings = hmiSoftware.RuntimeSettings;
//Validate Method Usage
Ilist<HmiValidationResult> validationResult = runtimeSettings.Validate();
if (validationResult != null && validationResult.Count > 0)
{
foreach (HmiValidationResult propertyErrors in validationResult)
{
//browse error for different property
string propertyName = propertyErrors.PropertyName;
foreach (string propertyError in propertyErrors.Errors)
{
See also
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with analog alarms while using TIA Portal Openness:
• Creating analog alarms
• Enumerating analog alarms
• Deleting analog alarms
• Accessing analog alarm properties
Properties
The following properties are supported in analog alarm:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to the HMI Software object.
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with alarms.
Introduction
You can perform the following tasks with discrete alarms while using TIA Portal Openness:
• Creating discrete alarms
• Deleting discrete alarms
• Enumerating discrete alarms
• Accessing discrete alarm properties
Properties
The following properties are supported in discrete alarms:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Software object.
See HMI Unified Software object (Page 320).
Program code
You can modify and use the following program code examples while working with alarms.
int id = discreteAlarm.Id;
discreteAlarm.Id = 10;
discreteAlarm.area = "Aread1";
string area = discreteAlarm.Area;
discreteAlarm.Name = "NewAlarm";
string name = discreteAlarm.Name;
Introduction
You can perform the following tasks with alarm classes while using TIA Portal Openness:
• Creating alarm class
• Deleting alarm classes
• Enumerating alarm classes
• Accessing properties of alarm class
Properties
The following properties are supported in alarm class:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with alarm classes.
//User wants to enumerate all discrete alarms of device with following code
{
HmiSoftware hmiSoftware = ...:
AlarmClassComposition alarmClasses = hmiSoftware.AlarmClasses;
foreach (AlarmClass alarmClass in alarmClasses)
}
{
...
}
Introduction
You can perform the following tasks with data logs while using TIA Portal Openness:
• Create data log
• Delete data log
Properties
The following properties are supported in data log:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with data logs.
Introduction
You can perform the following tasks with alarm logs while using TIA Portal Openness:
• Create alarm log
• Delete alarm log
• Enumerate alarm log
• Access properties of alarm log
Properties
The following properties are supported in alarm log:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with alarm logs.
Creating alarm logs
Modify the following program code to create an alarm log:
See also
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with logging tags while using TIA Portal Openness:
• Create logging tag
• Delete logging tag
• Enumerate logging tag
• Access properties of logging tags
Properties
The following properties are supported in logging tag:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with logging tags.
Creating logging tags
You can modify and use the following program code to create a logging tag:
See also
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of audit trail.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
See also
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with tag tables while using TIA Portal Openness:
• Create tag tables
• Delete tag tables
• Enumerate tag tables
• Access tag table properties
Properties
The following properties are supported in tag table:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
Program code
You can modify and use the following program code examples while working with tag tables.
Creating tag tables
Modify the following program code to create a tag table:
Introduction
You can perform the following tasks with HMI tags while using TIA Portal Openness:
• Create HMI tags
• Delete HMI tags
• Enumerate HMI tags
• Access a HMI tag
• Access HMI tag properties
• Usage of UDT datatype for tags
• Properties of member tags of UDT
Properties
The following properties are supported in HMI tag:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to the HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with HMI tag.
Creating HMI tags
Modify the following program code to create a HMI tag:
Modify the following program code to access a HMI tag by table name:
{
HmiSoftware hmiSoftware = GetHmiSoftware();
// User can search tag present in given tag table with following code.
HmiTag hmiTag4 = hmiSoftware.HmiTagTables.Find("Default tag
table").HmiTags.Find("Tag1");
}
Modify the following ptogram code to assign UDT datatype to HMI tag with connection:
Note
You can use full paths to assign Hmi UDT as data type
Modify the following program code to assign PLC UDT to HMI tag with connection:
Modify the following program code to access datatype member properties for HMI tag:
Modify the following program code to set properties of member tags of user defined datatype:
Modify the following program code to get access properties of member tags of user defined
datatype:
See also
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with system tags while using TIA Portal Openness:
• Access a system tag
• Access system tag properties
Properties
The following properties are supported in System tag:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• Access to the HMI Software object
See HMI Unified Software object (Page 320)
Program code
Accessing a system tag
Modify the following program code to access single system tag by name:
See also
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with connections while using TIA Portal Openness:
• Create connections
• Delete connections
• Enumerate connections
• Access connection properties
Properties
The following properties are supported in HMI Connections:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
Connecting to the TIA Portal (Page 81)
• A project is open.
Opening a project (Page 113)
Program code
You can modify and use the following program code examples while working with connections.
Creating connections
Modify the following program code to create a connection:
Deleting connections
Modify the following program code to delete a connection:
Enumerating connections
Introduction
You can perform the following tasks with runtime settings while using TIA Portal Openness:
• Read/write runtime settings
Properties
The following properties are supported in Runtime Settings:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
Connecting to the TIA Portal (Page 81)
• A project is open.
Opening a project (Page 113)
• Access to the HMI Software object.
HMI Unified Software object (Page 320)
Program code
Introduction
You can perform the following tasks with screens while using TIA Portal Openness:
• Creating screens
• Deleting screens
• Enumerating screens
• Accessing screen properties
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to the HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code example while working with screens.
Creating screens
Modify the following program code to create screens:
Recoverable Exception will be raised if the Create method is called with Screen Name with which
Screen already exists in TIA Portal.
Deleting screens
Modify the following program code to delete screens:
Enumerating screens
Modify the following program code to enumerate all screens of device:
Modify the following program code to searching screen from screens list on the basis of name:
Modify the following program code to get screen from screens list on basis of index:
Modify the following program code to checking a particular screen item exist in screen item list
by using Contains method:
Modify and use the following program code to get all properties of screen using GetAttributes
( ):
Modify the following program code to set all properties of screen using SetAttributes( ):
Modify and use the following program code to get the value from property using
IEngineeringObject's GetAttribute:
Modify the following program code to determine if all properties have valid values:
Note
If during set of properties the set operation is not able to set the value then a Recoverable
exception would be raised.
Introduction
You can perform the following tasks with basic screen items while using TIA Portal Openness:
• Creating screen items (Basic)
• Deleting screen items (Basic)
• Enumerating screen items (Basic)
The following basic screen items are supported by the TIA Portal Openness:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 81)
Program code
You can modify and use the following program code example while working with basic screen
items.
Note
The above example can be used to create line screen item. To create other basic screen items,
you will have to replace line screen item with screen item related class in above code example.
Recoverable Exception will be raised if the Create method is called with Screen item Name with
which Screen item already exists in TIA.
Note
The above example can be used to delete line screen item. To delete other basic screen items,
you will have to replace the line screen item with screen item related class in above code
example.
Modify the following program code to find Screen item from Screen items list on the basis of
name:
Modify the following program code to get Screen item from Screenitems list on basis of index:
Modify the following program code to check a particular screen item exist in Screen item list by
using Contains method:
Note
The above example can be used to enumerate line screen item. To enumerate other basic screen
item, you will have to replace line screen item with screen item related class in above code
example.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of line screen item.
The following line properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following code to access basic properties of Line:
//Name
var name = hmiline.Name;
hmiline.Name = "Default Value";
//AlternateLineColor
var linecolor = hmiline.AlternateLineColor;
hmiline.AlternateLineColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//Height
var height = hmiline.Height;
hmiline.Height = 100;
//ToolTipText
var tooltip = hmiline.ToolTipText;
var tooltiptext = hmiline.ToolTipText.Items[0].Text;
hmiline.ToolTipText.Items[0].Text = "<body><p>TestforMultilinugualProperty</p></body>";
//DashType
var dashtype = hmiline.DashType;
hmiline.DashType = HmiDashType.DashDotDot;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Working with basic screen items (Page 368)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of polyline.
The following polyline properties are supported in basic screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic properties of Polyline:
//Name
var name = polyline.Name;
polyline.Name = "Default Value";
//AlternateLineColor
var linecolor = polyline.AlternateLineColor;
polyline.AlternateLineColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//Height
var height = polyline.Height;
polyline.Height = 100;
//ToolTipText
var tooltip = polyline.ToolTipText;
var tooltiptext = polyline.ToolTipText.Items[0].Text;
polyline.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//Joint Type
var dashtype = polyline.JoinType;
polyline.JoinType = HmiLineJoinType.Miter;
//Points
var points = polyline.Points;
var point = points[0];
var x = point.X;
point.X = 10;
var y = point.Y;
point.Y = 10;
var newPoint = points.Create(15, 100);
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get and set properties of polygon.
The following polygon properties are supported in basic screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic properties of Polygon:
//Name
var name = polygon.Name;
polygon.Name = "Default Value";
//AlternateBorderColor
var linecolor = polygon.AlternateBorderColor;
polygon.AlternateBorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//Height
var height = polygon.Height;
polygon.Height = 100;
//ToolTipText
var tooltip = polygon.ToolTipText;
var tooltiptext = polygon.ToolTipText.Items[0].Text;
polygon.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//BackFillPattern
var backfill = polygon.BackFillPattern;
polygon.BackFillPattern = HmiFillPattern.GradientBackwardDiagnol;
//Points
var points = polygon.Points;
var point = points[0];
var x = point.X;
point.X = 10;
var y = point.Y;
point.Y = 10;
var newPoint = points.Create(15, 100);
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get/set properties of ellipse screen item.
The following ellipse properties are supported in basic screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• Opening a Project
See Opening a Project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic properties of Ellipse:
//Name
var name = ellipse.Name;
ellipse.Name = "Default Value";
//AlternateBorderColor
var bordercolor = ellipse.AlternateBorderColor;
ellipse.AlternateBorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = ellipse.BorderWidth;
ellipse.BorderWidth = 10;
//ToolTipText
var tooltip = ellipse.ToolTipText;
var tooltiptext = ellipse.ToolTipText.Items[0].Text;
ellipse.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of ellipse:
//BackFillPattern
var backfill = ellipse.BackFillPattern;
ellipse.BackFillPattern = HmiFillPattern.GradientBackwardDiagonal;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get and set properties of ellipse segment.
The following ellipse segment properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• Opening a Project
See Opening a Project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic properties of Ellipse Segment:
//Name
var name = ellipsesegment.Name;
ellipsesegment.Name = "Default Value";
//AlternateBorderColor
var bordercolor = ellipsesegment.AlternateBorderColor;
ellipsesegment.AlternateBorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = ellipsesegment.Height;
ellipsesegment.BorderWidth = 10;
//ToolTipText
var tooltip = ellipsesegment.ToolTipText;
var tooltiptext = ellipsesegment.ToolTipText.Items[0].Text;
ellipsesegment.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//BackFillPattern
var backfill = ellipsesegment.BackFillPattern;
ellipsesegment.BackFillPattern = HmiFillPattern.GradientBackwardDiagonal;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of circle segment.
The following circle segment properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• Opening a Project
See Opening a Project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program
Modify the following program code to access basic property of Circle Segment:
//Name
var name = circlesegment.Name;
circlesegment.Name = "Default Value";
//AlternateBorderColor
var bordercolor = circlesegment.AlternateBorderColor;
circlesegment.AlternateBorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = circlesegment.BorderWidth;
circlesegment.BorderWidth = 10;
//ToolTipText
var tooltip = circlesegment.ToolTipText;
var tooltiptext = circlesegment.ToolTipText.Items[0].Text;
circlesegment.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//ToolTipText
var tooltip = circlesegment.ToolTipText;
var tooltiptext = circlesegment.ToolTipText.Items[0].Text;
circlesegment.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get and set properties of elliptical arc.
The following elliptical arc properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic property of Elliptical arc:
//Name
var name = ellipticalarc.Name;
ellipticalarc.Name = "Default Value";
//LineColor
var linecolor = ellipticalarc.LineColor;
ellipticalarc.LineColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//LineWidth
var linewidth = ellipticalarc.LineWidth;
ellipticalarc.LineWidth = 10;
//ToolTipText
var tooltip = ellipticalarc.ToolTipText;
var tooltiptext = ellipticalarc.ToolTipText.Items[0].Text;
ellipticalarc.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//CapType
var captype = ellipticalarc.CapType;
ellipticalarc.CapType = HmiCapType.Round;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get and set properties of circular arc.
The following circular arc properties are supported in screenitem:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic property of Circle arc:
//Name
var name = circulararc.Name;
circulararc.Name = "Default Value";
//LineColor
var linecolor = circulararc.LineColor;
circulararc.LineColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//LineWidth
var linewidth = circulararc.LineWidth;
circulararc.LineWidth = 10;
//ToolTipText
var tooltip = circulararc.ToolTipText;
var tooltiptext = circulararc.ToolTipText.Items[0].Text;
circulararc.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//CapType
var captype = circulararc.CapType;
circulararc.CapType = HmiCapType.Round;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with basic screen items (Page 368)
Introduction
You can use the TIA Portal Openness to get and set properties of circle.
The following circle properties are supported in screenitem:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic property of circle:
//Name
var name = circle.Name;
circle.Name = "Default Value";
//BorderColor
var bordercolor = circle.BorderColor;
circle.BorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = circle.BorderWidth;
circle.BorderWidth = 10;
//ToolTipText
var tooltip = circle.ToolTipText;
var tooltiptext = circle.ToolTipText.Items[0].Text;
circle.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//DashType
var dashtype = circle.DashType;
circle.DashType = HmiDashType.Solid;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to set and get properties of rectangle.
The following rectangle properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic properties:
//Name
var name = rectangle.Name;
rectangle.Name = "Default Value";
//BorderColor
var bordercolor = rectangle.BorderColor;
rectangle.BorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = rectangle.BorderWidth;
rectangle.BorderWidth = 10;
//ToolTipText
var tooltip = rectangle.ToolTipText;
var tooltiptext = rectangle.ToolTipText.Items[0].Text;
rectangle.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//Corners
var corner = rectangle.Corners;
var bottomleftradius = corner.BottomLeftRadius;
corner.BottomLeftRadius = 50;
var bottomrightradius = corner.BottomRightRadius;
corner.BottomRightRadius = 30;
var topleftradius = corner.TopLeftRadius;
corner.TopLeftRadius = 50;
var toprightradius = corner.TopRightRadius;
corner.TopRightRadius = 30;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to set and get properties of graphic view.
The following rectangle properties are supported in screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 368)
Program code
Modify the following program code to access basic property:
//Name
var name = graphicview.Name;
graphicview.Name = "Default Value";
//AlternateBackColor
var backcolor = graphicview.AlternateBackColor;
graphicview.AlternateBackColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//Height
var height = graphicview.height;
graphicview.Height = 10;
//ToolTipText
var tooltip = graphicview.ToolTipText;
var tooltiptext = graphicview.ToolTipText.Items[0].Text;
graphicview.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//Padding
var padding = graphicview.Padding;
var bottom = padding.Bottom;
padding.Bottom = 50;
var left = padding.Left;
padding.Left = 60;
var right = padding.Right;
padding.Right = 70;
var top = padding.Top;
padding.Top = 50;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can perform the following tasks with element screen items while using TIA Portal Openness:
• Creating screen item (element)
• Deleting screen item (element)
• Enumerating screen item (element)
The following screen items are supported by the TIA Portal Openness . To access the screen item
related classes and datatype, use the followiing namespace and types:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code example while working with element
screen items.
Recoverable Exception will be raised if the Create method is called with Screen item Name with
which Screen item already exists in TIA
Note
The above example can be used to create IO Field element screen item. To create other element
screen items, you will have to replace IO Field screen item with screen item related class in above
code example.
Note
The above example can be used to delete IO Field element screen item. To delete other element
screen items, you will have to replace IO Field screen item with screen item related class in above
code example.
Modify the following program code to searching Screen item from Screen items list on the basis
of name:
Modify the following program code to get Screen item from Screenitems list on basis of index:
Modify the following program code to checking a particular screen item exist in Screen item list
by using Contains method:
Note
The above example can be used to enumerate IO Field element screen item. To enumerate other
element screen items, you will have to replace IO Field screen item with screen item related class
in above code example.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of IO field.
The following IO Field properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with basic screen items (Page 393)
Program code
Modify the following code to access basic properties of IO Field:
//Name
var name = iofield.Name;
iofield.Name = "DefaultName";
//AlternateBackColor
var altbackcolor = iofield.AlternateBackColor;
iofield.AlternateBackColor = Color.Beige;
//Height
var height = iofield.Height;
iofield.Height = 100;
//ToolTipText
HmiIOField ioField = createdscreen.ScreenItems.Create<HmiIOField>("hmiIOField");
string culture = "en-US";
Language lang = Tiaproject.LanguageSettings.Languages.Find(new CultureInfo(culture));
MultilingualText mltprop = ioField.ToolTipText;
MultilingualTextItemComposition textItemComp = mltprop.Items;
MultilingualTextItem mlttextitem = textItemComp.Find(lang);
mlttextitem.Text = "CommentInEnglish";
//Padding
var padding = iofield.Padding;
var bottom = padding.Bottom;
padding.Bottom = 50;
padding.Left = 60;
padding.Right = 70;
padding.Top = 50;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set properties of button in element screen items.
The following button properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of button:
//Name
var name = hmiButton.Name;
hmiButton.Name = "Default Value";
//AlternateBackColor
var altbackcolor = hmiButton.AlternateBackColor;
hmiButton.AlternateBackColor = Color.Beige;
//Height
var height = hmiButton.Height;
hmiButton.Height = 100;
//ToolTipText
string culture = "en-US";
Language lang = Tiaproject.LanguageSettings.Languages.Find(new CultureInfo(culture));
MultilingualText mltprop = hmiButton.ToolTipText;
MultilingualTextItemComposition textItemComp = mltprop.Items;
MultilingualTextItem mlttextitem = hmiButton.Find(lang);
mlttextitem.Text = "TestforMultilingualProperty";
//Padding
var padding = hmiButton.Padding;
var bottom = padding.Bottom;
padding.Bottom = 50;
padding.Left = 60;
padding.Right = 70;
padding.Top = 50;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get or set properties of switch in element screen items.
The following switch properties are supported in element screen items:
Note
As StyleItemClass property is ReadOnly, thus Get Operation is supported for it and Set Operation
will throw an exception.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of switch:
//Name
var name = toggleswitch.Name;
toggleswitch.Name = "Default Value";
//AlternateBackColor
var altbackcolor = toggleswitch.AlternateBackColor;
toggleswitch.AlternateBackColor = Color.Beige;
//Height
var height = toggleswitch.Height;
toggleswitch.Height = 100;
//ToolTipText
var tooltip = toggleswitch.ToolTipText;
var tooltiptext = toggleswitch.ToolTipText.Items[0].Text;
toggleswitch.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of switch:
//Font
var font = toggleswitch.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var.underline = font.Underline;
font.Underline = false;
font.Bold = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get or set properties of checkbox in element screen items.
The following check box properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of Checkbox:
//Name
var name = chkbox.Name;
chkbox.Name = "DefaultName";
//AlternateBackColor
var altbackcolor = chkbox.AlternateBackColor;
chkbox.AlternateBackColor = Color.Beige;
//Height
var height = chkbox.Height;
chkbox.Height = 100;
//ToolTipText
var tooltip = chkbox.ToolTipText;
var tooltiptext = chkbox.ToolTipText.Items[0].Text;
chkbox.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of checkbox:
//Font
var font = chkbox.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var.underline = font.Underline;
font.Underline = false;
font.Bold = true;
//Selection Items
var selectionItem = chkbox.SelectionItems;
var newselectionitem = selectionItem.Create("NewSelectionItem");
var graphic = newselection.Graphic;
newselectionitem.Graphic = "abcd";
newselectionitem.Isselected = false;
newselectionitem.Text.Item[0].Text = "Testformultilingual";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Openness API V16 to get and set bar properties in element screen items.
The following bar properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of bar:
//Name
var name = bar.Name;
bar.Name = "Default Value";
//RotationCenterPlacement
var rotation = bar.RotationCenterPlacement;
bar.RotationCenterPlacement = HmiRotationCenterPlacement.AbsoluteToContainer;
//Width
var width = bar.Width;
bar.Width = 100;
//ToolTipText
var tooltip = bar.ToolTipText;
var tooltiptext = bar.ToolTipText.Items[0].Text;
bar.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of bar:
//Font
var title = bar.Title;
title.Text.items[0].Text = "teststing";
title.Visible = false;
title.Forecolor = Color.Black;
var font = title.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var underline = font.Underline;
font.Underline = false;
font.Bold = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get or set properties of gauge in element screen items.
The following gauge properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of gauge:
//Name
var name = gauge.Name;
gauge.Name = "Default Value";
//RotationalCenterPlacement
var rotation = gauge.RotationCenterPlacement;
gauge.RotationCenterPlacement = HmiRotationCenterPlacement.AbsoluteToContainer;
//Width
var width = gauge.Width;
gauge.Width = 100;
//ToolTipText
var tooltip = gauge.ToolTipText;
var tooltiptext = gauge.ToolTipText.Items[0].Text;
gauge.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of gauge:
//Font
var title = gauge.Title;
title.Text.items[0].Text = "teststing";
title.Visible = false;
title.Forecolor = Color.Black;
var font = title.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var underline = font.Underline;
font.Underline = false;
font.Bold = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set properties of slider in element screen items.
The following slider properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of slider:
//Name
var name = slider.Name;
slider.Name = "Default Value";
//RotationalCenterPlacement
var rotation = slider.RotationCenterPlacement;
slider.RotationCenterPlacement = HmiRotationCenterPlacement.AbsoluteToContainer;
//Width
var width = slider.Width;
slider.Width = 100;
//ToolTipText
var tooltip = slider.ToolTipText;
var tooltiptext = slider.ToolTipText.Items[0].Text;
slider.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical properties of slider:
//Font
var title = slider.Title;
title.Text.items[0].Text = "teststing";
title.Visible = false;
title.Forecolor = Color.Black;
var font = title.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var underline = font.Underline;
font.Underline = false;
font.Bold = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set properties of radio button in element screen
items.
The following radio button properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of radio button:
//Name
var name = radio.Name;
radio.Name = "Default Value";
//AlternateBackColor
var altbackcolor = radio.AlternateBackColor;
radio.AlternateBackColor = Color.Beige;
//Height
var height = radio.Height;
radio.Height = 100;
//ToolTipText
var tooltip = radio.ToolTipText;
var tooltiptext = radio.ToolTipText.Items[0].Text;
radio.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical properties of radio button:
//Font
var font = radio.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var underline = font.Underline;
font.Underline = false;
font.Bold = true;
//Selection Items
var selectionItem = radio.SelectionItems;
var newselectionitem = selectionItem.Create("NewSelectionItem");
var graphic = newselectionitem.Graphic;
newselectionitem.Graphic = "abcd";
newselectionitem.IsSelected = false;
newselectionitem.Text.Items[0].Text = "Testformultilingual";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set properties of listbox in element screen items.
The following listbox properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic properties of list box:
//Name
var name = listbox.Name;
listbox.Name = "Default Value";
//AlternateBackColor
var altbackcolor = listbox.AlternateBackColor;
listbox.AlternateBackColor = Color.Beige;
//Height
var height = listbox.Height;
listbox.Height = 100;
//ToolTipText
var tooltip = listbox.ToolTipText;
var tooltiptext = listbox.ToolTipText.Items[0].Text;
listbox.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of list box:
//Font
var font = listbox.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var.underline = font.Underline;
font.Underline = false;
font.Bold = true;
//Selection Items
var selectionItem = listbox.SelectionItems;
var newselectionitem = selectionItem.Create("NewSelectionItem");
var graphic = newselectionitem.Graphic;
newselectionitem.Graphic = "abcd";
newselectionitem.Isselected = false;
newselectionitem.Text.Item[0].Text = "Testformultilingual";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set properties of textbox in element screen
items.
The following textbox properties are supported in element screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic property of textbox:
//Name
var name = textbox.Name;
texttbox.Name = "Default Value";
//BorderColor
var bordercolor = textbox.BorderColor;
textbox.BorderColor = Color.FromArgb(0xCC, 0xF0, 0x80, 0x80);
//BorderWidth
var borderwidth = textbox.BorderWidth;
textbox.BorderWidth = 10;
//ToolTipText
var tooltip = textbox.ToolTipText;
var tooltiptext = textbox.ToolTipText.Items[0].Text;
textbox.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
Modify the following program code to access other typical property of textbox:
//Font
var font = textbox.Font;
var italic = font.Italic;
font.Italic = false;
var fontname = font.FontName;
font.FontName = HmiFontName.SimSun;
var size = font.Size;
font.Size = 10.2f;
var stike = font.StrikeOut;
font.StrikeOut = true;
var.underline = font.Underline;
font.Underline = false;
font.Bold = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can use the TIA Portal Openness to get and set the properties of clock in element screen item.
The following clock properties are supported in element screen item:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with element screen items (Page 393)
Program code
Modify the following program code to access basic property of Clock:
//Name
var name = clock.Name;
clock.Name = "Default Value";
//AlternateBackColor
var altbackcolor = clock.AlternateBackColor;
clock.AlternateBackColor = Color.Beige;
//Height
var height = clock.Height;
clock.Height = 100;
//ToolTipText
var tooltip = clock.ToolTipText;
var tooltiptext = clock.ToolTipText.Items[0].Text;
clock.ToolTipText.Items[0].Text = "TestforMultilingualProperty";
//DialLabelFont
var dialfont = clock.DialLabelFont;
dialfont.Italic = false;
var fontname = dialfont.FontName;
dialfont.FontName = HmiFontName.SimSun;
var size = dialfont.Size;
dialfont.Size = 10.2f;
var stike = dialfont.StrikeOut;
dialfont.StrikeOut = true;
var underline = dialfont.Underline;
dialfont.Underline = false;
dialfont.Bold = true;
//ShowHours
var showhour = clock.ShowHours;
clock.ShowHours = false;
Note
If during set of properties the set operation is not able to set the value then a Recoverable
exception would be raised. Values beyond the ranges if not set will send a Recoverable exception
or if set will put the property in invalid state.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with element screen items (Page 393)
Introduction
You can perform the following tasks with control screen items while using TIA Portal Openness:
• Creating screen items (controls)
• Deleting screen items (controls)
• Enumerating screen items (controls)
The following screen items are supported by the TIA Portal Openness. To access the screen item
related classes and datatype, use the followiing namespace and types:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code example while working with control screen
items.
Recoverable Exception will be raised if the Create method is called with Screen item Name with
which Screen item already exists in TIA
Note
The above example can be used to create alarm control screen item. To create other control
screen items, you will have to replace alarm control screen item with screen item related class
in above code example.
Note
The above example can be used to delete alarm control screen item. To delete other control
screen items, you will have to replace alarm control screen item with screen item related class
in above code example.
Modify the following program code to searching Screen item from Screen items list on the basis
of name:
Modify the following program code to get Screen item from Screenitems list on basis of index:
Modify the following program code to checking a particular screen item exist in Screen item list
by using Contains method:
Note
The above example can be used to enumerate alarm control screen item. To enumerate other
control screen items, you will have to replace alarm control screen item with screen item related
class in above code example.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of alarm control in control screen
items.
The following alarm control properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of alarm control:
//Width
var autoplay = hmialarmcontrol.Width;
hmialarmcontrol.Width = 1;
//BackColor
var backcolor = hmialarmcontrol.BackColor;
hmialarmcontrol.BackColor = Color.Beige;
//Name
var name = hmialarmcontrol.Name;
hmialarmcontrol.Name = "DefaultName";
//Caption
var caption = hmialarmcontrol.Caption.Items[0].Text;
hmialarmcontrol.Caption.Items[0].Text = "<body><p>TestforMultilingualProperty</p></body>";
//Status bar
var statusBar = hmialarmcontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of media player in control screen
items.
The following media player properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of media player:
//Autoplay
var autoplay = hmimediacontrol.AutoPlay;
hmimediacontrol.AutoPlay = true;
//BackColor
var backcolor = hmimediacontrol.BackColor;
hmimediacontrol.BackColor = Color.Beige;
//Name
var name = hmimediacontrol.Name;
hmimediacontrol.Name = "DefaultName";
//Caption
var caption = hmimediacontrol.Caption.Items[0].Text;
hmimediacontrol.Caption.Items[0].Text = "<body><p>TestforMultilingualProperty</p></body>";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of screen window in control screen
items.
The following screen window properties are supported in control screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of screen window:
//Width
var autoplay = hmiscreenwindow.Width;
hmiscreenwindow.Width = 1;
//HorizontalScrollBarVisibility
var horizontalscrollbarvisibilityValue = hmiscreenwindow.HorizontalScrollBarVisibility;
hmiscreenwindow.HorizontalScrollBarVisibility = HmiScrollBarVisibility.Visible;
//Name
var name = hmiscreenwindow.Name;
hmiscreenwindow.Name = "DefaultName";
//Caption
var caption = hmiscreenwindow.Caption.Items[0].Text;
hmiscreenwindow.Caption.Items[0].Text = "<body><p>TestforMultilingualProperty</p></body>";
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of trend control in control screen
items.
The following trend control properties are supported in control screen items.
Note
The LabelFont is a Time Axis property of trend base controls.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of trend control:
//Width
var autoplay = hmitrendcontrol.Width;
hmitrendcontrol.Width = 1;
//BackColor
var backcolor = hmitrendcontrol.BackColor;
hmitrendcontrol.BackColor = Color.Beige;
//Name
var name = hmitrendcontrol.Name;
hmitrendcontrol.Name = "DefaultName";
//Caption
var caption = hmitrendcontrol.Caption.Items[0].Text;
hmitrendcontrol.Caption.Items[0].Text = "<body><p>TestforMultilingualProperty</p></body>";
//Status bar
var statusBar = hmitrendcontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of trend companion in control
screen items.
The following trend companion properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Pogram code
Modify the following program code to access basic properties of trend companion:
//Width
var autoplay = hmitrendcompanion.Width;
hmitrendcompanion.Width = 1;
//BackColor
var backcolor = hmitrendcompanion.BackColor;
hmitrendcompanion.BackColor = Color.Beige;
//Name
var name = hmitrendcompanion.Name;
hmitrendcompanion.Name = "DefaultName";
//Caption
var caption = hmitrendcompanion.Caption.Items[0].Text;
hmitrendcompanion.Caption.Items[0].Text = "<body><p>TestforMultilingualProperty</p></
body>";
Modify the following program code to access other typical properties of trend companion:
//Status bar
var statusBar = hmitrendcompanion.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of process control in control screen
items.
The following process control properties are supported in control screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of process control:
//Width
var autoplay = hmiprocesscontrol.Width;
hmiprocesscontrol.Width = 1;
//BackColor
var backcolor = hmiprocesscontrol.BackColor;
hmiprocesscontrol.BackColor = Color.Beige;
//Name
var name = hmiprocesscontrol.Name;
hmiprocesscontrol.Name = "DefaultName";
//Caption
var caption = hmiprocesscontrol.Caption.Items[0].Text;
hmiprocesscontrol.Caption.Items[0].Text= "<body><p>TestforMultilingualProperty</p></
body>";
//status bar
var statusBar = hmiprocesscontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of function trend control in control
screen items.
The following function trend control properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of function trend control:
//Width
var autoplay = hmifunctiontrendcontrol.Width;
hmifunctiontrendcontrol.Width = 1;
//BackColor
var backcolor = hmifunctiontrendcontrol.BackColor;
hmifunctiontrendcontrol.BackColor = Color.Beige;
//Name
var name = hmifunctiontrendcontrol.Name;
hmifunctiontrendcontrol.Name = "DefaultName";
//Caption
var caption = hmifunctiontrendcontrol.Caption.Items[0].Text;
hmifunctiontrendcontrol.Caption.Items[0].Text =
"<body><p>TestforMultilingualProperty</p></body>";
Modify the following program code to access other typical properties of function trend control:
//Status bar
var statusBar = hmifunctiontrendcontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Working with control screen items (Page 423)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness to get and set properties of web control in control screen
items.
The following web control properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of web control:
//Width
var autoplay = hmiwebcontrol.width;
hmiwebcontrol.Width = 1;
//BackColor
var backcolor = hmiwebcontrol.BackColor;
hmiwebcontrol.BackColor = Color.Beige;
//Name
var name = hmiwebcontrol.Name;
hmiwebcontrol.Name = "DefaultName";
//Caption
var caption = hmiwebcontrol.Caption.Items[0].Text;
hmiwebcontrol.Caption.Items[0].Text= "<body><p>TestforMultilingualProperty</p></body>";
//Status bar
var statusBar = hmiwebcontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of system diagnosis control.
The following system diagnosis control properties are supported in control screen items:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 81)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• System Diagnosis Control is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access properties of system diagnosis control:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to get and set properties of parameter set control in control
screen items.
The following parameter set control properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Screen and screenitem is created
See Working with control screen items (Page 423)
Program code
Modify the following program code to access basic properties of parameter set control:
//Width
var autoplay = hmidetailedparametercontrol.Width;
hmidetailedparametercontrol.Width = 1;
//BackColor
var backcolor = hmidetailedparametercontrol.BackColor;
hmidetailedparametercontrol.BackColor = Color.Beige;
//Name
var name = hmidetailedparametercontrol.Name;
hmidetailedparametercontrol.Name = "Default";
//Caption
var caption = hmidetailedparametercontrol.Caption.Items[0].Text;
hmidetailedparametercontrol.Caption.Items[0].Text=
"<body><p>TestforMultilingualProperty</p></body>";
//Status bar
var statusBar = hmidetailedparametercontrol.StatusBar;
var backColor = statusBar.BackColor;
statusBar.BackColor = Color.Aqua;
var enabled = statusBar.Enabled;
statusBar.Enabled = true;
var visible = statusBar.Visible;
statusBar.Visible = true;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can perform the following tasks with faceplate instance items while using TIA Portal
Openness:
• Creating faceplate instance (controls)
• Deleting faceplate instance (controls)
• Enumerating faceplate instance (controls)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
• Plant object type should be created
Program code
You can modify and use the following program code example while working with faceplate
instance.
Recoverable Exception will be raised if the Create method is called with Screen Name with which
Screen already exists in TIA Portal.
//Case 1
HmiSoftware hmiSoftware = GetHMISoftware ();
HmiScreen hmiScreen = hmiSoftware.Screens.Create ("Screen_1");
HmiScreenItemBaseComposition screenitems = hmiSoftware.Screens [0].ScreenItems;
HmiFaceplateContainer faceplate = hmiScreen .ScreenItems.Create<HmiFaceplateContainer>
("abcd");
If (faceplate! = null)
{
faceplate.Delete ();
}
//Case 2
HmiSoftware hmiSoftware = GetHMISoftware ();
HmiScreen hmiScreen = hmiSoftware.Screens.Create ("Screen_1");
HmiScreenItemBaseComposition screenitems = hmiSoftware.Screens [0].ScreenItems;
HmiFaceplateContainer faceplate = hmiScreen .ScreenItems.Create<HmiFaceplateContainer>
("abcd");
IEngineeringObject ObjhmiLineEnggObj = faceplate;
if (ObjhmiLineEnggObj != null)
{
ObjhmiLineEnggObj.Invoke ("Delete", null);
}
Modify the following program code to searching faceplate instance from screen items list on the
basis of name:
Modify the following program code to get faceplate instance from screenitems list on basis of
index:
Modify the following program code to checking a particular faceplate instance exist in screen
item list by using Contains ( ):
See also
Connecting to the TIA Portal (Page 81)
HMI Unified Software object (Page 320)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to get and set properties of faceplate instance in control
screen items.
The following faceplate instance properties are supported in control screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
Modify the following program code to get properties usage of faceplate instance:
Modify the following programme code to set properties usage of faceplate instance:
//Set_ContainedType
faceplate.ContainedType = "V0.0.1\Faceplate_1";
//Set_CaptionText:
faceplate.Caption.Items[0].Text = "testCaption";
//Set_WindowFlags
faceplate.WindowFlags = HmiWindowFlag.CanSize;
//Set_Icon
faceplate.Icon = “testCaption”;
//Set_Top
faceplate.Top = 50;
//Set_Left
faceplate.Left = 50;
//Set_Width
faceplate.Width = 50;
//Set_Height
faceplate.Height = 50;
//Set_Name
faceplate.Name = “TestName”;
//Set_Visible
faceplate.Visible = true;
//Set_Enabled
faceplate.Enabled = true;
//Set_TabIndex
faceplate.TabIndex = 10;
Note
Get - Recoverable exception will be thrown in case respective consistency check fails for the
specified property. During setting of properties, the set operation fails consistency checks then
a Recoverable exception would be raised.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with control screen items (Page 423)
Introduction
You can use the TIA Portal Openness to set and update ContainedType property of Faceplate
container with the new location of Faceplate types in Library.
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can perform the following tasks related to dynamizations and event objects of faceplate
properties using TIA Portal Openness:
• Accessing dynamization (tag connections, animations, local scripts) for faceplate instances
• Accessing faceplate instance events with scripts and system functions
• Accessing property events of faceplate instance
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code: Accessing faceplate instance events with scripts and system functions
For description on Accessing faceplate instance events with scripts and system functions,
see Working with dynamization & events for screen/screen items using scripts (Page 456)
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Working with dynamization for screens/screen items (Page 459)
Working with dynamization & events for screen/screen items using scripts (Page 456)
Working with events for screen/screen items & properties (Page 453)
5.11.10.6 Working with events for screen/screen items & properties (RT Unified)
Introduction
You can perform the followings tasks with property events and events for screen and screen
items while using TIA Portal Openness:
• Creating property events
• Enumerating property events
• Deleting property events
• Accessing properties of events
• Creating events for screens and screen items
• Enumerating events for screens and screen items
• Accessing properties of events for screen and screen items
• Deleting events for screen and screen items
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Unified Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with events for
screen/screen items.
//Event Get
PropertyEventType eventType = propertyEvent.EventType;
string propertyName = propertyEvent.PropertyName;
IHmiScript hmiScript = propertyEvent.Script;
//Script Action in Event Get
bool hmiScriptEventAsync = hmiScript.Async;
string hmiScriptEventGlobal = hmiScript.GlobalDefinitionAreaScriptCode;
string hmiScriptEventCode = hmiScript.ScriptCode;
HmiValidationResult result = hmiScript.SyntaxCheck();
Note
Create - Recoverable exception will be thrown in case respective property events and events for
screen and screen items is not supported for the specified property. If during set of properties the
set operation fails consistency checks then a Recoverable exception would be raised.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
5.11.10.7 Working with dynamization & events for screen/screen items using scripts (RT
Unified)
Introduction
You can perform the following tasks with script to configure property dynamization and events
for screen/screen items while using TIA Portal Openness:
• Creating script dynamizations
• Enumerating script dynamizations
• Deleting script dynamizations
• Accessing properties of script dynamizations
• Accessing properties of trigger
• Checking syntax
Requirement
• The TIA Portal Openness application is connecte to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Uinified Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with script
dynamization for screen/screen items.
Syntax Check
Modify the following program code to check syntax for script code or global script code using
SyntaxCheck action (method) of script dynamization:
Note
Create - Recoverable exception will be thrown in case respective dynamization is not supported
for the specified property. If during set of properties the set operation fails consistency checks
then a Recoverable exception would be raised.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Introduction
You can perform the following tasks with dynamization feature of screens/screen items while
using TIA Portal Openness:
• Creating dynamization for a property
• Enumerating dynamization for a property
• Deleting dynamization for a property
• Accessing common properties of dynamization
• Accessing properties of tag dynamization
Note
For accessing dynamization for a properties at part level, you need to access respective part of
Control. For part information, see Accessing properties of trend control (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A Project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
You can modify and use the following program code examples while working with
dynamizations for screen/screen items.
Note
Create - Recoverable exception will be thrown in case respective dynamization is not supported
for the specified property. If during set of properties the set operation fails consistency checks
then a Recoverable exception would be raised.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
HMI Unified Software object (Page 320)
Accessing properties of trend control (Page 432)
Introduction
You can use the TIA Openness interface to check any Openness client application for the
presence of WinCC Unified license, so that a client application cannot bypass licensing using
Openness interfaces.
You are only able to access to an HMI Unified device and all its underlying objects (e.g. tags,
alarms, screen, etc.) when HMI Unified license is available. If WinCC Unified is not licensed than
any operation on device level (e.g. create, find, delete) results in a null value being returned from
Openness API.
Note
For HMI Unified Software, If license is invalid, then a null value will be returned.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Access to HMI Software object
See HMI Unified Software object (Page 320)
Program code
Modify the following program code to access the device or device sub systems when license is
not available, a null value is returned:
Note
While accessing the above program code, the softTarget will be null, and accessing sub-systems,
such as alarms, tags will not be posssible.
Modify the following program code to access the device or device sub systems when license is
available, a null value is returned.
Note
While accessing the above program code, the softTarget will have device container, and
accessing sub-systems, such as alarms, tags will be possible.
The return value of NULL for device container denotes that the license is not available. The
recoverable exception does not support custom exception messages, hence the use of NULL as
a return value.
See also
Connecting to the TIA Portal (Page 81)
HMI Unified Software object (Page 320)
Introduction
You can use the TIA Portal Openness application to read and write the device names of the
unified and non-unified HMI device.
Properties
The following attribute can be accessed and edited in HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113)
Program code
Tiaproject = tiaPortal.Projects[0];
var deviceUnderTest = Tiaproject.Devices[0];
//Set
deviceUnderTest.Name = "Test1";
//Get
var deviceName = deviceUnderTest.Name;
foreach (var deviceItem in deviceUnderTest.DeviceItems)
{
//Set
deviceItem.Name = "TestDeviceItem1";
//Get
var deviceName = deviceItem.Name;
}
Introduction
You can perform the following tasks related to plant view while using TIA Portal Openness:
• Create plant view
• Delete plant view
• Rename plant view
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to create a plant view:
Note
You can create only one plant view inside a project.
Modify the following program code to rename a plant view by updating the 'Name' property:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can perform the following tasks related to plant view node while using TIA Portal Openness:
• Create plant view nodes
• Delete plant view nodes
• Rename plant view nodes
Properties
The following properties are supported in Plant View Node using TIA Portal Openness:
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to create plant view node under a plant view:
Modify the following program code to create plant view node under another plant view node:
Note
You can create any number of plant view nodes inside a plant view or plant view node itself.
Modify the following program code to remove or delete a plant view node:
Modify the following program code to rename a plant view node by updating the 'Name'
property:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to enumerate plant view present on given project in TIA
Portal.
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to enumerate all plant views of the project:
Modify the following program code to find a plant view from plant view list based on the name:
Modify the following program code to find a plant view from plant view list based on index:
Modify the following program code to find plant view node from the plant view list based on the
hierarchy path of the required plant view node:
Modify the following program code to find a plant view node from the plant view node list based
on the name of the plant view:
PlantViewNodeComposition plantViewNodes =
m_tiaPortalApp.Projects[0].PlantViews[0].PlantViewNodes;
PlantViewNode plantViewNode = plantViewNodes.Find("Mixing");
Modify the following program code to enumerate all plant view nodes list available inside plant
view:
Modify the following program code to enumerate all plant view nodes available inside any
hierarchial level:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can perform the following tasks related to accessing plant view hierarchies and plant object
while using TIA Portal Openness:
• Assign device to the plant view
• Change device to the plant view
• Remove device to the plant view
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to assign a device to the plant view by setting the
AssignedHmiDevice property:
Modify the follwing program code to change a device to the plant view by setting a device name
to AssignedHmiDevice property.
Modify the following program code to remove device to the plant view by setting a blank device
name to AssignedHmiDevice property.
Note
To remove the device, use only string.empty. Passing NULL or whitespace (" "), will be treated as
a device name and will return device not found error message
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can perform the following tasks related to access CPM instance based on CPM type while
using TIA Portal Openness:
• Create CPM object instances
• Delete CPM object instances
• Rename CPM object instances
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• Create a Plant
Program code
Modify the following program code to create CPM object instance:
Modify the following program code to remove or delete a CPM object instance:
Modify the following program code to rename a CPM object instance by updating the 'Name'
property:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.11.13.2 Working with plant view nodes of CPM object instance (RT Unified)
Introduction
You can perform the following tasks related to access plant view nodes of CPM object instances
while using TIA Portal Openness:
• Create plant view nodes
• Delete plant view nodes
• Rename plant view nodes
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to create a plant view node inside a CPM object instance
Note
You can create any number of plant view node inside a CPM object
Modify the following program code to create a CPM object instance inside a plant view node:
Note
You can create any number of CPM object instances inside a plant view node
Modify the following program code to remove or delete a plant view node from a plant view
node:
Modify the following program code to rename a plant view node of CPM object instance by
updating the 'Name' property:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to enumerate a member of a CPM object instance.
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to enumerate all members of the CPM object instance:
Note
In the above example, the ?.operator refers to null check
Modify the following program code to find an interface tag from interfaces list based on ‘Name’:
Modify the following program code to find an interface tag from interface list based on index:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.11.14 Accessing properties for interface/logging tags of plant object instances (RT
Unified)
5.11.14.1 Accessing/Updating properties of interface tags of CPM plant object instances (RT
Unified)
Introduction
You can use the TIA Portal Openness to access and update the properties on interface tags of
CPM plant object instance.
The following properties can be accessed on interface tags of CPM plant object instance:
Note
PLCTag & Connection property can only be configured after assigning Hmi device to the plant
view.
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to access all the properties of interface tags:
Modify the following program code to update some properties of an interface tag, such as
Comment, PLC Tag, Connection, Acquisition Mode, Acquisition Cycle:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to access and update properties of member tags of
interface tags.
The following properties can be accessed on member tags of interface tags:
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code:
Modify the following program code to access all the properties of member tags:
Modify the following program code to update properties of a member tag of a CPM object
instance:
Modify the following code to access all the logging tags of a member tag of CPM object instance:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to access logging tags of member tags present inside CPM
object instance.
The following properties can be accessed on logging tags of member tags present inside CPM
object instance:
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Modify the following program code to access all the properties of logging tags:
Note
You will not be able to update any property of PlantObjectLoggingTag class, associated to a CPM
object instance logging tag.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can download PC-Station Plus and the SW-CPU independently. In order to download the PC-
Station Plus configuration, you must retrieve stationmanager device item of rack of device and
get the download provider as a service. SW-CPU itself must be retrieved as a device item for the
same operation.
It must be noted that, in case the target system reboots after downloading PC-Station Plus
configuration, the default behavior in openness is waiting. This means that, the openness code
flow is stopped until the first stage download is successful (and target system is rebooted) or
timed out or failed.
In case you do not want to wait for the reboot, you can use a post download option which is
called WaitOnReboot
You must continue downloading SW-CPU separately, but it must be made sure that the
download of PC-Station was executed before.
Downloading SW-CPU is similar to downloading a regular plc. For downloading SW-CPU, please
see Hotspot-Text (Page 485).
Note
Download of F-Activated PLCs is not currently supported for SW-CPU as well; as it is in HW-CPU.
A download method also triggers compilation. It is also possible to compile a device item stand
alone, with the following code snippet:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Downloading hardware and software components to PLC device (Page 485)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to download software and hardware components to PLC
device through DownloadProvider (accessed from the DeviceItem). If a DeviceItem represents a
downloadable target, an instance of DownloadProvider will be returned on GetService call, else
the service will return null.
In order to execute a download to a device, you will have to call Download method of
DownloadProvider.
The parameters are an IConfiguration object, two delegates and DownloadOptions (Hardware,
Software or Hardware and Software).
...
IConfiguration targetConfiguration = ...
DownloadConfigurationDelegate preDownloadDelegate = ...
DownloadConfigurationDelegate postDownloadDelegate = ...
DownloadOptions loadOption = DownloadOptions.Hardware | DownloadOptions.Software;
...
DownloadResult result = downloadProvider.Download(targetConfiguration,
preDownloadDelegate, postDownloadDelegate, loadOption);
An optional parameter can be used for downloading to an IP address where the IP address of the
running PLC differs from the IP address configured offline.
...
ConfigurationAddress onlineAddress = ...
DownloadResult result = downloadProvider.Download(targetConfiguration, onlineAddress,
preDownloadDelegate, postDownloadDelegate, loadOption);
• Openness download is supported only if the configurations that are listed in above table are
encountered and properly handled by you. If the configuration is invalid, then
EngineeringTargetInvocationException is thrown and download process is aborted.
Download of F-activated PLCs is not currently supported.
• Since compliation is a part of download, it is recommended to compile before download to
get a full feedback about the complile results.
IConfiguration
You will have to provide IConfiguration object to the Download method. It will be used to
establish a connection to the given PLC device. IConfiguration interface is implemented by
ConfigurationAddress and ConfigurationTargetInterface. Both the objects can be accessed
through ConnectionConfiguration instance. ConnectionConfiguration instance can be acquired
from DownloadProvider.Connection: ConnectionConfiguration or optionally from
OnlineProvider.Connection: ConnectionConfiguration properties.
Configuration of ConnectionConfiguration object is described in Accessing parameters of an
online connection (Page 524) section.
You can use the below code example of accessing ConfigurationTargetInterface that implements
IConfiguration:
...
DownloadProvider downloadProvider = null;
ConnectionConfiguration configuration = downloadProvider.Configuration;
ConfigurationMode configurationMode = configuration.Modes.Find("PN/IE");
ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces.Find("Intel(R)
Ethernet Connection I217-LM", 1);
IConfiguration targetConfiguration = pcInterface.TargetInterfaces[0];
...
ConfigurationAddress
If the projected IP-address differs from the already downloaded online IP-address, an additional
parameter has to use. This is for identify the correct online PLC.
...
DownloadProvider downloadProvider = ...
ConnectionConfiguration configuration = downloadProvider.Configuration;
ConfigurationMode configurationMode = configuration.Modes.Find("PN/IE");
ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces.Find("Intel(R)
Ethernet Connection I217-LM", 1);
IConfiguration targetConfiguration = pcInterface.TargetInterfaces[0];
// Create the address object to reach the PLC online.
ConfigurationTargetInterface targetConfigurationIF = targetConfiguration as
ConfigurationTargetInterface;
ConfigurationAddressComposition downloadAddresses = targetConfigurationIF.Addresses;
ConfigurationAddress onlineAddress = downloadAddresses.Create("10.119.57.223");
DownloadResult result = downloadProvider.Download(targetConfigurationIF, onlineAddress,
preDownloadDelegate, postDownloadDelegate, loadOption);
...
DownloadConfigurationDelegate
You will have to provide two implementations of void
DownloadConfigurationDelegate(DownloadConfiguration downloadConfiguration). First
delegate will be called for pre-download configurations, and the second will be called after
download is completed. The delegates will be called for each configuration that requires an
action from the user. For more information about callback handling, Refer Supporting callbacks
(Page 502). . If configurations are not handled properly, an
EngineeringTargetInvocationException will be thrown and download process will be
aborted. .Certain configurations will only contain an information, therefore your action will not
be required. Also, you can skip the configurations that do not prevent the download.
Note
You should avoid any modifications other than those required to resolve the download
configurations in their delegate implementation.
NOTICE
Please note that download configurations are similar to configurations encountered in
Load preview and Load results dialogs while working with GUI of TIA Portal.
WARNING
The API user is responsible for ensuring the security measures of handling passwords
through code.
You can use the below code example for PostDownloadDelegate implementation:
DownloadOptions
You must specify the download options through DownloadOptions flagged enum. This
parameter will determine the type of download to be performed such as Hardware, Software,
SoftwareOnlyChanges or a combination of them.
[Flags]
public enum DownloadOptions
{
None = 0, // Download nothing
Hardware = 1, // Download hardware. Complete download when used alone, delta download when
used in combination with Software or SoftwareOnlyChanges.
Software = 2, // Download software all. Do not combine with SoftwareOnlyChanges
SoftwareOnlyChanges = 4 // Download software only changes. Do not combine with Software
}
DownloadResult
The DownloadResult returned by the Download action provides feedback on the state of the
objects that were downloaded.
You can use the below code example for Download invocation:
[STAThread]
static void Main()
{
...
DownloadProvider downloadProvider = ...;
IConfiguration targetConfiguration = ...;
DownloadConfigurationDelegate preDownloadDelegate = PreConfigureDownload;
DownloadConfigurationDelegate postDownloadDelegate = PostConfigureDownload;
DownloadResult result = downloadProvider.Download(targetConfiguration,
preDownloadDelegate, postDownloadDelegate, DownloadOptions.Hardware |
DownloadOptions.Software);
if (result.State == DownloadResultState.Error)
{
// Handle error state
}
WriteDownloadResults(result);
...
}
private static void PreConfigureDownload(DownloadConfiguration downloadConfiguration)
{
...
}
private static void PostConfigureDownload(DownloadConfiguration downloadConfiguration)
{
...
}
private void WriteDownloadResults(DownloadResult result)
{
Console.WriteLine("State:" + result.State);
Console.WriteLine("Warning Count:" + result.WarningCount);
Console.WriteLine("Error Count:" + result.ErrorCount);
RecursivelyWriteMessages(result.Messages);
}
private void RecursivelyWriteMessages(DownloadResultMessageComposition messages, string
indent = "")
{
indent += "\t";
foreach (DownloadResultMessage message in messages)
{
Console.WriteLine(indent + "DateTime: " + message.DateTime);
Console.WriteLine(indent + "State: " + message.State);
Console.WriteLine(indent + "Message: " + message.Message);
RecursivelyWriteMessages(message.Messages, indent);
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to download Master Secrets to PLCs through
PlcMasterSecretPassword accessed from download configuration. To download, you will have to
provide an implementation of void DownloadConfigurationDelegate (DownloadConfiguration
downloadConfiguration) for the pre-download configuration.
This delegate will be called for each configuration that requires an action from the user. The
PlcMasterSecretPassword configuration handles the user action for entering the Master Secret
password.
For more information about callback handling and Support of download to PLC devices, Refer
Supporting callbacks (Page 502) and Downloading hardware and software components to PLC
device (Page 485)
You can use the below code sample for PlcMasterSecretPassword handling in
PreDownloadDelegate:
Note
An EngineeringDelegateInvocationException will be thrown in case of an unhandled exception
within the Delegate.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to protect the sensitive PLC configuration data. You can
configure the PLC master secret key which will be used to encrypt the certificate configuration.
Additionally, you can disable if protecting the PLC configuration data is not a priority.
In TIA Portal Openness, the PLC master secret key can be configured via the HW feature
PlcMasterSecretConfigurator at the Device Item CPU of Device. This feature provides actions to
Protect, Unprotect and Change the Master secret key.
• void Protect ( SecureString password)
• void Unprotect ( SecureString password)
• void Unprotect ( )
• void ChangePassword ( SecureString oldPassword, SecureString newPassword)
• attribute MasterSecretConfiguration MasterSecretConfiguration{get;}
enum MasterSecretConfiguration
{
None=0 , // The checkbox option “Protect the PLC Configuration data…” is unchecked.
WithPassword =1, // The PLC Master Secret is configured.
WithoutPassword=2 // The checkbox option “Protect the PLC Configuration data…” is
//checked and the PLC Master Secret is not configured.
}
• void Reset ( )
PlcMasterSecretConfigurator plcMasterSecretConfigurator =
plcCpu.GetService<PlcMasterSecretConfigurator>();
plcMasterSecretConfigurator.Protect(new SecureString(“TiaPassword123”));
plcMasterSecretConfigurator.ChangePassword(new SecureString(“TiaPassword123”),new
SecureString(“TiaPassword1234”));
plcMasterSecretConfigurator.Protect(new SecureString(“TiaPassword123”));
plcMasterSecretConfigurator.Reset();
Affected modules
PLC master secret configuration is supported by S7-1500, ET200 SP, ET200 pro, S7-1200,
Controller PLC with version V2.9(1500, ET200 SP and pro), V4.5(1200), V21.9(Controller PLC)
and above.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connectng to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to set or reset the PlcMasterSecret to PLCs. To achieve this
TIA Portal Openness,-OnlineProvider are extended by new Methods:
• SetPlcMasterSecret
• ResetPlcMasterSecret.
The SetPlcMasterSecret supports the following parameter:
Note
You cannot delete or reset the PMS by a NULL-password.
Note
Reset the PMS is the same functionality like Delete in the "Online & diagnostics"-Dialog.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
When interacting with TIA Portal through Openness API, it may be necessary to change the
operating mode of the PLC. TIA Portal Openness provides a way to modify the operating state of
the PLC either to start or stop.
Program code
Modify the following program code for setting PLC operating state to STOP.
Modify the following program code for setting PLC operating state to START.
Requirements
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Certain API methods require an interaction with the user-defined application code during their
execution. Delegates are used to handle these callback actions in the user-defined application
code. You need to implement a method with a compatible signature, and pass it as a delegate
parameter to the action. To proceed with the execution, TIA Portal calls the implemented
methods.
Program code
[STAThread]
static void Main()
{
...
DownloadProvider downloadProvider = ...;
IConfiguration targetConfiguration = ...;
DownloadConfigurationDelegate preDownloadDelegate = PreConfigureDownload;
DownloadConfigurationDelegate postDownloadDelegate = PostConfigureDownload;
DownloadResult result = downloadProvider.Download(targetConfiguration,
preDownloadDelegate, postDownloadDelegate, DownloadOptions.Hardware |
DownloadOptions.Software);
...
Note
STAThread attribute will assure that the delegates are called in the Main thread of execution.
Requirements
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
When interacting with TIA Portal through Openness API, it may be necessary to change the
protection level of the PLC. TIA Portal Openness provides a way to secure the PLC through a
password. The password can be set to both read-protected and write-protected PLCs.
Program code
Modify the following program code for read-protected PLCs
WARNING
The API user is responsible for ensuring the security measures of handling passwords
through code.
Requirements
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
TIA Portal Openness supports the data binding of passwords for customer applications. TIA
Portal Openness provides a way for the customer to specify a block binding password. For
example, a block binding password can be configured on the DownloadPasswordConfiguration
class by calling the SetPassword method.
Note
If you want to secure the download action with a password, a password will have to be
provided during every call of download function. This is regardless of whether the device
has already been configured. After the successful acceptance of password for a given
configuration, all subsequent calls to SetPassword are ignored.
Program code
Modify the following program code:
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
Openness user is able to upload station into a project through StationUploadProvider (accessed
from a given project). An upload into a DeviceGroup is not supported. If a project is used to
execute an upload, an instance of StationUploadProvider will be returned on GetService call,
else the service will return null.
Parameter 1: ConfigurationAddress
The user should provide ConfigurationAddress object to the Upload. The address object is used
to establish a connection to the given PLC device that should be uploaded. The
ConfigurationAddress object must be created in the ConnectionConfiguration of the
StationUploadProvider. The Configuration contains a list of supported Modes. You need to select
one of the Modes that should be used for upload. The selected ConfigurationMode contains a list
of all local PcInterfaces that support the selected Mode, you have to select one of the interfaces.
The desired address can be created in the Address collection of the selected
ConfigurationPcInterface.
Modify the following code to create an address object:
...
StationUploadProvider uploadProvider = null;
...
ConnectionConfiguration configuration = uploadProvider.Configuration;
ConfigurationMode configurationMode = configuration.Modes.Find("PN/IE");
ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces.Find("Intel(R)
Ethernet Connection I217-LM", 1);
//"Create an address. This "ConfigurationAddress" is used as parameter for upload."
ConfigurationAddress uploadAddress = pcInterface.Addresses.Create("192.68.0.1");
...
Project upload
The user can start the station upload by calling the action StationUpload.
The following Parameters are mandatory:
• ConfigurationAddress: The address of the device to be uploaded
• UploadConfigurationDelegate: The callback to handle upload inhibits
...
StationUploadProvider uploadProvider = null;
Device uploadedObject = null;
...
UploadConfigurationDelegate preUploadDelegate = PreConfigureUpload;
UploadResult result = uploadProvider.StationUpload(uploadAddress, preUploadDelegate);
// The uploaded device
uploadedObject = result.UploadedStation;
if (uploadedObject == null)
{
...
}
internal void PreConfigureUpload(UploadConfiguration uploadConfiguration)
{
...
}
Parameter2: UploadConfigurationDelegate
Openness user needs to provide an implementation of void UploadConfigurationDelegate
(UploadConfiguration uploadConfiguration). The delegate will be called for pre-upload
configurations. The delegate will be called for each configuration that requires an action from
the user. For more information about callback handling, Refer Supporting callbacks (Page 502).
Certain configurations will only contain an information, therefore the user action will not be
required.
The support of a Failsafe password is not necessary. For the read-access by uploading a F-PLC no
password is needed.
moduleReadAccessPassword.SetPassword(password);
return;
}
moduleWriteAccessPassword.SetPassword(password);
return;
}
...
throw new NotSupportedException(); // Exception thrown in the delagate will cancel upload
}
Parameter3: UploadOptions
The user cannot specify the Upload options. This Upload options are known as: "Hardware",
"Software", "Hardware and Software" and "Hardware, Software and Files".
UploadResult
The UploadResult returned by the Upload action provides feedback on the state of the objects
that were uploaded.
• UploadResult.Message: UploadResultMessageComposition - Composition of
UploadResultMessage
The following attributes are supported:
Attributes Description
ErrorCount int value of errors while upload
State UploadResultState with possibly values: Success, Information, Warning and Error
Attributes Description
UploadedStation A Device-Instance of the uploaded station
WarningCount Number of warning while upload as int
Attributes Description
DateTime System.DateTime of the created message.
ErrorCount An int counter for errors.
State UploadResultState with possibly values: Success, Information, Warning and Error.
WarningCount Number of warning while upload as int
if (level == 0)
Console.WriteLine("\n");
foreach (UploadResultMessage message in messages)
{
string messageOut = message.Message.PadLeft(message.Message.Length + level, '\t') + "\n";
Console.WriteLine(messageOut);
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You have the following options to determine the deviation between the software of two devices:
• Comparing the software of two configured PLCs
• Comparison of the software of a PLC and the project library
• Comparison of the software of a PLC and the global library
• Comparison of the software of a PLC and the master copy of a PLC
• Comparisonof the software of a configured PLC with the software of a connected PLC in
"Online" status
Signature
Use the CompareTo or CompareToOnline methods for the comparison.
public CompareResult CompareTo (ISoftwareCompareTarget compareTarget)
Program code
Modify the following program code to output the comparison result:
Modify the following program code to compare the software of a PLC with the project library:
Modify the following program code to compare the software of a PLC with the global library:
Modify the following program code to compare the software of a PLC with a master copy:
Modify the following program code to compare the software of a PLC with the software of a
connected PLC:
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to compare the hardware of two PLC devices.
Signature
Use the CompareTo method for the comparison of two hardware objects.
CompareResult CompareTo (IHardwareCompareTarget compareTarget);
If the Parameter compareTarget is null and an attempt is made to compare the hardware will
throw Siemens.Enginnering.EngineeringTargetInvocationExceptions.
Program
Modify the following program code to output the comparision result:
...
CompareResult compareResult = plc_1.CompareTo(plc_2);
CompareResultState resultState = compareResult.RootElement.ComparisonResult;
if (resultState == CompareResultState.FolderContainsDifferencesOwnStateDifferent)
{
// Folder contents have one or more differences, folder's own state is different:
// May occur if the plc has a different subordinate element, e.g., a local module, and
// the plc itself is different, e.g., in a parameter
}
else if (resultState == CompareResultState.FolderContentEqualOwnStateDifferent)
{
// Folder content is the same, folder's own state is different:
// May occur if a folder-style module, e.g., FM 351, has equal subordinate elements but
// the module itself is different, e.g., in a parameter
}
else if (resultState == CompareResultState.FolderContentsIdentical)
{
...
}
...
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness API to access the Access level setting via the Hardware
PlcAccessLevelProvider at the Deviceitem CPU of Device.
This feature provides actions to set / reset the password and a modeled attribute to set / read the
access level setting.
• void SetPassword ( PlcProtectionAccessLevel accessLevelType, SecureString password )
• void ResetPassword ( PlcProtectionAccessLevel accessLevelType)
• attribute PlcProtectionAccessLevel
In general the handling via Openness is similar to the TIA Portal UI.
• PlcProtectionAccessLevel can always be read and set at S7-1200/1500 PLCs.
• If access level is set to anything different than Full access (or Full access incl. fail-safe) a full
access password has to be set. Otherwise there will be a compile error: "Password must not
be empty"
• It is not allowed to set the same password for different access levels
• It is only possible to set / reset passwords for higher levels than the one set as access level (if
PlcProtectionAccessLevel is set to HMIAccess it is only possible to set a password for
ReadAccess and FullAccess)
Possible exceptions:
• EngineeringTargetInvocationException: "Same password already exists for other access
level" - will be thrown if the user tries to set the same password for different access levels
• EngineeringTargetInvocationException: "Cannot set password for the access level" - will be
thrown if the user tries to set a password for a stricter access level than the one selected
• EngineeringTargetInvocationException: "Password cannot be empty" - will be thrown if the
user tries to set an empty password
• EngineeringTargetInvocationException: "Access Level is not valid" - will be thrown if the
user tries to set the access level to FullAccessIncludingFailsafe at non failsafe PLCs
Access level
In Openness the access level is modelled as an Enum named PlcProtectionAccessLevel. The
name of the Enum fields are based on the "Access Level" entries for S7-1200/1500 PLCs.
You can use the following code example for PlcProtectionAccessLevel with No access:
Password
The password is implemented as SecureString for security reasons. It is only possible to set / reset
the passwords for the different access levels using the corresponding action. Reading the
passwords is not supported.
myPlcAccessLevelProvider.SetPassword(PlcProtectionAccessLevel.ReadAccess,
someSecureString);
myPlcAccessLevelProvider.ResetPassword(PlcProtectionAccessLevel.ReadAccess);
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can create server interface objects and import XML files that define the OPC UA server
interface for the PLC.
You can use the TIA Portal Openness API to access the following functionality using
OpcUaProvider service:
• Adding an OPC UA server interface object
• Enumerating through the server interface belonging to PLC
• Importing a server interface file
• Exporting an existing server interface to XML
• Enabling/ Disabling server interface
• Deleting a server interface
Program code
You can interact with OPC UA server interfaces via an OpcProvider service that can be acquired
from PlcSoftware.
Modify the following program code to allow navigation to the OPC UA server interfaces:
Modify the following program code to enumerate through the items in the
ServiceInterfaceComposition collection:
Modify the following program code to add an OPC UA server interface object:
Modify the following program code to get and set the properties of OPC UA server interface
object:
Modify the following program code to set the contents of the server interface object based on
XML file:
Modify the following program code to write the contents of the server interface object to an XML
file:
Modify the following program code to remove the object from the containing
ServerInterfaceComposition, and de-allocates the object:
ServerInterface serverInterface = …;
serverInterface.Delete());
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application
See Opening a project (Page 113)
Application
You can use the Openness API to access the software checksum for a PLC station.
Program code
To access, you get the instance of PlcSoftware and and load a service instance of
PlcChecksumProvider.
PlcSoftware plc = …;
//get PlcSoftware instance
PlcChecksumProvider checksumProvider =
plc.GetService<PlcChecksumProvider>();
In case the PLC does not support the checksum calculation then the GetService call returns null.
At the PlcChecksumProvider instance the software checksum can be reached as follow:
The Software attribute is read only and it returns null when the program is not compiled.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
For the interface assignment, you have to get a PcInterfaceAssignment service from
Siemens.HW.Features on the device item interface.
If the PC-Station version is <= 2.0, the methods of this service will return null and interface
assignment will not be possible for the interfaces that are assigned to PC-Station or Windows
only or none. For the interfaces that are assigned to SW-CPU, this is again possible.
Note
The support of PC Station is very limited in the CAx interchange. Only PC Stations with version
1.0 and the default value for InterfaceAssignment are supported. The reason is these two values
have impact on device structure (what is built-in, what can be plugged where). But since the
parameters are not part of the AutomationML file, the values are not set during import and as a
result the structure of the IPC does not fit and the other modules can not be plugged.
Modify and use the following program code to get information about the current assignment
mode of an interface:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can determine the state of a PLC or all PLCs in a project.
TIA Portal Openness distinguishes between the following states:
• Offline
• PLC is connected ("Connecting")
• Online
Program code
Modify the following program code to determine the state of a PLC:
Modify the following program code to determine the state of all PLCs in a project:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness API interface to determine or set parameters for an online
connection:
• Enumerate the available connection modes to a PLC
• Enumerate the available interfaces to a PLC
• Enumerate the allocated slots
• Enumerate the available addresses of the subnets and gateways
• Set the connection parameters.
Modify the following program code to enumerate the addresses of the subnets and gateways
available on a PC interface:
You can also access subnets and gateways by their name or IP address:
Note
All the connection parameters previously set are overwritten when you set the connection
parameters. If you have already set the connection parameters directly in the TIA Portal, it is not
necessary to call ApplyConfiguration. If there is already an online connection to a PLC
while ApplyConfiguration is called, an exception is thrown.
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
You can use the TIA Portal Openness to get FingerprintData for different aspects of PLC device
configuration which can be used to realize a quick station compare. It is done through
FingerprintDataProvider service that can be acquired from a given TIA Portal. An instance of
FingerprintDataProvider will be returned on GetService call, else the service will return null.
Configuration Address
You should provide a ConfigurationAddress object to the GetFingerprintData. The address object
will be used to establish a connection to the device for which the fingerprintData have to be
fetched. The ConfigurationAddress object must be created in the ConnectionConfiguration of
the FingerprintDataProvider.
For example, you can use the following code to create an address object:
...
ConnectionConfiguration configuration = fingerprintDataProvider.Configuration;
ConfigurationMode configurationMode = configuration.Modes.Find("PN/IE");
ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces.Find("Intel(R)
Ethernet Connection I217-LM", 1);
// Create an address. This "ConfigurationAddress" is used as parameter for getting the
fingerprintData
ConfigurationAddress fingerprintAddress = pcInterface.Addresses.Create("192.68.0.1");
...
The Configuration contains a list of supported Modes. You have to select one of the Modes that
should be used to get fingerprints. The selected ConfigurationMode contains a list of all local
PCInterfaces that support the selected Mode. You have select one of the interfaces. The desired
address can be created in the Address collection of the selected ConfigurationPcInterface.
Parameter Description
ConfigurationAddress The address of the device
OnlineConfigurationDelegate The callback to handle inhibits)
...
OnlineConfigurationDelegate preConfigurationDelegate = PreConfigureFingerprint;
FingerprintDataResult result =
fingerprintDataProvider.GetFingerprintData(fingerprintAddress , preConfigurationDelegate);
// The fingerprints
FingerprintDataItemComposition allFingerprints = result.FingerprintDataItems;
foreach (FingerprintDataItem item in allFingerprints)
{
// do something with the fingerprint ...
}
internal void PreConfigureFingerprint(OnlineConfiguration onlineConfiguration)
{
...
}
Because this is the Base class for all other configurations, this property adapter is therefor
available in all configurations.
The datatype of the configuration is given below:
FingerprintDataResult
The FingerprintDataResult returned by the GetFingerprintData action provides a composition of
all the fingerprints defined for the device.
For example, you can use the below code to examine fingerprint items:
{
...
FingerprintDataResult result = dataProvider.GetFingerprintData(fingerprintAddress,
preConfigurationDelegate);
FingerprintDataItemComposition allFingerprints = result.FingerprintDataItems;
foreach (FingerprintDataItem item in allFingerprints)
{
string fingerprintDataIdentifier = item.FingerprintDataIdentifier;
string fingerprintDataValue = plcItem.FingerprintDataValue;
// Do something, e.g. store Identifier and Value in a file
}
}
Precondition is, that the client handle the exception. For example this could happened like
shown in following code
Helper classes
For this example two classes are needed. You can use the below program code to encapsulate
fingerprint data pairs.
/// <summary>
/// Helperclass to handle a "Dictionary" as serializeable class object
/// </summary>
[Serializable]
public class FingerprintDataPairs : Dictionary<string, string>, ISerializable
{
public FingerprintDataPairs(){}
public FingerprintDataPairs(SerializationInfo si, StreamingContext context)
{
KeyValuePair<string, string>[] dataPair = si.GetValue("KeyValuePairs",
typeof(KeyValuePair<string, string>[])) as KeyValuePair<string, string>[];
if (dataPair != null)
foreach (KeyValuePair<string, string> pair in dataPair)
this.Add(pair.Key, pair.Value);
}
}
You can use the below example to handle the fingerprint data and compare:
/// <summary>
/// Helperclass for handle the fingerprint data and compare two datasets.
/// </summary> public class FingerprintDataCompare
{
internal FingerprintDataPairs m_FingerprintDataPairs;
internal FingerprintDataPairs FingerprintDataPairSet
{
get
{
if (m_FingerprintDataPairs == null) m_FingerprintDataPairs = new FingerprintDataPairs();
return m_FingerprintDataPairs;
}
set
{
m_FingerprintDataPairs = value;
}
}
internal bool CompareDataSets(FingerprintDataPairs dataSet1, FingerprintDataPairs dataSet2)
{
foreach (string key in dataSet1.Keys)
{
if (dataSet2[key] != dataSet1[key])
return false;
}
return true;
}
internal void SaveFingerprintDataItems(FingerprintDataPairs fingerprintDataPairSet, string
filename)
{
using (FileStream fs = new FileStream(filename, FileMode.Create))
{
BinaryFormatter formatter = new BinaryFormatter();
try
{
formatter.Serialize(fs, fingerprintDataPairSet);
}
catch (SerializationException e)
{
Console.WriteLine("Failed to write fingerprints. See: " + e.Message);
}
finally
{
fs.Close();
}
}
}
internal FingerprintDataPairs LoadFingerprintDataItems(string filename)
{
FingerprintDataPairs dataPair = null;
using(FileStream fs = new FileStream(filename, FileMode.Open))
{
BinaryFormatter formatter = new BinaryFormatter();
try
{
dataPair = (FingerprintDataPairs)formatter.Deserialize(fs);
}
catch (System.Runtime.Serialization.SerializationException e)
{
Console.WriteLine("Failed to read fingerprints. See: " + e.Message);
}
finally
{
fs.Close();
}
}
return dataPair;
}
}
Compare Fingerprints
To compare, you can use the FingerprintDataResult
...
// See chapter "FingerprintDataResult"
FingerprintDataResult fingerprintDataResult = dataProvider.GetFingerprintData(address,
preConfigurationDelegate);
...
...
string pathDat = "FingerprintDataOverview.dat";
FingerprintDataCompare fingerprintDataSet = new FingerprintDataCompare();
foreach (FingerprintDataItem item in fingerprintDataResult.FingerprintDataItems)
fingerprintDataSet.FingerprintDataPairSet.Add(item.FingerprintDataIdentifier,
item.FingerprintDataValue);
FingerprintDataPairs loadDataSet = new FingerprintDataPairs();
loadDataSet = fingerprintDataSet.LoadFingerprintDataItems(pathDat);
if (!fingerprintDataSet.CompareDataSets(loadDataSet,
fingerprintDataSet.FingerprintDataPairSet))
{
// Here is place to implement user actions.
}
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the RHOnlineProvider service to set online either to primary PLC or backup PLCs of
R/H system.
Note
R/H system consists of two PLCs, a single connection configuration is provided to you.
Modify the following program code to set online to the backup PLC:
Note
You are allowed to reuse previously stored password when setting a PLC Online of R/H system.
Modify the following program code to determine the state of primary PLC and backup PLC:
rhOnlineProvider.GoOffline();
See also
Accessing parameters of an online connection (Page 524)
Determining the status of a PLC (Page 523)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use primary PLC device of an R/H system to access software container, for example the
R/H system will provide software container for a primary PLC device item representing PLC_1.
Otherwise, it will provide null if you try to access a software container for backup PLC device
representing PLC_2.
The specific of SoftwarContainer and its software property are described in Access software
target. (Page 131)
See also
Access software target (Page 131)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness application to download the primary and backup PLCs of R/
H system. You are able to download both hardware and software components of the system.
(Refer Downloading hardware and software components to PLC device (Page 485))
...
Device device = project.Devices.Find("S7-1500R/H-System_1");
RHDownloadProvider rhDownloadProvider = device.GetService<RHDownloadProvider>();
...
Note
The DownloadProvider service will not be accessed for CPUs that are part of R/H system.
...
RHDownloadProvider rhDownloadProvider = device.GetService<RHDownloadProvider>();
ConnectionConfiguration connectionConfiguration = rhDownloadProvider.Configuration;
ConfigurationMode mode = connectionConfiguration.Modes.Find("PN/IE");
ConfigurationPcInterface pcInterface = mode.PcInterfaces.Find("Broadcom NetXtreme Gigabit
Ethernet", 1);
IConfiguration targetConfiguration = pcInterface.TargetInterfaces.Find("1 X1");
...
Note
R/H systems consist of two PLCs, only one connection configuration object is provided that can
be used for both primary and backup downloads.
Modify the following program code to download to the backup CPU by invoking
RHDownloadProvider.DownloadToBackup:
Depending upon the state of R/H system, you might request to stop the system for the download
via DownloadConfigurations. Therefore, in addition to the configuration described in
Downloading hardware and software components to PLC device (Page 485), the following data
type are added to support RHDownload.
// Download to primary
DownloadResult primaryDownloadResult =
rhDownloadProvider.DownloadToPrimary(targetConfiguration,
PreConfigureDownloadCallback,
PostConfigureDownloadCallback,
DownloadOptions.Hardware | DownloadOptions.Software);
WriteDownloadResults(primaryDownloadResult);
// Download to backup
DownloadResult backupDownloadResult =
rhDownloadProvider.DownloadToBackup(targetConfiguration,
PreConfigureDownloadCallback,
PostConfigureDownloadCallback,
DownloadOptions.Hardware | DownloadOptions.Software);
WriteDownloadResults(backupDownloadResult);
...
}
private static void PreConfigureDownloadCallback(DownloadConfiguration
downloadConfiguration)
{
StopHSystem stopHSystem = downloadConfiguration as StopHSystem;
if (stopHSystem != null)
{
stopHSystem.CurrentSelection = StopHSystemSelections.StopHSystem;
}
OverwriteTargetLanguages overwriteTargetLanguages = downloadConfiguration as
OverwriteTargetLanguages;
if (overwriteTargetLanguages != null)
{
overwriteTargetLanguages.Checked = true;
}
AlarmTextLibrariesDownload alarmTextLibraries = downloadConfiguration as
AlarmTextLibrariesDownload;
if (alarmTextLibraries != null)
{
alarmTextLibraries.CurrentSelection =
AlarmTextLibrariesDownloadSelections.ConsistentDownload;
return;
}
CheckBeforeDownload checkBeforeDownload = downloadConfiguration as CheckBeforeDownload;
if (checkBeforeDownload != null)
{
checkBeforeDownload.Checked = true;
return;
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Downloading hardware and software components to PLC device (Page 485)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• All devices are enumerated.
See Accessing device items (Page 289).
Application
You can establish the online connection to a PLC, or disconnect an existing online connection.
Program code
Modify the following program code to establish or disconnect the online connection to a PLC:
You can also establish or disconnect the online connections to all available PLCs in a project.
// ...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to assign project languages to web server and display
languages of an S71500 PLC. To achieve that a StructuredData type dynamic attributes is
required.
To access multilingual settings the new dynamic attribute MultilingualSupport of type TableData
has been added. This can be split up into Rows. At each Row the assigned project language can
be set or read with the dynamic attribute ProjectLanguage.
Program code
Modify the following program code to assign project language to PLC:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.12.2.13 Assigning watch & force tables for web server and PLC display
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to assign already created watch and force tables to the web
server. The watch table and force table are software that can be found, created, and deleted in
the software container. You can use the TIA Portal Openness to export/ import Watch and Force
tables. For export/import Watch/Force tables, please see Export/Import Watch & Force Table
(Page 1029)
To assign the watch and force tables to the web server, the WatchAndForceTableAccessManager
service is used at the PLC DeviceItem.
The service contains two navigators for watch and force tables.
• WatchtableAccessRules {WatchtableAccessRuleComposition}
• ForcetableAccessRules {ForcetableAccessRuleComposition}
The navigator WatchTableAccessRules provides the WatchTableAccessRuleComposition which
contains objects of type WatchTableAccessRule. The composition is empty by default. For the
WatchTableAccessRule objects, the actions Find and Create are defined.
WatchAndForceTableAccessManager mngr =
deviceItem.GetService<WatchAndForceTableAccessManager>();
WatchTableAccessRuleComposition watchTableCmp = mngr.WatchTableAccesseRules;
WatchTableAccessRule accessRule1 = watchTableCmp.Find(watchTable1);
Note
Null will be returned if that watchtable is not associated with any WatchTableAccessRule in the
Webserver
Modify the following program code to create a new watch table to the web server with read
access:
WatchAndForceTableAccessManager mngr =
deviceItem.GetService<WatchAndForceTableAccessManager>();
WatchTableAccessRuleComposition watchTableCmp = mngr.WatchTableAccesseRules;
watchTableCmp.Create(watchTable1, WatchAndForceTableAccess.Read);
Modify the following program code to delete an existing WatchTableAccessRule and unassign
the watch table from the web server:
WatchAndForceTableAccessManager mngr =
deviceItem.GetService<WatchAndForceTableAccessManager>();
ForceTableAccessRuleComposition forceTableCmp = mngr.ForceTableAccessRules;
ForceTableAccess forceTable = forceTableCmp.Find(forceTable1);
Modify the following program code to create PLC force table to the web server with read access:
See also
Export/Import Watch & Force Table (Page 1029)
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to handle certificates such as create and delete certificate,
export and import certificate, assign and unassign certificates, and get certificate ID.
Certificate handling
Modify the following program code to create a certificate:
/ Create templates
var templateTls = localCertificateStore.GetCertificateTemplate(CertificateUsage.Tls);
var templateWebserver =
localCertificateStore.GetCertificateTemplate(CertificateUsage.WebServer);
var templateOpcUaServer =
localCertificateStore.GetCertificateTemplate(CertificateUsage.OpcUaServer);//
...
//Template handling and configuration is handled later
// Create certificates
var certificateTls = localCertificateStore.Certificates.Create(templateTls);
var certificateWeb = localCertificateStore.Certificates.Create(templateWebserver);
var certificateOpcUa = localCertificateStore.Certificates.Create(templateOpcUaServer);
var exportPath = …;
// renew a certificatecertificate
Tls.Delete();
certificateTls = localCertificateStore.Certificates.Create(templateTlsNew);
certificateWeb.Export(new FileInfo(exportPath), CertificateExportFormat.Cer);
Modify the following program code to assign certificate to web server and OPC UA server using
dynamic attributes:
DeviceItem opcUaSubmodule = …;
//Find assigned certificates
var foundWebCertificate = Plc.GetAttribute("WebserverCertificate");
var foundOpcUaCertificate = opcUaSubmodule.GetAttribute("OpcUaServerCertificate");
//Assign certificatesPlc.SetAttribute("WebserverCertificate", certificateWeb);
opcUaSubmodule.SetAttribute("OpcUaServerCertificate", certificateOpcUa);
//Unassign certificatesPlc.SetAttribute("WebserverCertificate", null);
opcUaSubmodule.SetAttribute("OpcUaServerCertificate", null);
Modify the following program code to import certificates to the local certificate store for a PLC:
var certificateWithoutPwd = …;
var certificateWithPwd = …;
var password = new SecureString();
//
…
// Import certificates
// Without password
var importedCertificate1 = certificates.Import(new FileInfo(certificateWithoutPwd));
//With password
var importedCertificate2 = certificates.Import(new FileInfo(certificateWithPwd), password);
Modify the following program code to indicate if a certificate has a private key the boolean
property HasPrivateKey at the certificate object can be used.
if(importedCertificate2.HasPrivateKey)
{
//Do something
}
Certificate template
The templates are used as basis for creating certificates. New templates can be created at the
LocalCertificateStore using the action GetCertificateTemplate(CertificateUsage). Where
CertificateUsage is an enumerated with the following possible values:
• None (not supported)
• Tls
• WebServer
• OpcUaServer
• OpcUaClient
• OpcUaClientServer
// Create template
var certTemplate = localCertificateStore.GetCertificateTemplate(CertificateUsage.Tls);
In a certificate template all properties of a certificate can be set. The access is read-write:
• Signature: The used signature algorithm of type SignatureAlgorithm which is an enumerated
with the following possible values
– None (not supported)
– Sha1RSA
– Sha256RSA
certTemplate.Signature = SignatureAlgorithm.Sha1RSA;
• SubjectCommonName: string
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to set up the parameters for an online connection.
These online connections are set up on the ConnectionConfiguration object that can be
accessed via Configuration navigator of OnlineProvider service. This service exists on a
DeviceItem that represents PLC.
Depending upon the available connections for a PLC, you can enumerate through the available
connection modes or specifiy a certain connection mode. For each mode,you can then specify
the PC Interface for that connection type.
The Find-Action of PcInterfaces has two parameters. First the name of the interfaceboard
(ConfigurationPcInterface), and additional to this the number of the interfaceboard. Typically
the number of interfaceboard is "1".
You can specify the slot for the interface.
Note
If PLCSIM is not running, it will not be included in the PcInterfaces collection.
You can also choose to set up the connection via the Addresses of a Subnet or a Gateway.
These settings can than be applied to online connection via the ApplyConfiguration call on the
ConnectionConfiguration object. The system will return a boolean value indicating whether the
configuration was set successfully.
After setting up the connection, you can then go online with the PLC. Each ApplyConfiguration
call is independent and any subsequent call will override the previously applied settings. The
settings are only valid for the current session, similar to the behavior in the UI. If the settings have
already been configured in the UI, then the ApplyConfiguration call is not necessary and the
online connection will use the already available settings.
If a device is already online, invoking the ApplyConfiguration will cause an exception to be
thrown.
You can determine whether a PLC is already configured by using the IsConfigured property
available on the ConnectionConfiguration target:
PLCs that only have one possible configuration will always be configured and therefore, the
IsConfigured property will return true without calling ApplyConfiguration.
Note
Configuring the connection and going online will not affect the contents of the offline or online
PLCs. The user will have to either download the software and/or hardware to the online PLC or
upload the software from the online device in order to make the PLCs consistent.
Legacy communication
From TIA-Portal Version-17, PLCs of type S7-1500 with Firmware (FW) 2.9 communicate vis Tls.
Communication without Tls can be used by the EnableLegacyCommunication.
EnableLegacyCommunication Description
true Communication via Tls is enabled
false false Communication via Tls is disabled. This type of commu‐
nication is the same as in TIA-Portal Versions < V17.
TlsVerificationConfiguration
When going online to a Plc1500 with a FW 2.9 or higher, a user decision may be necessary as to
whether the connection should be established at the given circumstances. In this case the
registered event handler delegate is called in the client program. For the given case, the
OnlineConfiguration parameter must be checked for "TlsVerificationConfiguration".
The possible values of TlsVerificationConfigurationSelection are:
TlsVerificationConfigurationSelection Description
NonVerified The connection is not verified and not trusted
Trusted The connection is verified and trusted
NonTrusted The connection is verified and not trusted
With all other values a go online is not possibly and leads to an user exception.
A new instance of the service is created. All event handlers are registered to the configuration
object of this service. So it is impossible to register an event handler at another facility.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
In TIA Portal Openness, a specific service ModuleDescriptionUpdater is used at the device item
to update the current module description to the newest version of the module. To get the device
item that owns the instance of the service, the property OwnedBy can be used.
You can use the CanUpdate attribute to show if a new ConfigObject version for this deviceitem
is available.
You can use the action UpdateModuleDescription ( ) to update the ConfigObject version of a
deviceitem.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 113)
• A project is open
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to support IP accessibility. In TIA Portal Openness, a new
dynamic attribute PlcAccessCommunicationModule gets available at the device item CPU. The
attribute is of type object, so that you can access to the CP object you want to select for IP
Accessibility and assign the object to PlcAccessCommunicationModule.
If a CP has already been selected you can retrieve the CP object by getting the value of
PlcAccessCommunicationModule.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to set the display protection password. You can use the
method SetPassword(SecureString password) to set the display protection password where the
parameter for the password to be a SecureString. The confirmation password is not needed in
Openness and therefore not available.
The feature will be available if the following preconditions are met.
• The PLC has a “Display” instance.
• The “Display” supports “Password” protection feature. There are cases eg. Software PLC where
Display is available but no password protection available.
Program code
Modify the following program code to get the device item that owns the instance of the service,
the property OwnedBy can be used.
Modify the following program code to set the Display Protection password:
displayProtection.SetPassword(someSecuredString);
//Sets the string someSecuredString as the CPU display protection password.
Note
SW controllers have a display submodule, but do not support any display protection. So in TIA
Portal Openness the feature SetPassword is not available at the display submodule of any SW
controllers.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to access web server and OPC UA submodule of PLCs. It is
possible to add a user up to maximum number at the web server and the OPC UA submodule of
PLCs. The user has a user name and a password.
WebServerUserManagement
{
Navigators WebServerUsers
{
WebServerUserComposition
}
}
WebServerUserComposition
{
WebServerUser Find(string username);
void Create(string username, WebserverUserPermissions permissions,SecureString password);
}
WebServerUser
{
string UserName{get;}
WebserverUserPermissions Permissions {get;set;}
void Delete();
void SetPassword(SecureString password);
}
Modify the following program code to create a new web server user with a web server user
permissions:
Modify the following program code to delete the web server user:
Modify the following program code to replace the current password of the user with the new
password:
OpcUaUserManagement
{
Navigators OpcUaUsers
{
OpcUaUserComposition
}
}
The Service provides a navigator called OpcUaUsers using which a OpcUaUserComposition can
be obtained. The composition manages the OpcUaUser instances:
OpcUaUserComposition
{
OpcUaUser Find(string username);
void Create(string username, SecureString password);
}
OpcUaUser
{
string UserName{get;}
void Delete();
void SetPassword(SecureString password);
}
Modify and use the program code to replace the current password with a supplied one:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.12.3 Blocks
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
Program code
Modify the following program code to query the group "Program blocks":
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code:
Modify the following program code to determine the group created for system blocks by the
system:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
See also
Adding an external file (Page 585)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
Application
Subgroups are taken into account recursively for enumeration.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
Application
Targeted access to a program block is possible if its name is known.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The TIA Portal Openness API supports the querying of the following information for program and
data blocks and for user data types:
• Time stamp in UTC time format.
You check the following with the time stamp:
– When the block was last compiled.
– When the block was last changed.
• "Consistency" attribute
The "Consistency" attribute is set to "True" in the following cases:
– The block has been successfully compiled.
– The block has not been changed since compilation.
– No changes that would require re-compilation have been made to external objects.
• Programming language used (program and data blocks only)
• Block number
• Block name
• Block author
• Block family
• Block title
• Block version
See also Blocks and types of the TIA Portal Openness object model (Page 57) for further
information.
Program code
Modify the following program code to query the information listed above:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
You can set or remove the password protection of a block via the PlcBlockProtectionProvider class
and the PlcBlockProtectionProvider service. The service PlcBlockProtectionProvider is accessible
on blocks which fulfill the following conditions:
• block is know-how protectable
• block is a code block or a global DB
• block is supported or editable in the current PLC
• block is not in readonly context
• block is not know-how protected
• block is not online
• block is not a CPU-DB
• block is not of classic encryption language, ProDiag or ProDiag-OB
• block is not an encrypted imported classic block
In case the block doesn't fulfill all conditions a null reference is returned by GetService() method.
Protect a block
Use the Protect() method to set the password to protect the porgramming block with.
Unprotect a block
Use the Unprotect() method to remove the password the porgramming block is protected with.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Program code
Modify the following program code to delete a block:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to create a group for blocks:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Program code
Modify the following program code to delete a group for blocks:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can set the attributes applicable for all blocks using SetAttribute() and SetAttributes()
method.
SetAttributes() can operate on all objects types where writtable openness attribute is available.
With one input item it behaves as SetAttribute.
Parameter checking:
• Initial checks are done before the first item is being processed by global PE infrastructure:
checking of input items for identical and valid attribute's name, data type mismatch. The
same attribute cannot be set twice by one SetAttributes
• Sequential check happens during running of SetAttributes. The order of the processing is the
same as the order of the input list elements
SetAttributes operates in only one transaction. If any attribute of input list cannot be set, the
values of attributes are remaining unchanged. SetAttributes sets attributes in the same order as
they can be found in the parameter list. The parameters can be dependent or independent of
each other. If one parameter depends on one of the previous parameters in the list, this
parameter is checked and evaluated according to the current value of the other attribute (not
to the original value at the time of calling). If the SetAttributes cannot be executed, details of the
error are indicated. The error message contains the first attribute name and its value which could
not be managed to set and its reason.
The following program code examples were given based on the two attributes AutoNumber and
Number using SetAttribute() (Refer Exporting blocks (Page 998) for all applicable attributes of
blocks).
...
PlcBlockGroup blockFolder = YourUtilities.GetFolder();
var block = blockFolder.Blocks.Find("Block_1");
if ((bool)block.GetAttribute(“AutoNumber”)==true)
{
block.SetAttribute("AutoNumber",false);
}
block.SetAttribute("Number",2);
...
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Openness user can use the PLCBlock composition’s create action with the following parameters
to create ProDiag FB.
1. Name
2. Auto number flag
3. Number
– If "auto number flag" is true, the given block number will be set in case it is free, otherwise
a new block will be generated
– If "auto number flag" is false, the given block number will be set to the block
4. Programming language
– If the user invoke create action with ProDiag programming language, then a new FB will
be created without IDB.
– If user invoke create action with IDB of ProDiag, than IDB of ProDiag will be created.
– In any other not supported case, a recoverable exception is thrown.
...
PlcBlockGroup blockFolder = plc.BlockGroup;
PlcBlockComposition blockComposition = blockFolder.Blocks;
if (blockComposition != null)
{
string fbName = "ProDiag_Block";
bool isAutoNumber = true;
int number = 1;
var progLang = ProgrammingLanguage.ProDiag;
FB block = blockComposition.CreateFB(fbName, isAutoNumber, number, progLang);
string iDBName="ProDiag_IDB";
string instanceOfName = fbName;
InstanceDB iDbBlock = blockComposition.CreateInstanceDB(iDBName, isAutoNumber, number,
instanceOfName);
}
...
See also
Accessing supervisions and properties of ProDiag-FB (Page 579)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
…
PlcBlock iDB = plc.BlockGroup.Blocks.Find("FB_Block_DB");
string fbName = iDB.GetAttribute("InstanceOfName").ToString();
FB fb = (FB)plc.BlockGroup.Blocks.Find(fbName);
if (fb.Supervisions.Count > 0)Console.WriteLine("Contains supervisions");
else
Console.WriteLine("Does not contains supervisions");
…
Program code: Getting and setting the assigned ProDiag-FB at and IDB
...
PlcBlockGroup blockFolder = plc.BlockGroup;
PlcBlock instanceDB = blockFolder.Blocks.Find("IDB");
PlcBlock plcProdiag = blockFolder.Blocks.Find("block_Prodiag");
instanceDB.SetAttribute("AssignedProDiagFB", plcProdiag.Name);
var assignedProDiagFB = instanceDB.GetAttribute("AssignedProDiagFB");
...
See also
Creating a ProDiag-FB (Page 578)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to get and set the assigned proDiagFB value of a member
in Global DB and TagTable using GetAttribute/SetAttribute method.
The Siemens.Engineering.SW.Blocks.Interface.Member type name provides the following
properties:
Program code: Getting proDiagFB Value from DB member & Tag member
Modify the following program code to get prodiagFB in different instances of UDT irrespective of
whether the UDT has supervision or not:
Modify the following program code to set the assigned ProdiagFB attribute to a tag member:
Note
The GetAttribute and SetAttribute of ProDiagFB is a dynamic attribute and valid only for UDT
instance in Global Db and Tag Table.
Objects like simple datatype for example int, string etc and derived datatype like struct, array, all
system defined types , the user constants, and system constants types do not support this
attribute.
Exception will be thrown if you try to get/set the attribute for an object which are not valid.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project via a TIA Portal Openness application
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to read the ProDiag function block version, and other
ProDiag related attribute values. You can use GetAttribute ( ) and GetAttributes ( ) methods to
read the ProDiag FBs language specific attributes present.
Attributes
The following attributes are supported by ProDiag-FB in Openness:
Attributes Type
ProDiagVersion Version
InitialValueAcquisition bool
UseCentralTimeStamp bool
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get and set the start value of a member in any DB using
following ways:
• Indexed access of members in the DB
• Finding the member using the member name
Program code
Modify the following program code to get Start Value from a DB:
PlcBlockInterface bi = dbbblock.Interface;
MemberComposition members = bi.Members;
Member member = members.Find("Room_Temperature");
//Normal get attribute should be possible as usual
Object startValue = member.GetAttribute("StartValue");
//Array
initialSpeedvar = members.Find("Motor.InitialSpeed[0]");
motorInitialSpeed = initialSpeedvar.GetAttribute("StartValue");
//UDT-struct
axisSpeedvar = members.Find("FillingStation.Conveyer.AxisSpeed");
axisSpeed = axisSpeedvar.GetAttribute("StartValue");
//Struct
initialSpeedvar = paramF.Find("DischargeValve.FlowMeter.InitialSpeed[0]");
initialSpeed = initialSpeedvar.GetAttribute("StartValue");
PlcBlockInterface bi = dbbblock.Interface;
MemberComposition members = bi.Members;
Member member = members.Find("Room_Temperature");
Member.SetAttribute("Startvalue", "10");
//Normal set attribute should be possible as usual
Member.SetAttribute("StartValue", 20.3);
//Array
initialSpeedvar = members.Find("Motor.InitialSpeed[0]");
initialSpeedvar.SetAttribute("StartValue", 56);
//UDT-struct
axisSpeedvar = members.Find("FillingStation.Conveyer.AxisSpeed");
axisSpeed.SetAttribute("StartValue", 40.5);
//Struct
initialSpeedvar = paramF.Find("DischargeValve.FlowMeter.InitialSpeed[0]");
initialSpeed.SetAttribute("StartValue", 12);
//Writing a PLC User Constant
PlcUserConstant temperatureConstant = plc.TagTableGroup.TagTables[0].UserConstants[0];
members.Find("temperature_string").SetAttribute("StartValue", temperatureConstant);
Note
The "Attribute Not supported" exception will be thrown to you if you try to use get or set Attribute
for StartValue to the member where it is not possible to have Start Value.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project via a TIA Portal Openness application:
See Opening a project (Page 113)
Application
You can add an external file to a PLC. This external file is stored in the file system under the
defined path.
The following formats are supported:
• STL
• SCL
• DB
• UDT
Note
Accessing groups in the "External source files" folder is not supported.
An exception is thrown if you specify a file extension other than *.AWL, *.SCL, *.DB or *.UDT.
Program code
Modify the following program code to create an external file in the "External source files" folder
from a block.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
The TIA Portal Openness API interface supports the generation of sources in UTF-8 from STL or
SCL blocks, data blocks and PLCTypes (user data types). To generate a source file of a block,
invoke the method GenerateSource on the PlcExternalSourceSystemGroup instance.
The scale of the generated source file depends on the generation option of this function:
• GenerateOptions.None
Generate source from provided blocks only.
• GenerateOptions.WithDependencies
Generate source including all dependent objects.
The interface Siemens.Engineering.SW.ExternalSources.IGenerateSource
indicates that a source can be generated.
Only the STL and SCL programming languages are supported for blocks. Exceptions are thrown
in the following cases:
• Programming language is not STL or SCL
• A file of the same name already exists at the target location
Only the "*.udt" file extension is supported for user data types. Exceptions are thrown in the
following cases:
• The file extension is not "*.db" for DBs
• The file extension is not "*.awl" for STL blocks
• The file extension is not "*.scl" for SCL blocks
Program code
Modify the following program code to generate source files from blocks and types:
//method declaration
...
PlcExternalSourceSystemGroup.GenerateSource
(IEnumerable<Siemens.Engineering.SW.ExternalSources.IGenerateSource>
plcBlocks, FileInfo sourceFile, GenerateOptions generateOptions);
...
//examples
...
var blocks = new List<PlcBlock>(){block1};
var fileInfo = new FileInfo(@"C:\temp\SomePathHere.scl");
// exports all blocks and with all their dependencies(e.g. called blocks, used DBs or UDTs)
// as ASCII text into the provided source file.
...
or
..
var types = new List<PlcType>(){udt1};
var fileInfo = new FileInfo(@"C:\temp\SomePathHere.udt");
// exports all data types and their used data types into the provided source file.
...
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
You can generate blocks from all external files in the "External source files" group. Only external
files with the format ASCII are supported.
Note
Access to groups in the "External source files" folder is not supported.
Existing blocks are overwritten.
An Exception is thrown if an error occurs during the calling. The first 256 characters of each error
message are contained in the notification of the Exception. The project is reset to the processing
state prior to the execution of the GenerateBlocksFromSource method.
Program code
Modify the following program code to generate blocks from all external files in the "External
source files" group.
Requirement
Application
The generator is basically able to create an object (block/UDT) but ‘something inside’ makes that
the generated block/UDT won’t be compilable.
Typical missing or invalid parts what makes the block / type not compilable:
• reference to a not existing type
• missing symbol used
Program code
try
{
IList<IEngineeringObject> generatedObjects =
externalSource.GenerateBlocksFromSource(GenerateBlockOptions.KeepOnError);
foreach (IEngineeringObject engineeringObject in generatedObjects)
{
CompilerResult compilerResult = null;
string objectName = null;
if (engineeringObject is PlcBlock)
{
// handle case for PLcBlock
// e.g. retrieve the compiler result
PlcBlock block = (PlcBlock)engineeringObject;
objectName = block.Name;
compilerResult = block.Compile();
}
else if (engineeringObject is PlcType)
{
// handle case for PlcType
// e.g. retrieve the compiler result
PlcType plcType = (PlcType)engineeringObject;
objectName = plcType.Name;
compilerResult = plcType.Compile();
}
// handle the compiler result
if (compilerResult != null)
{
if (compilerResult.State == CompilerResultState.Error)
{
Console.WriteLine("Object '{0}' could not be compiled successfully!", objectName);
Console.WriteLine("Number of compiler errors: {0}", compilerResult.ErrorCount);
foreach (CompilerResultMessage compilerResultMessage in compilerResult.Messages)
{
Console.WriteLine(compilerResultMessage.Description);
}
}
else
{
Console.WriteLine("Object '{0}' could be compiled successfully.", objectName);
}
}
}
}
catch (RecoverableException exception)
{
// handle recoverable exception
Console.WriteLine(exception.Message);
}
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Program code
Modify the following program code to delete a user type:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
see Connecting to the TIA Portal (Page 81)
• You have opened a project via a TIA Portal Openness application:
see Opening a project (Page 113)
• PLC is not online
Program code
Modify the following program code to delete an external file in the "External source files" group.
Note
Access to groups in the "External source files" group is not supported.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• Instance of the TIA Portal is opened with user interface.
Program code
Modify the following program code to start the associated editor for an object reference of the
type PlcBlock in the TIA Portal instance:
Modify the following program code to open the associated editor for an object reference of the
type PlcType in the TIA Portal instance:
See also
Importing configuration data (Page 885)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to detect changes inside of blocks or UDT. You can achieve
this by comparing the fingerprints of the object. A fingerprint instance contains an FingerprintId
which defines the kind of fingerprint and the fingerprint value as a string. All provided
fingerprints conisder only user input, no compilation result, or any other change made by the
system.
The enumeration FingerprintId lists all kind of fingerprints supported in Openness:
Value Description
Code Considers all changes in the code inside the body of
the block. It does not consider the compilation re‐
sult.
Interface Considers all changes in the interface of a block.
Including start values of a DB
Properties Considers changes in the properties of a block. e.g.
name, number
Comments Considers changes in the comments of a block. In
case of OBs the fingerprint also changes when the
list of available languages in project language set‐
ting changes
LibraryType Exists when a block is connected to a library type
Value Description
Texts With V15 SP1 this fingerprint only exists for Graph
blocks
Alarms Exists when a block uses alarming.
Supervision Exists when a block contains supervision
TechnologyObject Exists only for technology object DBs
Events Exists only for OB
TextualInterface Exists when the block has a textual interface
You need to use the FingerprintProvider service to retrieve the fingerprints of an object. It is
available for blocks (FB, FC, OB, DB),and UDTs, but not for tag tables. The FingerprintProvider
calculates and returns all available fingerprints of an object with each GetFingerprints call. In
order to ensure correct fingerprints, the block or UDT needs to be consistent before calling
fingerprints. Otherwise, an RecoverableException is thrown. When a fingerprint is still invalid
after its calculation, an RecoverableException is thrown.
Program code
Modify the following program code to get the fingerprint instance:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to create user defined web pages within the web server of
PLCs. The data for these user defined pages are stored in specific system generated data blocks
of the PLC. You can also edit and delete these blocks manually. But if you modify any data or
properties in these data blocks the web server will not function correctly.
In TIA Portal Openness, the new service WebserverUserDefinedPages is added at the DeviceItem
PLC. You can use this service to generate the DBs for user defined pages: List<PLCBlock>
GenerateBlocks(Arguments). When this function is called the corresponding DBs are generated
and a list of generated DBs is returned to user.
There are two possible overloads for this function:
• List<PLCBlock> WebserverUserDefinedPages.GenerateBlocks(WebDBGenerateOptions
GenerateOptions);
• List<PLCBlock> WebserverUserDefinedPages.GenerateBlocks(System.IO.DirectoryInfo
htmlDirectory, System.IO.FileInfo defaultHTMLPage, string applicationName,
WebDBGenerateOptionsGenerateOptions);
The parameter values for HTML directory, HTML page and application name are not stored in the
project data. So the values of the corresponding dynamic attributes are not changed.
• When the WebserverHTMLDirectory is too long - "HTML directory has too large data"
• The Application Name is invalid - "Application Name is invalid"
• The Dynamic Content is invalid - "Dynamic Content is invalid"
• The Control DB number is invalid - "Control DB number is invalid"
• The DB Start Number is invalid - "DB Start Number is invalid"
• Blocks are already present: If the user tries to generate a block with a name which already
exists- ""Delete existing blocks before generating new blocks" (Only thrown if
WebDBGenerateOptions.None is used)
There is no specific function to delete all blocks connected to the user defined pages. You have
to manually delete the blocks that are handed back to them by the generate action or navigate
to the corresponding DBs as it is already possible in TIA Portal Openness.
Program code
Modify the following program code to generate a block for user defined page:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project
Application
You can use the TIA Portal Openness to provide write access for block property especially for OBs.
You can change the priority of a block both in unit and non-unt programming model via TIA
Portal Openness.
Program code
Modify the following program code to set the priority for OB block:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.12.3.27 Generating block/UDT from external source file in specific user group
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project via a TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to generate blocks/ udts under user specific groups in both
PLC programming model and unit programming model..
Program code: Generation of blocks from source under specific user groups
Modify the following program code to retrieve the user group information under which the
blocks to be generated:
Siemens.Engineering.SW.Blocks.PlcBlockUserGroup folder =
plc.BlockGroup.Groups.Find("Group_1");
Modify the following program code to generate blocks under groups without any options.
plc.ExternalSourceGroup.ExternalSources.Find("Block_1.scl").GenerateBlocksFromSource(folde
r, GenerateBlockOption.None);
Modify the following program code to generate blocks with Options as KeepOnError:
plc.ExternalSourceGroup.ExternalSources.Find("Block_1.scl")
GenerateBlocksFromSource(folder, GenerateBlockOption.KeepOnError);
Program code: Generation of UDTs from source under specific user groups
Siemens.Engineering.SW.Types.PlcTypeUserGroup folder1 =
plc.TypeGroup.Groups.Find("Group_1");
Modify the following program code to generate UDTs under groups without any Options:
plc.ExternalSourceGroup.ExternalSources.Find("User_data_type_1.udt").GenerateBlocksFromSou
rce(folder1, GenerateBlockOption.None);
Modify the following program code to generate blocks with Options as KeepOnError:
plc.ExternalSourceGroup.ExternalSources.Find("User_data_type_1.udt").GenerateBlocksFromSou
rce(folder1,GenerateBlockOption. KeepOnError);
Functions
Method name with signature
• Public IList<IEngineeringObject>
PlcExternalSource.GenerateBlocksFromSource(PlcBlockUserGroup blockuserGroup,
GenerateBlockOption generateBlockOption)
• Public IList<IEngineeringObject>
PlcExternalSource.GenerateBlocksFromSource(PlcBlockUserGroup blockuserGroup,
GenerateBlockOption generateBlockOption)
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
In the following chapters you will find code sample, that can be adapted to your openness
program.
Functions
The following functions are available for technology objects:
• Querying the composition of technology objects (Page 601)
• Creating technology object (Page 602)
• Deleting technology object (Page 603)
• Compiling technology object (Page 604)
• Enumerating technology object (Page 605)
• Finding technology object (Page 606)
• Enumerating parameters of technology object (Page 607)
• Finding parameters of technology object (Page 607)
• Reading parameters of technology object (Page 608)
• Writing parameters of technology object (Page 609)
• Exporting technology objects (Page 1049)
• Importing technology objects (Page 1051)
• Connecting to Hardware components (Page 619)
See also
Standard libraries (Page 73)
Applications (Page 48)
TIA Portal Openness object model (Page 51)
Technology objects
The following table shows the available technology objects in the Public API.
1) The technology object does not support the following Openness functions: Writing parameters.
2) The technology object does not support the following Openness functions: Enumerating parameters,
Finding parameters, Reading parameters, Writing parameters.
See also
S7-1500 Motion Control (Page 619)
Data types
The following table shows the data type mapping:
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
Program code
Modify the following program code to get all technology objects of a PLC:
See also
Standard libraries (Page 73)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
Application
Only technology objects that are listed in the section Overview of technology objects and
versions (Page 599) can be created. An exception is thrown for unsupported technology objects
or invalid parameters. See also Handling exceptions (Page 862).
Program code
Modify the following program code to create a technology object and add it to an existing PLC:
Possible values and combinations of name, type and version of the technology object can be
found in the section Overview of technology objects and versions (Page 599).
See also
Standard libraries (Page 73)
S7-1500 Motion Control (Page 619)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
• The technology object exists.
See Finding technology object (Page 606)
Program code
Modify the following program code to delete a technology object:
See also
Standard libraries (Page 73)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
• The technology object exists.
See Creating technology object (Page 602)
Compile results
Technology objects compilation results are stored recursively.
You can find an example of recursive evaluation of compilation results in the section "Compiling
a project (Page 137)".
Note
Further parameters
Imported data will be expanded after compiling. For example, You can use Openness to create
motion control technology objects with different versions. After the compiling of technology
objects, the motion control versions of other technology objects are adapted to those of the last
technology object created.
See also
Standard libraries (Page 73)
Requirement
You can enumerate the top level TOs like "TO_Axis" and "TO_Cam". The finding of sub level TOs
like "TO_OutputCam" see Creating and finding TO_OutputCam, TO_CamTrack and
TO_MeasuringInput (Page 619).
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
Program code
Modify the following program code to enumerate technology objects:
See also
Standard libraries (Page 73)
S7-1500 Motion Control (Page 619)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
Program code
Modify the following program code to find a specific technology object:
See also
Standard libraries (Page 73)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
• A technology object exists.
See Creating technology object (Page 602) or Finding parameters of technology object
(Page 607)
• The technology object (Page 599) supports this function.
Program code
Modify the following program code to enumerate parameters of a specific technology object:
See also
Standard libraries (Page 73)
Finding technology object (Page 606)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to find parameters of a specific technology object:
See also
Standard libraries (Page 73)
Finding technology object (Page 606)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to read parameters of a specific technology object:
See also
Standard libraries (Page 73)
Finding technology object (Page 606)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
• A technology object exists.
See Creating technology object (Page 602)
• The technology object (Page 599) supports this function.
Exception
An EngineeringException is thrown if:
• You set a new value for a parameter that does not provide write access.
• A new value for a parameter is of an unsupported type.
Program code
Modify the following program code to write parameters of a specific technology object:
See also
Standard libraries (Page 73)
Finding technology object (Page 606)
The affected arrays for TO_CommandTable are listed in the following table:
Connecting PTO-Outputs
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1200 PLC with PTO-Outputs is determined in the project.
• The technology object exists.
See Creating technology object (Page 602).
Program code
Modify the following program code to connect a PTO-Output to the "TO_PositioningAxis".
//An instance of the technology object axis is already available in the program before
private static void ConnectingDrive(TechnologicalInstanceDB technologicalObject)
{
//Set axis to PTO mode
technologicalObject.Parameters.Find("Actor.Type").Value = 2;
//Set PTO-Output
technologicalObject.Parameters.Find("_Actor.Interface.PTO").Value = 0; // select
Pulse_1
// 0 = Pulse_1
// 1 = Pulse_2
// 2 = Pulse_3
// 3 = Pulse_4
}
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1200 PLC is determined in the project.
• A PROFIdrive is available in the project and connected with the S7-1200 PLC.
• The technology object exists.
See Creating technology object (Page 602).
Program code
Modify the following program code to connect a PROFIdrive by hardware address to the
"TO_PositioningAxis".
//An instance of the technology object axis is already available in the program before
private static void ConnectingDrive(TechnologicalInstanceDB technologicalObject)
{
//Set axis to PROFIdrive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 1;
Requirement
Program code
Modify the following program code to connect an encoder by hardware address to the
"TO_PositioningAxis":
//An instance of the technology object axis is already available in the program before
private static void ConnectingEncoder(TechnologicalInstanceDB technologicalObject)
{
//Set axis to PROFIdrive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 1;
Requirement
Program code
Modify the following program code to connect an analog drive by hardware address to the
"TO_PositioningAxis":
//An instance of the technology object axis is already available in the program before
private static void ConnectingEncoder(TechnologicalInstanceDB technologicalObject)
{
//Set axis to analog drive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 0;
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1200 PLC is determined in the project.
• An analog drive is available in the project and connected with the S7-1200 PLC.
• The technology object exists.
See Creating technology object (Page 602).
Program code
Modify the following program code to connect an encoder by hardware address to the
"TO_PositioningAxis":
//An instance of the technology object axis is already available in the program before
//Connecting by High Speed Counter mode
private static void ConnectingEncoder(TechnologicalInstanceDB technologicalObject)
{
//Set axis to analog drive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 0;
//An instance of the technology object axis is already available in the program before
//Connecting by PROFINET/PROFIBUS telegram
private static void ConnectingEncoder(TechnologicalInstanceDB
technologicalObject)
{
//Set axis to analog drive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 0;
//Set encoder for PROFINET/PROFIBUS mode
technologicalObject.Parameters.Find("_Sensor[1].Interface.EncoderConnection").Value =
7;
technologicalObject.Parameters.Find("_Sensor[1].Interface.DataConnection").Value =
"Encoder";
technologicalObject.Parameters.Find("_Sensor[1].Interface.ProfiDriveIn").Value =
"%I68.0";
technologicalObject.Parameters.Find("Sensor[1].Interface.Number").Value = 1;
// 1 = Encoder1, 2 = Encoder2;
}
Requirement
Program code
Modify the following program code to connect a PROFIdrive by data block to the
"TO_PositioningAxis".
//An instance of the technology object axis is already available in the program before
private static void ConfigureDrivewithDataBlock(TechnologicalInstanceDB
technologicalObject)
{
//Set axis to PROFIdrive mode
technologicalObject.Parameters.Find("Actor.Type").Value = 1;
Program code
Modify the following program code to connect an analog drive by data block to the
"TO_PositioningAxis".
//An instance of the technology object axis is already available in the program before
//Connecting an analog drive with data block.
private static void ConfigureDrivewithDataBlock(TechnologicalInstanceDB
technologicalObject)
{
//Set axis to analog mode
technologicalObject.Parameters.Find("Actor.Type").Value = 0;
Requirement
Program code
Modify the following program code to connect an encoder by data block:
//An instance of the technology object axis is already available in the program before
private static void ConfigureEncoderwithDataBlock(TechnologicalInstanceDB
technologicalObject)
{
//Set axis to PROFIdrive mode depending by axis type. 1 = PROFIdrive, 0 = Analog Drive.
technologicalObject.Parameters.Find("Actor.Type").Value = 1;
//Set the tag in the data block. For PD_TEL3 and PD_TEL4 "Encoder1" or "Encoder2".
technologicalObject.Parameters.Find("_Sensor[1].Interface.DataBlock").Value =
"Data_block_1.Member_of_Type_PD_TEL3";
}
Note
In TIA Portal in the Parameter view of the technology object configuration you can find the
column "Name in Openness".
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_PositioningAxis, TO_SynchronousAxis or
TO_ExternalEncoder is determined in the project.
Application
The output cam, cam track and measuring input technology objects are associated with
positioning axis, synchronous axis or external encoder technology objects. In order to access an
output cam, cam track or measuring input technology object you use the service
OutputCamMeasuringInputContainer.
Program code: Creating and finding output cam, cam track and measuring input technology objects
Modify the following program code to create or find an output cam, cam track or measuring
input technology object:
/*An instance of the technology object under which the TO_OutputCam, TO_CamTrack or
TO_MeasuringInput should be created is already available in the program before*/
private static void CreateFind_OutputcamCamtrackMeasuringinput(TechnologicalInstanceDB
technologyObject)
{
//Retrieve service OutputCamMeasuringInputContainer
OutputCamMeasuringInputContainer container =
technologyObject.GetService<OutputCamMeasuringInputContainer>();
//Get access to TO_OutputCam / TO_CamTrack container
TechnologicalInstanceDBComposition outputcamCamtrackContainer = container.OutputCams;
You create the S7-1500 technology objects OutputCam, CamTrack and MeasuringInput as a
master copy from Siemens.Engineering.Library.MasterCopies.MasterCopy.
/*An instance of the technology object under which the TO_OutputCam, TO_CamTrack or
TO_MeasuringInput should be created is already available in the program before*/
// sourceMasterCopy contains master copy object output cam
private static void CreateFind_OutputcamCamtrackMeasuringinput(TechnologicalInstanceDB
technologyObject, MasterCopy sourceMasterCopy)
{
//Retrieve service OutputCamMeasuringInputContainer
OutputCamMeasuringInputContainer container =
technologyObject.GetService<OutputCamMeasuringInputContainer>();
Some technology parameters that map to read-only data block tags are writeable in the
PublicAPI. The allowed values are the same ones as for the underlying data block tags. The
affected parameters are listed in the following tables:
Name in Openness Name in func‐ Possible value Data type in TO_SpeedAxis TO_Position‐ TO_External‐
tion view Openness ingAxis Encoder
TO_Synchro‐
nousAxis
_Properties.Motion‐ Axis type re‐ 0: Linear int - X X
Type spectively 1: Rotary
"Technological
unit of the po‐
sition"
_Properties.UseHigh‐ Use high reso‐ True, False bool - X X
ResolutionPosition‐ lution position‐
Values ing value.
Name in Openness Name in func‐ Possible value Data type in TO_SpeedAxis TO_Position‐ TO_External‐
tion view Openness ingAxis Encoder
TO_Synchro‐
nousAxis
_CrossPlcSynchronou‐ Activate delay True, False bool - X X
sOperation. time calcula‐
ActivateLocalLeading‐ tion.
ValueDelayTimeCal‐
culation
_Units.LengthUnit Position units See tag uint - X X
Units.LengthU‐
nit3)
_Units.VelocityUnit Velocity units See tag uint X X X
Units.Veloci‐
tyUnit3)
_Units.TorqueUnit Torque units See tag uint X X -
Units.TorqueU‐
nit3)
_Units.ForceUnit Force units See tag uint - X -
Units.ForceU‐
nit3)
_Actor.DataAdaptio‐ Automatically True, False bool X X -
nOffline apply...
_Actor.Interface.Tele‐ Drive telegram Telegram num‐ uint X X -
gram ber4)
_Actor.Interface.Ena‐ Drive output PublicAPI-ob‐ SW.Tags.PlcTag X X -
bleDriveOutputAd‐ address ject
dress
_Actor.Interface.Driv‐ Drive ready in‐ PublicAPI-ob‐ SW.Tags.PlcTag X X -
eReadyInputAddress put address ject
_Sensor[n].Inter‐ Encoder tele‐ Telegram num‐ uint - X -
face.Telegram5) gramm ber4)
_Sensor[n].Active‐ Digital input PublicAPI-ob‐ SW.Tags.PlcTag - X -
Homing.DigitalInpu‐ ject
tAddress5)
_Sensor[n].Passive‐ Digital input PublicAPI-ob‐ SW.Tags.PlcTag - X -
Homing.DigitalInpu‐ ject
tAddress5)
_PositionLi‐ Hardware low PublicAPI-ob‐ SW.Tags.PlcTag - X -
mits_HW.MinSwitch‐ limit switch in‐ ject
Address put
_PositionLi‐ Hardware high PublicAPI-ob‐ SW.Tags.PlcTag - X -
mits_HW.MaxSwitch‐ limit switch in‐ ject
Address put
_Sensor[n].DataA‐ Automatically True, False bool - X -
daptionOffline1) apply...
_Sensor.DataAdaptio‐ Automatically True, False bool - - X
nOffline apply...
_Sensor.Inter‐ Encoder tele‐ Telegram num‐ uint - - X
face.Telegram gram ber4)
Name in Openness Name in func‐ Possible value Data type in TO_SpeedAxis TO_Position‐ TO_External‐
tion view Openness ingAxis Encoder
TO_Synchro‐
nousAxis
_Sensor.PassiveHom‐ Digital input PublicAPI-ob‐ SW.Tags.PlcTag - - X
ing.DigitalInputAd‐ ject
dress
_CrossPlcSynchronou‐ Distributed PublicAPI-ob‐ SW.Tags.PlcTag - X X
sOperation.Inter‐ synchronous ject
face[n]. AddressOut6) operation
For kinematics technology object the following additional parameters are available (S7-1500T):
3) possible values are described in the function manual S7-1500 Motion Control on chapter units
tags (TO)
4) possible values are described in the function manual S7-1500 Motion Control on chapter
PROFIdrive telegrams
5) S7-1500 PLC: n=1; S7-1500T PLC: 1≤n≤4
//An instance of the technology object is already available in the program before
private static void ReadWriteDataBlockTag(TechnologicalInstanceDB technologyObject)
{
//Read value from data block tag "ReferenceSpeed"
double value =
(double)technologyObject.Parameters.Find("Actor.DriveParameter.ReferenceSpeed").Value;
//An instance of the technology object is already available in the program before
private static void ReadWriteAdditionalParameter(TechnologicalInstanceDB technologyObject)
{
//Read additional parameter "_Properties.MotionType"
uint value = (uint)technologyObject.Parameters.Find("_Properties.MotionType").Value;
Additional information
You can find additional information in:
• SIMATIC S7-1500 Motion Control function manual:
https://support.industry.siemens.com/cs/ww/en/view/109749262 (https://
support.industry.siemens.com/cs/ww/en/view/109749262)
• SIMATIC S7-1500T Motion Control function manual:
https://support.industry.siemens.com/cs/ww/en/view/109749263 (https://
support.industry.siemens.com/cs/ww/en/view/109749263)
• SIMATIC S7-1500T Kinematics Functions function manual:
https://support.industry.siemens.com/cs/ww/en/view/109749264 (https://
support.industry.siemens.com/cs/ww/en/view/109749264)
Connecting drives
Requirement
You have to use the Bit addresses for a TO connection. Byte addresses can not be used.
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_SpeedAxis, TO_PositioningAxis or TO_SynchronousAxis
is determined in the project.
• A drive is determined in the project.
Application
To connect an axis with a drive, it is necessary to specify several values together in a single call.
The public API type AxisEncoderHardwareConnectionInterface provides the following methods
which can be used to connect and disconnect the actor or sensor interfaces:
Method Description
void Connect(HW.DeviceItem moduleInOut) Connects to input and output addresses at one module.
void Connect(HW.DeviceItem moduleIn, HW.DeviceItem mod‐ Connects to input and output addresses at separate modules.
uleOut)
void Connect(HW.DeviceItem moduleIn, HW.DeviceItem mod‐ Connects to input and output addresses at separate modules,
uleOut, ConnectOption connectOption) specifying an additional ConnectOption
void Connect(HW.Channel channel) Connects to a channel
void Connect(int addressIn, int addressOut, ConnectOption Connects specifying bit addresses directly
connectOption)
void Connect(string pathToDBMember) Connects to a data block tag
void Connect(SW.Tags.PlcTag outputTag) Connects to a PLC tag
void Disconnect() Disconnects an existing connection
Note
Automatic connections
Note that the same behavior as in the user interface also applies here. Whenever the actor
interface is connected via one of the connection methods and the telegram contains a sensor
part or telegram 750. These parts are connected automatically.
You can use the following read-only attributes to determine how the technology object is
connected. The respective connection values are set only if the connection of the specific kind
exists.
Note
Access the sensor interface
To access the sensor interface you can use SensorInterface[m] with 0≤m≤3.
//An instance of technology object and device item is already available in the program
before
private static void UseServiceAxisHardwareConnectionProvider(TechnologicalInstanceDB
technologyObject, DeviceItem devItem)
{
//Retrieve service AxisHardwareConnectionProvider
AxisHardwareConnectionProvider connectionProvider =
technologyObject.GetService<AxisHardwareConnectionProvider>();
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_SpeedAxis, TO_PositioningAxis or TO_SynchronousAxis
V4.0 is determined in the project.
• A drive that supports telegram 750 is determined in the project.
Application
If telegram 750 was added after connecting the drive and the axis, it is necessary to connect
telegram 750 separately. EnableTorqueData is set to TRUE automatically. The public API type
TorqueHardwareConnectionInterface provides the following methods which can be used to
connect and disconnect telegram 750:
Method Description
void Connect(HW.DeviceItem moduleInOut) Connects to input and output addresses at one
module
void Connect(HW.DeviceItem moduleIn, HW.Devi‐ Connects to input and output addresses at separate
ceItem moduleOut) modules
void Connect(HW.DeviceItem moduleIn, HW.Devi‐ Connects to input and output addresses at separate
ceItem moduleOut, ConnectOption connectOp‐ modules, specifying an additional ConnectOption
tion)
void Connect(int addressIn, int addressOut, Con‐ Connects specifying bit addresses directly
nectOption connectOption)
void Connect(string pathToDBMember) Connects to a data block tag
void Disconnect() Disconnects an existing connection
//An instance of technology object and device item is already available in the program
before
private static void ConnectTorqueInterface(TechnologicalInstanceDB technologyObject,
DeviceItem devItem)
{
//Retrieve service AxisHardwareConnectionProvider
AxisHardwareConnectionProvider connectionProvider =
technologyObject.GetService<AxisHardwareConnectionProvider>();
//Connect TorqueInterface with DeviceItem
connectionProvider.TorqueInterface.Connect(devItem);
}
Connecting encoders
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_ExternalEncoder is determined in the project.
• An object is determined in the project that provides PROFIdrive telegram 81 or 83.
Application
To connect an external encoder technology object with the encoder hardware, it is necessary to
specify several values together in a single call. The public API type
AxisEncoderHardwareConnectionInterface provides the following methods which can be used
to connect and disconnect the sensor interface:
Method Description
void Connect(HW.DeviceItem moduleInOut) Connects to input and output addresses at one module.
void Connect(HW.DeviceItem moduleIn, HW.DeviceItem mod‐ Connects to input and output addresses at separate modules.
uleOut)
void Connect(HW.DeviceItem moduleIn, HW.DeviceItem mod‐ Connects to input and output addresses at separate modules,
uleOut, ConnectOption connectOption) specifying an additional ConnectOption
void Connect(HW.Channel channel) Connects to a channel
void Connect(int addressIn, int addressOut, ConnectOption Connects specifying bit addresses directly
connectOption)
void Connect(string pathToDBMember) Connects to a data block tag
void Connect(SW.Tags.PlcTag outputTag) Not relevant for connecting encoders
void Disconnect() Disconnects an existing connection
You can use the following read-only attributes to determine how the technology object is
connected. The respective connection values are set only if the connection of the specific kind
exists.
//An instance of technology object and device item is already available in the program
before
private static void UseServiceEncoderHardwareConnectionProvider(TechnologicalInstanceDB
technologyObject, DeviceItem devItem)
{
//Retrieve service EncoderHardwareConnectionProvider
EncoderHardwareConnectionProvider connectionProvider =
technologyObject.GetService<EncoderHardwareConnectionProvider>();
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_OutputCam or TO_CamTrack is determined in the project.
• A digital output module is determined in the project, for example TM Timer DIDQ.
Application
To connect an output cam or cam track technology object with a digital output, it is necessary
to specify several values together in a single call. The public API type
OutputCamHardwareConnectionProvider provides the following methods which can be used to
connect and disconnect the actor or sensor interfaces:
Method Description
void Connect(HW.Channel channel) Connects to a channel
void Connect(SW.Tags.PlcTag outputTag) Connects to a PLC tag
void Connect(int address) Connects specifying bit addresses directly
void Disconnect() Disconnects an existing connection
You can use the following read-only attributes to determine how the technology object is
connected:
//An instance of technology object and channel item is already available in the program
before
private static void UseServiceOutputCamHardwareConnectionProvider(TechnologicalInstanceDB
technologyObject, Channel channel)
{
//Retrieve service OutputCamHardwareConnectionProvider
OutputCamHardwareConnectionProvider connectionProvider =
technologyObject.GetService<OutputCamHardwareConnectionProvider>();
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_MeasuringInput is determined in the project.
• A digital input module is determined at drive or in the project, for example TM Timer DIDQ.
Application
To connect a measuring input technology object with a digital input, it is necessary to specify
several values together in a single call. The public API type
MeasuringInputHardwareConnectionProvider provides the following methods which can be
used to connect and disconnect the actor or sensor interface:
Method Description
void Connect(HW.Channel channel) Connects to a channel
void Connect(HW.DeviceItem moduleIn, int channelIndex) Connects to a module, specifying an additional channel index
void Connect(int address) Connects specifying bit addresses directly
• For TM Channels, the bit address can be calculated via the
formula
bit_address = module_start_address * 8 + channel_index
• For telegram 39x, the associated formula is
bit_address = module_start_address * 8 + 24 + num‐
ber_of_measuringinput_in_telegram
void Disconnect() Disconnects an existing connection
You can use the following read-only attributes to determine how the technology object is
connected:
//An instance of technology object and channel item is already available in the program
before
private static void
UseServiceMeasuringInputHardwareConnectionProvider(TechnologicalInstanceDB
technologyObject, Channel channel)
{
//Retrieve service MeasuringInputHardwareConnectionProvider
MeasuringInputHardwareConnectionProvider connectionProvider =
technologyObject.GetService<MeasuringInputHardwareConnectionProvider>();
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_PositioningAxis, TO_SynchronousAxis,
TO_ExternalEncoder or TO_LeadingAxisProxy as leading axis is determined in the project.
• A technology object of the type TO_SynchronousAxis as following axis is determined in the
project.
Application
To connect a synchronous axis technology object with leading values, it is necessary to specify
several values together in a single call. The public API type SynchronousAxisMasterValues
provides the following methods which can be used to connect and disconnect leading values.
Leading values can be connected as setpoint coupling (S7-1500 PLC, S7-1500T PLC) or actual
value coupling (S7-1500T PLC). All methods and attributes are relevant for both types of
coupling.
Method Description
int IndexOf (TechnologicalInstanceDB element) Returns the corresponding index of a leading value
bool Contains (TechnologicalInstanceDB element) TRUE: The container contains the leading value
FALSE: The container does not contain the leading value
Method Description
IEnumerator GetEnumerator <TechnologicalInstanceDB>() Used to support each iteration
void Add (TechnologicalInstanceDB element) Connects following axis to leading value
bool Remove (TechnologicalInstanceDB element) Disconnects following axis from leading value
TRUE: Disconnection was succesfully
FALSE: Disconnection was not succesfully
You can use the following attributes to connect a synchronous axis with a leading value:
DelayedCoupling SW.TechnologicalObjects.TechnologicalInstan‐ The attribute contains all master values that are
ceDBAssociation coupled via delayed values.
//An instance of leading axis and following axis is already available in the program before
private static void UseServiceSynchronousAxisMasterValues(TechnologicalInstanceDB
masterTechnologyObject, TechnologicalInstanceDB synchronousTechnologyObject)
{
//Retrieve service SynchronousAxisMasterValues
SynchronousAxisMasterValues masterValues =
synchronousTechnologyObject.GetService<SynchronousAxisMasterValues>();
//Connect following axis and leading axis with actual value coupling
masterValues.ActualValueCoupling.Add(masterTechnologyObject);
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal.
• A project is open.
See Opening a project.
• A S7-1500 PLC is determined in the project.
• A technology object of the type TO_PositioningAxis, TO_SynchronousAxis or
TO_ExternalEncoder as leading axis is determined in the project.
• A technology object of the type TO_Kinematics as following axis is determined in the project.
Application
To configure leading values for conveyor tracking, use the service
SW.TechnologicalObjects.Motion.ConveyorTrackingLeadingValues for TO Kinematics ≥ V5.0.
Method Description
int IndexOf (TechnologicalInstanceDB element) Returns the corresponding index of a leading value
bool Contains (TechnologicalInstanceDB element) TRUE: The container contains the leading value
FALSE: The container does not contain the leading
value
IEnumerator GetEnumerator <TechnologicalIn‐ Used to support each iteration
stanceDB>()
void Add (TechnologicalInstanceDB element) Connects following axis to leading value
bool Remove (TechnologicalInstanceDB element) Disconnects following axis from leading value
TRUE: Disconnection was succesfully
FALSE: Disconnection was not succesfully
You can use the following attributes to connect a kinematics axis with a leading value:
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81).
• A project is open.
See Opening a project (Page 113).
• A S7-1500 PLC is determined in the project.
See Querying PLC and HMI targets (Page 205)
• The technology object exists.
Application
To export or import the data of a technology object cam of typ TO_Cam or TO_Cam_10k you have
to specify the format and which separator should be used. The public API type CamDataSupport
provides the following methods which can be used to export the data of technology object cam.
For more information on export format of cam, Refer function manual Using S7-1500/S7-1500T
Synchronous Operations Functions on chapter Importing / exporting cam.
Method Description
void SaveCamDataBinary(System.IO.FileInfo destinationFile) Exports the data in binary format in the destination file.
void SaveCamDataPointList(System.IO.FileInfo destination‐ Exports the data in format “PointList” in the destination file.
File, CamDataFormatSeparator separator, int samplePoints)
void SaveCamData(System.IO.FileInfo destinationFile, Cam‐ Exports the data in the destination file. You can specify data
DataFormat format, CamDataFormatSeparator separator) format as “MCD”, “SCOUT” or “Pointlist” and separator as “tab”
or “comma”.
If you choose “PointList” 360 interpolation points will be ex‐
ported.
void LoadCamData(System.IO.FileInfo sourceFile, CamData‐ Imports the cam data in the format “MCD”, “SCOUT” or “Point‐
FormatSeparator separator) list” to the project.
void LoadCamDataBinary(System.IO.FileInfo sourceFile) Imports the cam data from a binary file to the project.
//Load cam data from source file, using the separator Tab
camData.LoadCamData(sourceFile, CamDataFormatSeparator.Tab);
}
Parameters for PID_Compact, PID_3Step, PID_Temp, CONT_C, CONT_S, TCONT_CP and TCONT_S
You can find a list of all available parameters in the product information “Parameters of
technology objects in TIA Portal Openness“ on the internet (https://
support.industry.siemens.com/cs/ww/en/view/109744932).
For each parameter the following properties are provided:
• Name in configuration (TIA Portal)
• Name in Openness
Note
In TIA Portal in the Parameter view of the technology object configuration you can find the
column "Name in Openness".
Additional information
You can find additional information in SIMATIC S7-1200/S7-1500 PID control function manual on
the internet (https://support.industry.siemens.com/cs/ww/en/view/108210036).
5.12.4.17 Counting
Additional information
You can find additional information in SIMATIC S7-1500, ET 200MP, ET 200SP Counting,
measurement and position input function manual on the internet (http://
support.automation.siemens.com/WW/view/en/59709820).
Note
In TIA Portal in the Parameter view of the technology object configuration you can find the
column "Name in Openness".
Additional information
You can find additional information for Easy Motion Control in the Information system of STEP 7
(TIA Portal).
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• Instance of the TIA Portal is opened with user interface.
Program code
Modify the following program code to start the corresponding editor for an object reference of
the type PlcTagTable in the TIA Portal instance:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PlcSoftware instance was retrieved from a PLC device item.
See Querying PLC and HMI targets (Page 205)
Program code
Modify the following program code to query the system group for PLC tags:
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PlcSoftware instance was retrieved from a PLC device item.
See Querying PLC and HMI targets (Page 205)
Program code
Modify the following program code to create the PLC tag table. It creates a new tag table with
the given name in the composition.
See also
Querying PLC and HMI targets (Page 205)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A PlcSoftware instance was retrieved from a PLC device item.
See Querying PLC and HMI targets (Page 205)
Application
Subfolders are taken into account recursively for enumeration.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The TIA Portal Openness API interface supports the creation of a user-defined group for PLC tags.
Program code
Modify the following program code to create a user-defined group for PLC tags:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The TIA Portal Openness API interface supports the deletion of a specific user-defined group for
PLC tag tables.
Program code
Modify the following program code to delete a specific user-defined group for PLC tag tables:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
//Enumerates all plc tag tables in a specific system group or and user group
private static void EnumerateAllPlcTagTablesInFolder(PlcSoftware plcSoftware)
{
PlcTagTableComposition tagTables = plcSoftware.TagTableGroup.TagTables;
// alternatively, PlcTagTableComposition tagTables =
plcSoftware.TagTableGroup.Groups.Find("UserGroup XYZ").TagTables;
foreach (PlcTagTable tagTable in tagTables)
{
// add code here
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Via PLC tag tables you can access user constants, system constants and tags. The count of the
tag composition of a tag table is equal to the number of tags in that tag table. The PLCTagTable
contains the following navigators, attributes, and actions.
The following attributes are accessed in PLC tag table.
Program code
Modify the following program code to query the information for a PLC tag table:
5.12.5.9 Reading the time of the last changes of a PLC tag table
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The format of the time stamp is UTC.
Program code
Modify the following program code to read the time stamp of a specific PLC tag table:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to delete a specific tag table from a group:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The type PlcTagComposition represents a collection of plc tags.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The type PlcUserConstantComposition represents a collection of plc user constants. You
have access to the following attributes:
• Name (read only)
• Data type name
• Value
See also
Creating user-defined groups for PLC tags (Page 645)
Deleting user-defined groups for PLC tags (Page 646)
Deleting a PLC tag table from a group (Page 649)
Accessing PLC tags (Page 650)
Starting the "PLC Tags" editor (Page 642)
Reading the time of the last changes of a PLC tag table (Page 649)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The units are important parts of the PLC's Programming and can be found on the PlcSoftware.
The unit provider is retrieved from PlcSoftware via GetService and the PlcUnitComposition can
be retrieved from it.
You can perform the following elementary operations for units while using TIA Portal Openness:
• Creating units
• Deleting units
• Renaming units
Error will occur if you provide the wrong name, for example starting with whitespace or
containing invalid character or name is too long. A Recoverable Exception will be thrown with
the following error message: "The value of attribute 'Name' contains an invalid character at
Position 0."
try
{
PlcUnit unit1 = unitComposition.Create("Unit1");
}
catch (EngineeringTargetInvocationException e)
{
Console.WriteLine(e.Message);
}
Error will occur if you want to create a unit with which a name already exists. A Recoverable
Exception will be thrown with the following message: "Unit with name'Unit1' already exists.
unitProvider.UnitGroup.Units.Find("Unit_2").Delete();
You will encounter NullReferenceException in case of the Find( ) method from above example
code does not provide a reference to a Unit.
//Set Value
PlcUnit unit1 = unitComposition.Create("Unit1");
unit1.Name = "Unit1_new";
//Using SetAttributes():
PlcUnit unit1 = unitComposition.Create("Unit1");
var attrList = new List<KeyValuePair<string, object>>()
{
new KeyValuePair<string, object>("Name", "Unit1_new")
};
unit1.SetAttributes(attrList);
//Using SetAttribute()
PlcUnit unit2 = unitComposition.Create("Unit2");
IEngineeringObject unit = (IEngineeringObject)unit2;
unit.SetAttribute("Name", "Unit2_new");
Error will occur if you provide wrong name, for example starting with whitespace, or containing
invalid character. A Recoverable Exception will be thrown with the error message: "The value of
attribute 'Name' contains an invalid character at Position 0."
Error will occur if you want to rename a unit with a name which already exists. A recoverable
exception will be thrown with the error message: "The property 'Name' has an invalid value:
'Unit1'. A software unit with the same name already exists."
See also
Opening a project (Page 113)
Requirement
• The TIA Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to access the units. The units are important parts of the
PLC's programming. Only a selected set of PLCs are supporting units therefore units are not
modelled statically in the object model so they aren’t browsable directly under the PLC software
container.
The PlcUnitProvider makes units accessible and it is available from the PlcSoftware through
GetService( ) – as it shown in the Program code example below:
The PlcUnitProvider allows the access via the UnitGroup navigator to the PlcUnitSystemGroup
which contains the PlcUnitComposition with the general composition specific possibilities
(iterate, Find, Create, Import etc. for PlcUnits).
The unit's representation (PlcUnit) contains the unit's own specific properties as Openness
attributes.
You can access the below attributes and Methods for Openness unit properties:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Opennness to access:
• the Program blocks system group, its contained groups and blocks recursively
• the PLC data types system group, its contained groups and data types recursively
• the PLC tags system group, its contained groups and tag tables recursively
Modify the following program code to access the program block group under the current PLC
unit by retrieving the program block group composition, and iterating through its contained
groups:
Program code: Accessing PLC data types and data type groups
Modify the following program code to access PLC data types under the current PLC unit by
retrieving the PLC data type composition and iterating through its contained data types:
Modify the following program code to access PLC data type group under the current PLC unit by
retrieving the PLC data type composition and iterating through its contained groups:
Program code: Accessing PLC tag tables and tag table goups
Modify the following program code to access the PLC tag tables under the current PLC unit by
retrieving the PLC tag table composition and iterating through its contained tag tables:
Modify the following program code to access PLC tag table groups under the current PLC unit by
retrieving the PLC tag table group composition and iterating through its contained groups:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to access all the existing relations of a unit so that you can
read relation properties.
The following attributes are supported by the unit relation in the Openness:
The following ENUM values are provided for the attribute RelationType:
• Software Unit
• Non-Unit DB
• TO DB
Modify the following program code for getting relations by iterating through them:
PlcSoftware plcTarget = GetControllerTargetByPLCName(Session.OpnsProject.Devices,PLCName);
PlcUnitProvider provider = plcTarget.GetService<PlcUnitProvider>();
//assuming existing units
m_PlcUnit = provider.UnitGroup.Units[0];
PlcUnitRelationComposition unitRelations = m_PlcUnit.Relations;
foreach (PlcUnitRelation relation in unitRelations)
{
// using ‘relation’
}
Modify the following program code for getting the relation type of a unit by the RelationType
attribute:
PlcSoftware plcTarget =
GetControllerTargetByPLCName(Session.OpnsProject.Devices,PLCName);
PlcUnitProvider provider = plcTarget.GetService<PlcUnitProvider>();
//assuming existing units
m_PlcUnit = provider.UnitGroup.Units[0];
UnitRelationType unitRelationType = m_PlcUnit.Relations[2].RelationType;
Modify the following program code for getting the name of the related object of a unit by the
RelatedObject attribute:
Modify the following program code for identifying one relation in the collection using Find with
the name of accessible element (RelatedObject):
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to update unit properties such as Author and Comment.
//Set value
string newAuthor = "Z012345";
unit1.Author = newAuthor;
//Using SetAttributes()
string newAuthor = "Z012345";
var attrList = new List<KeyValuePair<string, object>>()
{
new KeyValuePair<string, object>("Author", newAuthor)
};
unit1.SetAttributes(attrList));
//Using SetAttribute()
string newAuthor = "Z012345";
IEngineeringObject unit = (IEngineeringObject)unit2;
unit.SetAttribute("Author", newAuthor);
Error Message
Error will occur if you try to use the wrong value, for example starts with space, or contains illegal
characters. An Recoverable Exception will be thrown with the following error message: "The
value of attribute 'Author' contains an invalid character at Position 0."
Error Message
Error will occur if you try to use the SetAttribute, SetAttributes, GetAttribute, GetAttributes. An
EngineeringNotSupportedException will be thrown with the following error message:
"Comment is not supported by type 'Siemens.Engineering.SW.Units.PlcUnit'."
try
{
((IEngineeringObject)unit1).SetAttribute("Comment", "new comments");
}
catch (EngineeringNotSupportedException e)
{
Console.WriteLine(e.Message);
}
try
{
unit1.Comment.Items[3].Text = "new Comment";
}
catch (EngineeringTargetInvocationException e)
{
Console.WriteLine(e.Message)
}
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get or set the "Access" attribute of the underlying objects
of units so that you can control their accessibilty between units.
Note
The attribute ’Access’ is only available on objects located under a unit, so if it is going to be set
or get not under PlcUnit related objects a EnginneringNotSupportedException is thrown. In case
of a wrong value (e.g.invalid enum values) EngineeringTargetInvocationException is thrown.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add an external source under a software units. You can
add source files such as .SCL,. DB, UDT under units.
You can perform the following tasks with external source group under software units while
using Openness API :
• Adding ExternalSourceGroup under units
• Generating blocks/UDTs from an external source under software units
• Exporting source from blocks/UDTs under units
unitExternalSource.GenerateBlocksFromSource();
Modify the following program code to generate blocks\UDT with collection of blocks get
generated from an external source under a software unit:
// For blocks
PlcBlock unitPlcBlock = newUnit.BlockGroup.Blocks.Find(generatedBlockName);
// Generate source from blocks with dependencies
newUnit.ExternalSourceGroup.GenerateSource(new[] { unitPlcBlock }, new
FileInfo(outputFileGeneratedPath), GenerateOptions.WithDependencies);
// Generate source from blocks without dependencies
newUnit.ExternalSourceGroup.GenerateSource(new[] { unitPlcBlock }, new
FileInfo(outputFileGeneratedPath), GenerateOptions.None);
Modify the following program code to generate source from UDTs under a software unit:
// For UDTs
PlcType unitPlcUdt = newUnit.TypeGroup.Types.Find(generatedUdtName);
//Generate source from UDTs with dependencies
newUnit.ExternalSourceGroup.GenerateSource(new[] { unitPlcUdt }, new
FileInfo(outputFileGeneratedPath), GenerateOptions.WithDependencies);
//Generate source from UDTs without dependencies
newUnit.ExternalSourceGroup.GenerateSource(new[] { unitPlcUdt }, new
FileInfo(outputFileGeneratedPath), GenerateOptions.None);
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• A unit is created
See Working with software unit (Page 654)
Application
You can use the TIA Portal Openness to copy units as mastercopies to project library and global
library.
You can perform the following possible tasks with unit as mastercopy while using TIA Portal
Openness:
• Create unit as mastercopy in project library from software units
• Create unit as mastercopy in global library from software units
• Recreate unit from mastercopy of project library to software units in PNV.
• Recreate unit from mastercopy of global library to software units in PNV
Program code
Modify the following program code to create new unit as mastercopy in project library from
software units using MasterCopyComposition:
Modify the following program code to create unit as mastercopy in global library from software
units:
...
IMasterCopySource m_UnitAsMasterCopy = (IMasterCopySource)m_SoftwareUnit1;//Assuming that
m_SoftwareUnit1 is present in the PLC
m_TiaPortal.GlobalLibraries.Open(libfile, OpenMode.ReadWrite);
GlobalLibrary m_GlobalLibrary = m_TiaPortal.GlobalLibraries[0];
m_GlobalLibrary.MasterCopyFolder.MasterCopies.Create(m_UnitAsMasterCopy)
...
Error will occur if you try to create a new unit in read-only global library. A recoverable exception
will be thrown with the message "Cannot write to read-only libraries".
m_TiaPortal.GlobalLibraries.Open(libfile, OpenMode.ReadOnly);
GlobalLibrary m_GlobalLibrary = m_TiaPortal.GlobalLibraries[0];
try
{
m_GlobalLibrary.MasterCopyFolder.MasterCopies.Create(m_UnitAsMasterCopy);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
Modify the following program code to recreate a unit from mastercopy of project library to
software units in PNV:
...
ProjectLibrary m_ProjectLibrary = project.ProjectLibrary;
PlcUnitProvider m_UnitProvider = plc.GetService<PlcUnitProvider>();
PlcUnitComposition m_UnitComposition = m_UnitProvider.UnitGroup.Units;
...
MasterCopy mc_Unit_2 = m_ProjectLibrary.MasterCopyFolder.MasterCopies.Find("Unit_2");
m_UnitComposition.CreateFrom(mc_Unit_2);//Recreate a Unit from Project Library to
SoftwareUnits folder
Modify the following program code to recreate unit from mastercopy of global library to
software units in PNV.
...
GlobalLibrary m_GlobalLibrary = m_TiaPortal.GlobalLibraries[0];
...
mc_Unit_2 = m_GlobalLibrary.MasterCopyFolder.MasterCopies.Find("Unit_2");
m_UnitComposition.CreateFrom(mc_Unit_2);//Recreate a unit from Global Library to
SoftwareUnits folder
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Working with software unit (Page 654)
Requirement
• The TIA Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to modify the relations of a PLC units so that you can control
the accessibility of objects existing in other PLC units or outside PLC units.
You can perform the following possible types of modification using TIA Portal Openness:
• Creating new relations
• Deleting existing relations
• Modifying existing relations
Modify the following program code to create a new relation accessing object in another Plc units:
...
//assuming Plc unit "Unit_2" is already existing in the Plc
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create("Unit_2",
UnitRelationType.SoftwareUnit);
...
Modify the following program code to create a new relation accessing PLC data block outside of
Plc units:
...
//assuming Plc data block "Data_block_1" is already existing in the Plc
m_NonUnitDBRelation = m_PlcUnit.Relations.Create("Data_block_1",
UnitRelationType.NonUnitDB);
...
Modify the following program code to create a new relation accessing a Technological object
outside of Plc units:
...
//assuming Technological object "SpeedAxis_1" is already existing in the Plc
m_TODBRelation = m_PlcUnit.Relations.Create("SpeedAxis_1", UnitRelationType.TODB);
...
...
//assuming Plc unit "NonExistingUnit" is not existing in the Plc yet
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create("NonExistingUnit", UnitRelationType.
SoftwareUnit);
...
Note
In the above program code, the relation is created and no exception is thrown.
Modify the following program code to create a new relation by specifying a name for the related
object which is not conform with the TIA naming rules:
...
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create(" Unit_2",
UnitRelationType.SoftwareUnit);
...
Note
In the above program code, the relation is not created and a recoverable exception is thrown due
to leading spaces.
Modify the following program code to create a new relation from unit to itself:
...
//assuming m_PlcUnit is assigned to Plc unit "Unit_1"
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create("Unit_1",
UnitRelationType.SoftwareUnit);
...
Modify the following program code to create a new relation which is duplicate of another
already existing relation with the same relation type and related object:
...
//assuming a relation with the same relation type and related object is already existing
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create("Unit_2",
UnitRelationType.SoftwareUnit);
...
Modify the following program code to create a new relation by specifying an empty string for the
name of the related object:
...
m_SoftwareUnitRelation = m_PlcUnit.Relations.Create(string.Empty,
UnitRelationType.SoftwareUnit);
...
Note
In all of the above program codes for error scenarios, the relation is not created and a recoverable
exception is thrown.
...
m_PlcUnit.Relations[0].Delete();
...
...
m_SoftwareUnitRelation.Delete();
...
private PlcUnitRelation m_Relation;
PlcSoftware plcTarget = GetControllerTargetByPLCName(Session.OpnsProject.Devices, PLCName);
PlcUnitProvider plcUnitProvider = plcTarget.GetService<PlcUnitProvider>();
m_PlcUnit = plcUnitProvider.UnitGroup.Units[0];
//assuming existing units
m_PlcUnit2 = plcUnitProvider.UnitGroup.Units[1];
//assuming existing units
m_Relation = m_PlcUnit.Relations.Create("Unit_2", UnitRelationType.SoftwareUnit);
...
Modify the following program code to update the name of the related object by assigning a new
value for the RelatedObject attribute directly:
...
m_Relation.RelatedObject = "Unit_3";
...
Modify the following program code to update the name of the related object by assigning a new
value for the RelatedObject attribute through SetAttribute:
...
m_Relation.SetAttribute("RelatedObject", "Unit_4");
...
Modify the following program code to update the name of the related object by assigning a new
value for the RelatedObject attribute through SetAttributes:
...
IList attrList = new List<KeyValuePair<string, object>>();
{
new KeyValuePair<string, object("RelatedObject", "Unit_4")
};
m_Relation.SetAttributes(attrList);
...
...
//assuming Plc unit "NonExistingUnit" is not existing in the Plc yet
m_Relation.RelatedObject = "NonExistingUnit";
...
Note
In the above program code, the relation is modified and no exception is thrown.
Modify the following program code to update a relation by specifying a name for the related
object which is not confirm with the TIA naming rules:
...
m_Relation.RelatedObject = " Unit_2";
...
...
//assuming m_Relation is defined under Plc unit "Unit_1"
m_Relation.RelatedObject = "Unit_1";
...
Note
In the above program code, the relation is not modified and a recoverable exception is thrown.
Modify the following program code to update a relation in a way which would be a duplicate of
another already existing with the same relation type and related object:
...
//assuming a relation with the same relation type and related object is already existing
m_Relation.RelatedObject = "Unit_2";
...
Modify the following program code to update a relation by specifying an empty string for the
name of the related object:
...
m_Relation.RelatedObject = string.Empty;
...
Note
In all of the above program codes for errors scenarios, the relation is not modified and a
recoverable exception is thrown.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to navigate to the VCI system group from the project by
accessing a VersionControlInterface from the project as a service. The VersionControlInterface
itself is always a service and will return non-null object.
Program code
Modify the following program code to retrieve the workspace system group from the
VersionControlInterface:
See also
Opening a project (Page 113)
Connecting to the TIA Portal (Page 81)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to enumerate all VCI workspace user groups in other VCI
workspace groups.
Modify the following program code to access individual workspace user group in other VCI
workspace groups:
Siemens.Engineering.VersionControl.WorkspaceUserGroup workspaceUserGroup =
workspaceGroup.Groups.Find("Some Group Name");
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to create a workspace user group in a workspace group.
Program code
Modify the following program code to create a workspace user group:
VersionControlInterface versionControlInterface =
project.GetService<VersionControlInterface>();
WorkspaceSystemGroup workspaceGroupComposition =
versionControlInterface.WorkspaceGroup.Groups;
WorkspaceUserGroup result = workspaceGroupComposition.Create("NewWorkspaceUserGroup");
Note
To create a new workspace user group by name requires that supplied name should be valid and
the supplied name does not already exist on another workspace user group
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to update the properties of workspace user group.
The followiing property is available to update on a workspace group:
Program code
Modify the following program code to update workspace user group name:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to delete workspace user groups. When you are deleting
workspace user groups, all other objects contained in the workspace user group will also get
deleted. This includes other workspace user groups and VCI workspaces.
Program code
Modify the following program code to delete a workspace user group:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a Project (Page 113)
Program code
Modify the followng program code to enumerate all VCI workspaces in a VCI group:
Siemens.Engineering.VersionControl.Workspace workspace =
workspaceUserGroup.Workspaces.Find("SomeWorkspaceName");
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to create a workspace in a workspace user group.
You can create Siemens.Engineering.VersionControl.Workspace with the create action:
Siemens.Engineering.VersionControl.WorkspaceComposition.Create(strin
g name)
Program code
Modify the following program code to create a workspace:
VersionControlInterface versionControlInterface =
project.GetService<VersionControlInterface>();
WorkspaceComposition workspaceComposition =
versionControlInterface.WorkspaceGroup.Workspaces;
Workspace result = workspaceComposition.Create("NewWorkspace");
Note
To create a new workspace by name requires that supplied name should be valid and the name
does not already exist on another workspace user group.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to update the properties of a VCI workspace.
The following properties are available to update on a workspace:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to delete a workspace. When a workspace is deleted all of
the workspace's mappings get also deleted.
Program code
Modify the following program code to delete workspace:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to enumerate all VCI workspace mappings in a workspace:
Modify the following program code to access individual workspace mapping for the specific
engineering object:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to create a workspace mapping in VCI workspace.
You can create Siemens.Engineering.VersionControl.WorkspaceMapping with the create action
signature:
Siemens.Engineering.VersionControl.WorkspaceMappingComposition.Creat
e(string relativeWorkspacePath, IEngineeringObject
linkedProjectObject)
Program code
Modify the following code to create a workspace mapping:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Openness Portal to update the properties of a VCI workspace mapping.
The following properties are available on a workspace mapping.
Program code
Modify the following program code to update the workspace mapping relative file path:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Principle
You can use the TIA Portal Openness to delete a VCI workspace mapping.
Program code
Modify the following program code to delete a VCI workspace mapping:
See also
Connecting to the TIA Portal (Page 81)
Principle
• The Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to view the status of synchronization workspace mapping.
It is recommended to perform a null check before invoking the actions on individual object
synchronization service as that mapping may or may not support individual object
synchronization.
var individualObjectSynchronizationStatus =
workpaceMapping.GetService<IndividualObjectSynchronizationStatus>();
if(individualObjectSynchronizationStatus != null);
{
//GetStatus()...
//UpdateStatus()..
//Synchronize()..
}
The IndividualObjectCompareDetails flag enum is used to inform you about which part of the
workspace mapping has changed (or both). This value will be None when the
CompareState is Equal. If CompareState is unequal, this enum can have a value of
ProjectObjectChanged or WorkspaceFileChanged or both ProjectObjectChanged,
WorkspaceFileChanged.
Modify the following program code to get the status of a workspace mapping:
The SynchronizationMode enum is used to inform the system which direction to perform the
sync:
This action will attempt to sync the linked project object to/from the linked workspace file object.
Modify the following program code to synchronize a workspace:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to create a new project server connection entry in the TIA
Portal settings.
The following method and parameter can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
Protocol protocol = Protocol.Https;
//Protocol protocol = Protocol.Http;
string hostName = "localhost";
uint port = 16000;
ProjectServer projectServer = tiaPortal.ProjectServers.Create(alias, protocol, hostName,
port);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to edit an existing project server connection in the TIA Portal
settings. You can edit protocol, hostname, and port parameters.
The following method and parameter can be accessed using TIA Portal Openness:
Note
If alias name has to be modified, then the project server connection entry has to be deleted and
a new connection has to be created.
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
projectServer.SetProtocol(Protocol.Http);
projectServer.SetHostName("RemoteMachineHostName");
projectServer.SetPort(17000);
:
See also
Opening a project (Page 113)
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to delete the project server connection entry from TIA Portal
settings.
The following method and parameter can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
projectServer.DeleteConnection();
:
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to access connections to the project server from TIA Portal
Settings. The Openness API will position the connections to the project server as direct navigator
of TiaPortal. Connection to the project server are aggregated using the "ProjectServers"
composition of the TiaPortal.
Each instance of ProjectServer represents project server connection configuration. Using the
instance of ProjectServer retrieved from "ProjectServers" composition, you can comfortably
work with the TIA Project server.
Any functionality which involves Multiuser server interactions without opening a local session
can be invoked using this navigator and ProjectServers will be available all the time.
The local windows user will be used to authenticate with the MU Server.
Program code
The behavior is invoked with the following code
...
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
...
The project server has “ServerName” property, referred to the "alias" assigned as the name for the
project server is used as an identifier.
You can use the below code example to access ProjectServer related properties:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add a single-user project to multiuser server. If the
project that is getting added is already opened, then it will be closed.
The following method and parameter name can be accessed using TIA Portal Openness:
Note
For all APIs the local windows user who is running the Openness application/script will be used
to authenticate with the MU Server. So please ensure that the user is added to the MU server and
with the required role for the intended operation. If the user is not authenticated then an
exception will be thrown.
Program code
Modify the following program code to add a single user project to multiuser server:
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
FileInfo projectFileInfo = new FileInfo("C:\\Projects\\Project1\\Project1.ap17");
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
projectServer.AddProjectToServer(projectFileInfo);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A Project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness application to get a list of available server projects info on
the project server. You can use this info to perform operations such as:
• Retrieve list of local session info for a specific server project
• Create a local session for a specific server project
The following method and parameter can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects()
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get a list of avalable session information for a given server
project in the current machine created by the current user.
You can this info to perform further operations such as opening or deleting the local session.
The following parameter and method can be accessing using TIA Portal Openness.
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
IEnumerable<LocalSessionInfo> localSessionsInfo =
projectServer.GetLocalSessions(serverProjectsInfo[0]);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is opening
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to create a local session for a given server project and return
the LocalSessionInfo object.
The type of session Multiuser local session or Exclusive local session can be specified in TIA Portal
Openness. In case the session created is Exclusive local session, then the Server project is
automatically locked.
The following method and parameter name can be accessed using TIA Portal Openness:
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to save the given session. The session would be saved only
if its of type:
• Engineering session
• Exclusive session
A MultiuserException will be thrown if the session is a server project.
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo);
LocalSession localSession = TiaPortal.LocalSessions.Open(localSessionInfo.ProjectFileInfo);
//Edit project
localSession.Save();
:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to delete a given local session. The session will be deleted
from the multiuser server only and the session files in the local disk will not be deleted.
In case the session specified is an Exclusive session then the Server project lock is automatically
removed.
The following method and parameter name can be accessed using the TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo);
projectServer.DeleteLocalSessionFromServer(serverProjectInfo, localSessionInfo);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to open a multiuser local session or exclusive local session
for a given server project and given local session fileinfo and return the LocalSession object of
type engineering session or exclusive session.
In case the session opened is an Exclusive session the Server project is automatically locked.
The following method name and parameters can be accessed using TIA Portal Openness:
Program code
Modify the following program code to open Engineering Session:
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo);
LocalSession multiuserLocalSession =
tiaPortal.LocalSessions.Open(localSessionInfo.ProjectFileInfo);
:
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo, SessionCreationMode.Exclusive);
LocalSession exclusiveSession =
tiaPortal.LocalSessions.Open(localSessionInfo.ProjectFileInfo);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to open a server project for a given local session fileinfo and
returns the LocalSession object of type server project.
The following parameter and method can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo);
LocalSession serverProject =
tiaPortal.LocalSessions.OpenServerProject(localSessionInfo.ProjectFileInfo);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to provide information if the given EngineeringObject is
markable. The TIA Portal Openness also provides marking related information like
• If the object is marked by the current user
• If the object marked by other users
• If the object is up to date
You can also use TIA Portal Openness to get the mark state information of an available
EngineeringObject.
The following method and parameter name can be accessed using TIA Portal Openness:
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to close operation on server project or multiuser session or
exclusive session.
It will discard all pending changes.
The following method can be accessed using TIA Portal Openness:
Program code
Modify the following program code to close server project:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to perform a save operation on changes done in Server
project or exclusive session.
The following method name and parameter can be accessed using TIA Portal Openness:
Program code
Modify the following program to save server project changes:
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo);
LocalSession serverProject =
tiaPortal.LocalSessions.OpenServerProject(localSessionInfo.ProjectFileInfo);
int revisionCreated = serverProject.CloseAndCommit(comment: "Comment");
:
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
string localSessionName = "testLocalSessionName";
DirectoryInfo directoryInfo = new DirectoryInfo("C:\\Sessions");
LocalSessionInfo localSessionInfo = projectServer.CreateLocalSession(serverProjectInfo[0],
localSessionName, directoryInfo, SessionCreationMode.ExclusiveSession);
LocalSession exclusiveSession =
tiaPortal.LocalSessions.Open(localSessionInfo.ProjectFileInfo);
int revisionCreated = exclusiveSession.CloseAndCommit(comment: "Comment");
:
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to return LockStateProvider that can be used to get
information about Server project lock and the lock owner.
The following method and parameter name can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
LockStateProvider lockStateProvider =
projectServer.GetLockStateProvider(serverProjectInfo[0]);
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to return that server project is locked or not. It gets the real
time value by contacting the server.
The following method name can be accessed using TIA Portal Openness:
Program code
:
TiaPortal tiaPortal = new TiaPortal();
string aliasName = "ProjectServer1";
ProjectServer projectServer =
tiaPortal.ProjectServers.First(a=>a.ServerName.Equals(aliasName));
IEnumerable<ServerProjectInfo> serverProjectInfo = projectServer.GetServerProjects();
LockStateProvider lockStateProvider =
projectServer.GetLockStateProvider(serverProjectInfo[0]);
bool isServerProjectLocked = lockStateProvider.IsProjectLocked();
:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to return the information about the server project lock
owner as string. If the project is not locked empty string will be returned.
The following method name can be accessed using TIA Portal Openness:
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to return a session is up-to-date or not.
Th following method name can be accesed using TIA Portal Openness:
Program code
Note
In the above progam code, You have to specify sessionmode either "multiuser" or "exclusive".
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to retrieve all the markings (conflicted, non-conflicted) with
in the local session.
The TIA Portal Openness can be used to retrieve the online/real-time information from the
multiuser server.
The following method can be accessed using TIA Portal Openness:
The following property name can be accessed using TIA Portal Openness:
The TIA Portal Openness API does not return markings on objects which got deleted as openness
framework cannot represent deleted objects.
Note
Conflicted markings means markings that are marked by you and others or marked by you and
outdated or marked by you,marked by others and outdated.
Program code
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness application to protect the TIA Portal project. On Calling this
API, project will be protected and a default Admin User created.
The Protection of a TIA Portal Project will fail under given condition:
• Protecting a previously protected project
• Meta configuration do not exists for at-least one UmacDevice in the project
• Validation fails for provided parameters
If the project protection API call fails, then EngineeringTargetInvocationException will be thrown
to you.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness application to retrieve the following information related to
Engineering function rights:
• Retrieve all Engineering Function Rights present in a TIA Portal Project
• Retrieve a particular Engineering Functions right by Identifier
For Engineering Function Right, Name property value will be based on user interface language.
But Identifier property value will be always constant irrespective of user interface language.
For "Find" API Identier property value should be used.
Program code
tiaProject.ProtectProject("Admin123", ToSecureSting("Admin123"));
UmacConfigurator UmacConfiguratorService = project.GetService<UmacConfigurator>();
//Retrieving Engineering function Rights. Returned list will be empty if called in non-
protected mode
var engineeringFunctionRights = UmacConfiguratorService.EngineeringFunctionRights;
string engineeringFunctionRightIdentifier;
string engineeringFunctionRightName;
//Iterating through Engineering function Rights
foreach (var engineeringFunctionRight in engineeringFunctionRights)
{
engineeringFunctionRightName = engineeringFunctionRight.Name;
engineeringFunctionRightIdentifier = engineeringFunctionRight.Identifier;
}
//Find an Engineering Function Right
var foundEngineeringFunctionRight =
engineeringFunctionRights.Find(engineeringFunctionRightIdentifier);
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
In TIA Portal Openness, Device Function rights are of two types:
• System Device Function Rights
• Custom Device Function Rights
You can use the TIA Portal Openness application to retrieve available device function rights:
• Retrieve all Device Function Rights associated to a device instance. (System and Custom)
• Retrieve all Custom Device Function Rights in the project.
• Create a Custom Device Function Right in the project.
• Retrieve a Custom Device Function Right by Identifier
Note
Creating a Custom Device Function Right will result in throwing
EngineeringTargetInvocationException.
Given Below are some scenarios where Creating a Custom Device Function Right might fail:
• Maximum custom device function rights limit is reached and no more new custom device
function rights possible
• Validation fails for given parameters (like special characters or length)
For System Device Function Right, Name property value will be based on UI language. But
Identifier property value will be always constant irrespective of UI language.
For "Find" API Identifier property value should be used.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can perform the following tasks with custom role and device function rights while using TIA
Portal Openness:
• Retrieve all system roles in a project
• Finding a particular system role in a project.
• Retrieve all assigned engineering rights to a given system role.
• Retrieve all assigned system device function rights for system role
For System Roles, Name property value will be based on user interface language. But Identifier
property value will be always constant irrespective of user interface language.
For "Find" API Identifier property value should be used.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
Custom roles are user created roles which are dynamically created during the course of project
life time.
You can perform the following tasks with custom role while using TIA Portal Openness:
• Retrieve all Custom roles in a project.
• Creating a custom role in a project.
• Finding a particular custom role in a project.
• Editing the attributes(name and comment) of a custom role.
• Deleting a custom role in a project.
• Assigning/ Un assigning an EFR to a custom role.
• Assigning/ Un assigning an DFR to a custom role via a device instance.
• Retrieving Assigned Engineering Function Rights to a Custom Role.
• Retrieving Assigned Device Function Rights to a Custom Role
For Custom Role, Identifier property value will be always constant irrespective of user interface
language. For "Find" API Identifier property value should be used.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
Project users are users created locally for a project. When a Project is protected by default an
Project user is created and is given ES Administrative role.
You can perform the following tasks with project users while using TIA Portal Openness:
• Retrieve all Project users in a project.
• Create a Project user in a project.
• Find a Project user by name in a project.
• Get the Assigned Roles for a Project user.
• Add/ Remove a role to a Project user.
• Activate/Deactivate project user.
• Indicates whether the Project user is Active
Program code
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
In TIA Portal Openness, the UmcServerConfigurator service is introduced to get the list of UMC
Servers. From the UmcServerConfigurator, the list of UMC Servers are obtained through
UmcServers Property. New Event "Authentication" is introduced on the UMC server to connect
to the server.
The service is available in both the modes (protected / unprotected project). When UMC admin
is logged in as an user, then the below authentication event will not be triggered while importing
all umc users / user groups from the umc server. The event will trigger only when the logged user
is other that UMC user having "UMC View" Right at UMC Server. For example, project user, UMC
user who is not having "UMC View" Right at UMC Server.
With TIA Portal Openness V17, only one UMC Server is available and preconfigured.
Program code
The method UmcServer_Authentication will have Event args like below where you can pass the
UMC admin name and password.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to retrieve an UMC User Group from a UMC Server. The
GetUserGroupByName ( ) method is available at UMC server level to get UMC user group of the
connected UMC server.
When the GetUserGroupByName ( ) method is triggered, the event call back triggers for the UMC
Server authentication. Only UMC user having "UMC View" right will be available to retrieve an
UMC user group.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to retrieve an UMC user from a UMC server. The
GetUserByName( ) method is used at the UMC server level to get the corresponding UMC user
from UMC server by the UMC username.
When the GetUserByName( ) method is triggered, the event call back triggers for the UMC Server
Authentication. Only Umc user having "UMC View" Right will be able to fetch a UMC user from
the UMC server.
Program code
Note
All UMC exceptions are handled as Siemens.Engineering.TargetInvocation Exception in TIA
Portal Openness.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add an UMC user group to TIA Portal project from an UMC
server.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get all UMC user groups added to TIA Portal projects.
When there are no UMC user groups, the TIA Portal Openness application will return empty
collection.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add an UMC user to TIA Portal project once the UMC users
are retrieved from UMC server.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get all the UMC users in TIA Portal.
When there are no UMC users, the TIA Portal Openness application will return empty collection.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to find corresponding UMC user from the TIA Portal project.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to find corresponding UMC User group from the TIA Portal
project.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add the corresponding role to the UMC user added to TIA
Portal project.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.15.2.11 Getting the list of assigned roles of UMC User and UMC User Group.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to get the list of assigned roles of UM user and UMC user
group.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to add the corresponding role to the UMC user group added
to TIA Portal project.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.15.2.13 Removing role from UMC User and UMC User Group
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Application to unassign the corresponding role from the UMC user and
UMC user group added to TIA Portal project.
Program code
Modify the following program code to remove role from the UMC user added to TIA Portal
project.
Modify the following program code to remove role from the UMC user group added to TIA Portal
project.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal
• A project is open
See Opening a project
Application
You can use the TIA Portal Opennness to activate / deactivate UMC user and UMC user group.
Program code
5.15.2.15 Checking state for UMC User and UMC User Group
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to retrieve activation state of UMC user and UMC user group.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to delete UMC user and UMC User Group from TIA Portal
project.
Program code
See also
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Program code
Below TIA Portal Openness script describes about the complete workflow of Openness APIs for
UMAC global users and UMC server.
CustomRole customRoleNameForUmcUser =
umacConfigurator.CustomRoles.Create("CustomRoleName");
umcUser.AssignRole(customRoleNameForUmcUser);
//Un assign the System Role.
umcUser.UnassignRole(systemRoleForUmcUser);
//Un assign the Custom Role.
umcUser.UnassignRole(customRoleNameForUmcUser);
//Delete the UMC User from Tia Portal project
UmcUser umcUserToDelete = umacConfigurator.UmcUsers.Find(UmcUserName);
umcUserToDelete.Delete();
}
private static void TiaPortal_Authentication(object sender, AuthenticationEventArgs e)
{
e.AuthenticationTypeProvider = AuthenticationTypeProvider.Credentials;
e.UmacCredentials.Type = UmacUserType.Project;
e.UmacCredentials.Name = "Admin";
e.UmacCredentials.SetPassword(GetSecureString("Admin123"));
}
private static void UmcServer_Authentication(object sender, UmcAuthenticationEventArgs e)
{
e.UmcCredentials.Name = "Admin";
e.UmcCredentials.SetPassword(GetSecureString("Admin123"));
}
private static SecureString GetSecureString(string password)
{
SecureString secureString = new SecureString();
foreach (char c in password)
{
secureString.AppendChar(c);
}
return secureString;
}
}
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness application to configure OPC UA server with security policy
"Basic256Sha256" . The security policy Basic256Sha256 needs to be added to the Runtime
Settings. RDP needs to compile the properties in the xml configuration file.
The defaults are Enabled, Sign, and Sign and Encrypt.
In the XML file <Project>\OPC\uaserver\OPCUaServerWinCCPro.xml, you need to set the security
policy and security policies according to ES device configuration.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
Opening a project (Page 113)
• OPC UA server is activated
Application
You can use the TIA Portal Openness application to set the security policy in OPC UA. You can
implement the security policy as a dynamic attribute of type flagged enum:
OpcUaSecurityPolicies. The security policy is only available in TIA Portal Openness if the OPC UA
server is activated. If the OPC UA server is deactivated, you will encounter
EngineeringNotSupportedException while trying to access the security policy for any other
unavailable attribute.
The below table shows the possible values can be found for security policies:
Program code
Modify the following program code to set the security policy in OPC UA using TIA Portal
Openness:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
5.17.1 Introduction
Introduction
TIA portal openness application allows you to instantiate SiVArc. You must need a client
application to access TIA portal, and through openness feature launch SiVArc services. For more
details on set up, and accessing Openness, see TIA portal user guide.
Following table lists the AlarmRule and AlarmRuleGroup composition. The same applies to other
SiVArc objects.
Requirement
• Launch TIA portal openness application. For more information on connections, see TIA portal
user guide.
• An existing TIA portal project containing screen rule editor, screen rules group and master
copy.
Case 1: When you copy rules/rule groups from master copy to screen rules editor
"The CreateFrom" global library allows rules and rule groups to be copied from the global
library to the SiVarc rule editor. If successful, the API function will return ScreenRule/
ScreenRuleGroup. The following code explains how the rules or rule groups are copied from the
master copy to the SiVArc editor:
Requirement
• TIA portal openness application connected to TIA portal. For more information on
connections, see TIA portal user guide.
• TIA portal project consisting of screen rules and screen rule groups.
Requirement
• TIA portal openness application connected to TIA portal. For more information on
connections, see TIA portal user guide.
• TIA project containing screen rules and screen rule groups.
About UMAC
To access UMAC through openness, ensure that you have the UMAC credentials and access
privileges. If you are not a valid UMAC user, the application will return NULL values for all SiVArc
anchor rule objects. For more information on UMAC, refer UMAC topic in SiVArc user guide.
Requirement
• Launch TIA portal openness application. For more information on connections, see TIA portal
user guide.
• An existing TIA portal project connected to an HMI device, and PLC configured.
SN Values Description
You can viewrecursive feedback messages by using the following code snippet:
5.18.1 Introduction
Using TIA Portal-Openness, you automate the engineering and control the TIA Portal using a
program that you created yourself.
In this help document, you can find a lot of information and code examples for this program that
you generate yourself. You can also generate and use your own programs for the TIA Portal
"SINUMERIK" application.
Further information
Before you generate your own program for SINUMERIK from the sample codes listed in the
following, please note the general information on Openness, which you can find in this help
under the following keywords:
• Preconditions for using TIA Portal Openness
• Installing TIA Portal Openness
• Access the TIA Portal
• TIA Portal Openness object model
• Programming steps
5.18.3 Fundamentals
Overview
You can create the following SINUMERIK devices in the TIA Portal Openness:
• NCU
• NX module
• ADI4
To create the SINUMERIK devices, use the CreateWithItem() method of the Devices
Collection.
Note
All integrated subcomponents of a SINUMERIK-NCU - such as PLC, NCK, CP, HMI and SINAMICS
Integrated - are automatically created at the same subordinate level.
Note
Alternatively, you can omit the parameter names. The default name is used if the name is "Null"
or "String.Empty".
The following table lists the assignment of the devices and their type identifiers:
When creating SINUMERIK devices, place holders in the type identifier are permissible. You can
subsequently replace these placeholders by device-specific characters. If, for example, you enter
type identifier "OrderNumber:6FC5 372-0AA30-0AA0/V4.8", then SINUMERIK 840D sl NCU
720.3 PN is created with firmware version FW4.8.
If you interrogate the value of the device element via the integrated PLC, then for a SINUMERIK
device, this is the value "CPU (1)".
In the Openness object model, the following components act as header modules:
• SINAMICS Integrated
• NX module
• ADI4
In all other cases, the value of the classification attribute "DeviceItemClassification" is
"None" (0).
See also
Creating an NX module (Page 759)
Creating an NCU (Page 758)
Overview
The following diagram describes the objects located under "Device" for SINUMERIK 840D sl:
'HYLFH
5DFN'HYLFH,WHP
&3'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
+0,'HYLFH,WHP
1&.'HYLFH,WHP
3/&'HYLFH,WHP
'3,QWHUIDFH'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
31,(3RUW'HYLFH,WHP
03,'3,QWHUIDFH'HYLFH,WHP
'3,QWHJUDWHG,QWHUIDFH'HYLFH,WHP
6,1$0,&6,QWHJUDWHG3UR[\'HYLFH,WHP
The following diagram describes the objects located under "Device" for SINUMERIK NX
10.3/15.3:
'HYLFH
5DFN'HYLFH,WHP
+HDGPRGXOH'HYLFH,WHP
The following diagram describes the objects located under "Device" for ADI4:
'HYLFH
5DFN'HYLFH,WHP
+HDGPRGXOH'HYLFH,WHP
$[LVVHSDUDWRU'HYLFH,WHP
$[LVVHSDUDWRU'HYLFH,WHP
$[LVVHSDUDWRU'HYLFH,WHP
$[LVVHSDUDWRU'HYLFH,WHP
%ODQNPRGXOH'HYLFH,WHP
%ODQNPRGXOH'HYLFH,WHP
%ODQNPRGXOH'HYLFH,WHP
%ODQNPRGXOH'HYLFH,WHP
%ODQNPRGXOH'HYLFH,WHP
','HYLFH,WHP
'2'HYLFH,WHP
'ULYH'HYLFH,WHP
'ULYH'HYLFH,WHP
'ULYH'HYLFH,WHP
'ULYH'HYLFH,WHP
(QFRGHU'HYLFH,WHP
(QFRGHU'HYLFH,WHP
(QFRGHU'HYLFH,WHP
(QFRGHU'HYLFH,WHP
For more information on TIA Portal Openness object model, see Chapter "TIA Portal Openness
APIl".
5.18.5.1 General
The following code examples describe the basic procedure for various applications. The code is
not necessarily complete or compilable.
Creating an NCU
Parameter format for SINUMERIK NCU:
CreateWithItem(@"OrderNumber:mlfb/
FirmwareVersion/","NameOfTheDevice",positionNumber)
The positionNumber parameter is optional.
The following example shows how you create a SINUMERIK 840D sl NCU 720.3 PN control
system.
The following example shows how you can create a SINUMERIK NX module.
Creating an NX module
project.Devices.CreateWithItem("OrderNumber:6SL3040-1NC00-0AA0/
V5.1", "MyNXDevice", "TestDevice");
Version compatibility
The firmware version of the NX module must match the firmware version of SINAMICS
Integrated - and must be compatible with the firmware version of the NCU.
An NX firmware version that deviates from SINAMICS Integrated cannot be assigned via
Openness.
The following table lists the version compatibility for 840D sl:
The following example shows how you can load the "NetworkInterface" service.
The following example shows how you can connect an NX module with an NCU via
"ProfibusIntegrated":
The DP address is assigned to the fixed NX in Openness via DRIVE-CLiQ port. Each port label has a
fixed DP-integrated address.
The DP address must be assigned to the NX before connection to the NCU.
Note
Effects on telegram configuration
The Safety Integrated mode used affects the telegram configuration because telegrams other
than the ones used for inactive Safety Integrated mode are used in Safety Integrated plus (F-PLC)
mode.
However, added or changed telegrams are retained if they are compatible with the newly
selected Safety Integrated mode.
If applicable, after the mode change in the telegram configuration, ensure that any adjustments
are still available.
You activate and deactivate Safety Integrated (F-PLC) with the SafetyModeProvider service.
Note
The PLC must be in offline mode if Safety Integrated (F-PLC) is being activated or deactivated.
Calling SafetyModeProvider
...
Siemens.Engineering.HW.Device ncu = ...;
try
{
SafetyModeProvider provider = ncu.GetService<SafetyModeProvider>();
//Perform the safety mode change:
provider.SetSafetyMode(SafetyMode.DbSI);
}
catch( (EngineeringException ex) )
{
// Handle safety mode change failure
}
The following example shows how to call the current Safety Integrated setting on the device:
Overview
The following diagram shows the software container and the PLC software in the object model
(Page 767):
'HYLFH
5DFN'HYLFH,WHP
3/&'HYLFH,WHP
6RIWZDUH&RQWDLQHU
3OF6RIWZDUH
The following code example shows how to find a PLC, irrespective of its specific implementation
(integrated SINUMERIK PLC, SIMATIC PLC, software PLC in the PC) based on the "CPU" property:
Finding PLCs
Device ncuDevice = ...
DeviceItem plc = GetPlc(ncuDevice.DeviceItems);
...
DeviceItem GetPlc(DeviceItemComposition deviceItems)
{
if (deviceItems.Count == 0)
{
return null;
}
foreach (var deviceItem in deviceItems)
{
if (deviceItem.Classification == DeviceItemClassifications.CPU)
return deviceItem;
return null;
}
Find out more about accessing the PLC software container under "Accessing software goals".
5.19.1 Introduction
Using TIA Portal-Openness, you automate the engineering and control the TIA Portal using a
program that you created yourself.
In this help document, you can find a lot of information and code examples for this program that
you generate yourself. You can also generate and use your own programs for the TIA Portal
"SINUMERIK" application.
Further information
Before you generate your own program for SINUMERIK from the sample codes listed in the
following, please note the general information on Openness, which you can find in this help
under the following keywords:
• Preconditions for using TIA Portal Openness
• Installing TIA Portal Openness
• Access the TIA Portal
• TIA Portal Openness object model
• Programming steps
5.19.3 Fundamentals
You can create the following SINUMERIK devices in the TIA Portal with Openness:
• NCU
• NX module
• PPU
To create the SINUMERIK devices, use the method CreateWithItem() of the Devices
Collection.
Note
All integrated subcomponents of a SINUMERIK-NCU - such as PLC, NCK, CP, HMI and SINAMICS
Integrated - are automatically created at the same subordinate level.
Note
Alternatively, you can omit the parameter names. The standard name is used if the name is "null"
or "String.Empty".
When creating SINUMERIK devices, place holders in the type identifier are permissible. You can
subsequently replace these placeholders by device-specific characters.
If you interrogate the value of the device element via the integrated PLC, then for a SINUMERIK
device, this is the value "CPU (1)".
In the Openness object model, the following components act as header module:
• SINAMICS Integrated
• NX module
In all other cases, the value of the classification attribute is "DeviceItemClassification" "None" (0).
See also
Creating an NCU (Page 787)
Creating an NX module (Page 787)
Overview
The following diagram describes the objects located under "Device" for SINUMERIK ONE:
'HYLFH
5DFN'HYLFH,WHP
6,1$0,&6,QWHJUDWHG3UR[\'HYLFH,WHP
3/&'HYLFH,WHP
&DUGUHDGHUZULWHU'HYLFH,WHP
23&8$'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
31,(3RUW'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
'3,QWHUIDFH'HYLFH,WHP
1&.'HYLFH,WHP
'3,QWHJUDWHG,QWHUIDFH'HYLFH,WHP
&3'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
31,(,QWHUIDFH'HYLFH,WHP
31,(3RUW'HYLFH,WHP
+0,'HYLFH,WHP
For more information on the TIA Portal Openness object model, see Chapter "TIA Portal
Openness APIl".
Namespace Assembly
Siemens.Engineering.MC.Drive Siemens.Engineering.MC.DriveConfiguration
Configuration (Page 769) in Siemens.Engineering.dll
Siemens.Engineering.MC.Drive Siemens.Engineering.MC.Drives
s (Page 777) in Siemens.Engineering.dll
Note
With the namespace Siemens.Engineering.MC.DriveConfiguration, additional
functions are available, e.g. you can create, delete or reorder drive objects.
In the long term, the namespace Siemens.Engineering.MC.DriveConfiguration
remains. However, the namespace Siemens.Engineering.MC.Drives will still be
supported into the next versions of Openness for compatibility reasons.
The following diagrams describe the objects located under "Device" for SINUMERIK NX 10.3/15.3
(availability of services depends on the namespace).
For new applications, use the namespace Siemens.Engineering.MC.DriveConfiguration (and
thus the DriveObjectCollection service) because the namespace
Siemens.Engineering.MC.Drives (and thus the DriveObjectContainer service) is still supported
for compatibility reasons, but offers less functionality.
'HYLFH
5DFN'HYLFH,WHP
+HDGPRGXOH'HYLFH,WHP
'ULYH2EMHFW&ROOHFWLRQ6HUYLFH
'HYLFH
5DFN'HYLFH,WHP
+HDGPRGXOH'HYLFH,WHP
'ULYH2EMHFW&RQWDLQHU6HUYLFH
5.19.5 Reference
DriveObject
DriveObject
The DriveObject class allows access to the drive object. Using the drive object, the telegram
can be accessed, for example.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the properties of the class:
Name Description
GetAttribute Performs read access to an attribute of a drive object
GetAttributes Performs read access to all attributes of a drive object
GetAttributeInfos Performs read access to information on attributes of a drive object
SetAttribute Performs write access to an attribute of a drive object
SetAttributes Performs write access to all attributes of a drive object
Delete Deletes the drive object instance at which the "Delete" is called
DriveObjectCollection
DriveObjectCollection
The DriveObjectCollection is a service of the drive object (DeviceItem) of the current
device (Device).
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the navigators of the DriveObjectCollection:
Name Description
GetAttribute Performs read access to an attribute of DriveObjectCollection
GetAttributes Performs read access to all attributes of DriveObjectCollection
GetAttributeInfos Performs read access to information on attributes
of DriveObjectCollection
SetAttribute Performs write access to an attribute of DriveObjectCollection
SetAttributes Performs write access to all attributes of DriveObjectCollection
DriveObjectComposition
DriveObjectComposition
The DriveObjectComposition class allows access to available telegrams of a drive object
and contains all of the drive objects of an NCU or NX module.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
Name Description
GetEnumerator Facilitates the iteration over the specified set of elements
Contains Determines whether the specified instance is contained in the set of the ele‐
ments.TRUE: The container contains the instance FALSE: The container does
not contain the instance
IndexOf Returns the index in the set of the elements for the queried instance.
Create Creates a DriveObjectComposition class
Find Searches for a DriveObjectComposition class
DriveObjectCategory
DriveObjectCategory
The enum DriveObjectCategory contains predefined categories of the drive objects. Read
access to DriveObjectCategory is possible.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table contains the predefined categories of the drive objects:
TelegramComposition
TelegramComposition
The TelegramComposition class facilitates the access to the telegrams of a drive object
(DriveObject (Page 769)). The structure of a telegram can be read out via the Telegram
(Page 773) class.
Changes to telegram objects (e.g. changing the safety telegram) can result in the relevant
telegram object being deleted in the TelegramComposition or a new telegram object being
created. In this case, you must search through the TelegramComposition again to find the
new telegram object (Page 773) again after the change.
If the respective drive object does not support telegrams, the value for
TelegramComposition is returned blank.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the properties of the class:
Name Description
Create(enum TelegramId Id) Creates a telegram; the type of the telegram corre‐
sponds to the ID.
int IndexOf(TelegramType) Returns the index in the set of the elements for the
queried instance.
bool Contains Determines as to whether the specified instance is
included in the set of elements.
TRUE: The container contains the instance
FALSE: The container does not contain the in‐
stance
IEnumerator GetEnumerator Allows IEnumerator<DriveObject> the itera‐
tion via the given set of the elements
Telegram
Telegram
The Telegram class allows access to the structure of a telegram from a drive object.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the properties of the class:
Name Description
GetSize(AddressIoType (Page 776)) Returns the size of the inputs or outputs of the telegram.
CanSetSize (AddressIoType Returns true if the size of the telegram can be changed as
(Page 776), Int32, bool) parameterized.
SetSize Performs write access to the telegram size
Delete Deletes the telegram instance at which "Delete" is called
GetAttribute Performs read access to a telegram attribute
GetAttributes Performs read access to all telegram attributes
GetAttributeInfos Performs read access to information on telegram attributes
SetAttribute Performs write access to a telegram attribute
SetAttributes Performs write access to all telegram attributes
The additional properties are accessed via GetAttribute and SetAttribute, e.g.
GetAttribute("Failsafe_FSourceAddress"). Uint32 is expected as return value.
TelegramType
TelegramType
The Enum TelegramType contains predefined telegram types.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
MainTelegram Main telegram: e.g. telegram 136
SupplementaryTelegram Supplementary telegram: e.g. telegram 701
AdditionalTelegram Additional telegram: free telegram
SafetyTelegram Safety telegram: e.g. telegram 903
ProcessMonitoringTelegram Process monitoring telegram, e.g. telegram 1100
Note
The torque telegram (TorqueTelegram) is not supported, although it is available in the TIA
Portal Openness API in the SINUMERIK context.
TelegramPart
TelegramPart
The enum TelegramPart contains the parts of a telegram.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
Unknown Unknown part of a telegram
Overall All parts of a telegram in one telegram: BaseTelegram, Exten‐
sion and PIV1) of a telegram
BaseTelegram Main part of a telegram
Extension Telegram extension
PKW Parameter identification value of a telegram
1)
PKW is not available in the SINUMERIK context.
TelegramId
TelegramId
The enum TelegramId contains the telegram numbers that are relevant for communication
between the PLC and the drive. The IDs are defined via the PROFIdrive standard.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
AddressComposition
AddressComposition
The AddressComposition class represents the address of a telegram.
namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
Note
If you want to navigate back to the telegram via Address.Parent, instead of
namespace Siemens.Engineering.MC.Drives.Telegram,
namespace Siemens.Engineering.MC.DriveConfiguration.Telegram is called.
You can find further information about TIA Portal Openness libraries under "Standard libraries".
AddressIoType
AddressIoType
The Enum AddressIoType contains information on the type of the address.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
Name Description
AddressIoType.None The IO type cannot be used
AddressIoType.Input Type is an input address
AddressIoType.Output Type is an output address
AddressIoType.Diagnosis Type is a diagnosis address
AddressIoType.Substitute Type is a substitute address
You can find further information about TIA Portal Openness libraries under "Standard libraries".
AddressContext
AddressContext
The Enum AddressContext contains information on the context of the address.
Namespace: Siemens.Engineering.MC.DriveConfiguration
Assembly: Siemens.Engineering.MC.DriveConfiguration
in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
AddressContext.None No context has been found for the address
AddressContext.Device Context is a device address
AddressContext.Head Context is a head address
You can find further information about TIA Portal Openness libraries under "Standard libraries".
DriveObject
DriveObject
The DriveObject class allows access to the drive object. Using the drive object, the telegram
can be accessed, for example.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
Name Description
GetAttribute Performs read access to an attribute of a drive object
SetAttribute Performs write access to an attribute of a drive object
GetEnumerator Facilitates the iteration over the specified set of elements
See also
TelegramComposition (Page 779)
DriveObjectContainer
DriveObjectContainer
The DriveObjectContainer is a service of the drive object (DeviceItem) for the current
device (Device).
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the navigators of the DriveObjectContainer:
DriveObjectComposition
DriveObjectComposition
The DriveObjectComposition class facilitates the access to available telegrams of a drive
object.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
TelegramComposition
TelegramComposition
The TelegramComposition class facilitates the access to the telegrams of a drive object
(DriveObject (Page 777)). The structure of a telegram can be read out via the Telegram
(Page 781) class.
Changes to telegram objects (e.g. changing the safety telegram) can result in the relevant
telegram object being deleted in the TelegramComposition or a new telegram object being
created. In this case, you must search through the TelegramComposition again to find the
new telegram object (Page 781) again after the change.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
Name Description
CanInsertAdditionalTelegram(Int32, Returns true if an extension can be created in
Int32) accordance with the parameterized sizes (input
and output sizes).
InsertAdditionalTelegram(Int32, Int32) Creates an extension for the drive object in ac‐
cordance with the parameterized sizes and re‐
turns true if the extension could be inserted.
In the event of an error,
an
EngineeringTargetInvocationExcepti
on is triggered.
CanInsertSupplementaryTelegram(Int32) Returns true if a supplementary telegram can
be created in accordance with the parameterized
telegram number.
InsertSupplementaryTelegram(Int32) Creates the supplementary telegram with the
parameterized telegram number and
returns true if the telegram could be inserted.
In the event of an error,
an
EngineeringTargetInvocationExcepti
on is triggered.
CanInsertSafetyTelegram(Int32) Returns true if a safety telegram can be gener‐
ated corresponding to the parameterized tele‐
gram number.
InsertSafetyTelegram(Int32) Creates the supplementary telegram with the
parameterized telegram number and
returns true if the telegram could be inserted.
In the event of an error,
an
EngineeringTargetInvocationExcepti
on is triggered.
EraseTelegram(TelegramType) Returns true if the parameterized telegram
could be deleted.
Standard telegrams cannot be deleted.
In the event of an error,
an
EngineeringTargetInvocationExcepti
on is triggered.
Find(TelegramType) Returns the Telegram (Page 781) object if it
could be found via the parameterized telegram
type.
null if the telegram is not found.
Example
Telegram telegram =
telegrams.Find(TelegramType.MainTe
legram);
int IndexOf(TelegramType) Returns the index in the set of the elements for
the queried instance.
Name Description
Parent Returns the reference to the higher-level class
(DriveObject).
bool Contains Determines as to whether the specified instance
is included in the set of elements.
TRUE: The container contains the instance
FALSE: The container does not contain the in‐
stance
IEnumerator GetEnumerator Facilitates IEnumerator<DriveObject> the
iteration over the specified set of elements
Telegram
Telegram
The Telegram class allows access to the structure of a telegram from a drive object.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the properties of the class:
Name Description
CanChangeTelegram(Int32) Returns true if the telegram can be changed to the parame‐
terized standard type.
GetSize(AddressIoType (Page 785)) Returns the size of the inputs or outputs of the telegram.
CanChangeSize(AddressIoType Returns true if the size of the telegram can be changed as
(Page 785), Int32, bool) parameterized. Standard telegrams can only be enlarged.
The retention of the previous telegram address is taken into
account when the option is parameterized with true.
Name Description
ChangeSize(AddressIoType Returns true if the size of the telegram could be changed as
(Page 785), Int32, bool) parameterized.
The retention of the previous telegram address is taken into
account when the option is parameterized with true.
GetEnumerator Facilitates the iteration over the specified set of elements
The additional properties are accessed via GetAttribute and SetAttribute, e.g.
GetAttribute("Failsafe_FSourceAddress"). Uint32 is expected as return value.
TelegramType
TelegramType
The Enum TelegramType contains predefined telegram types.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
MainTelegram Main telegram: e.g. telegram 136
SupplementaryTelegram Supplementary telegram: e.g. telegram 701
AdditionalTelegram Additional telegram: free telegram
SafetyTelegram Safety telegram: e.g. telegram 903
Note
The torque telegram (TorqueTelegram) is not supported, although it is available in the TIA
Portal Openness API in the SINUMERIK context.
AddressComposition
AddressComposition
The AddressComposition class represents the address of a telegram.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the properties of the class:
Note
If you want to navigate back to the telegram via Address.Parent, instead of
namespace Siemens.Engineering.MC.Drives.Telegram,
namespace Siemens.Engineering.MC.DriveConfiguration.Telegram is called.
You can find further information about TIA Portal Openness libraries under "Standard libraries".
AddressContext
AddressContext
The Enum AddressContext contains information on the context of the address.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
AddressContext.None No context has been found for the address
AddressContext.Device Context is a device address
AddressContext.Head Context is a head address
You can find further information about TIA Portal Openness libraries under "Standard libraries".
AddressIoType
AddressIoType
The Enum AddressIoType contains information on the type of the address.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the enum entries:
Name Description
AddressIoType.None The IO type cannot be used
AddressIoType.Input Type is an input address
AddressIoType.Output Type is an output address
AddressIoType.Diagnosis Type is a diagnosis address
AddressIoType.Substitute Type is a substitute address
You can find further information about TIA Portal Openness libraries under "Standard libraries".
5.19.5.3 ArchiveProvider
ArchiveProvider
The ArchiveProvider class is used to generate the PLC archives.
Namespace: Siemens.Engineering.HW.Utilities
Assembly: Siemens.Engineering.HW.Utilities
in Siemens.Engineering.dll
Note
If safety is activated, you cannot generate any archive via Openness.
5.19.6.1 General
The following code examples describe the basic procedure for various applications. The code is
not necessarily complete or compilable.
Creating an NCU
Parameter format for SINUMERIK NCU:
CreateWithItem(@"OrderNumber:mlfb/FirmwareVersion/",
"StandardSubrackName", "NameOfTheDevice")
The following example shows how you can create a SINUMERIK ONE NCU 1750 module.
The following example shows how you can create a SINUMERIK NX module.
Creating an NX module
project.Devices.CreateWithItem("OrderNumber:6SL3040-1NC00-0AA0/
V5.2", "MyNXDevice", "TestDevice");
Version compatibility
The firmware version of the NX module must match the firmware version of SINAMICS
Integrated - and must be compatible with the firmware version of the NCU.
An NX firmware version that deviates from SINAMICS Integrated cannot be assigned via
Openness.
The following table lists the version compatibility for SINUMERIK ONE:
The following example shows how you can connect an NX module with an NCU via
"ProfibusIntegrated":
The DP address is assigned to the fixed NX in Openness via DRIVE-CLiQ port. Each port label has a
fixed DP-integrated address.
The DP address must be assigned to the NX before connection to the NCU.
NCK events
According to the SINUMERIK object model (Page 767), the NCK module is a DeviceItem.
With the following attributes of the NCK module, you can access the NCK events and configure
the NCK events in TIA Portal Openness:
All NCK events are triggered via HardwareInterrupt (hardware interrupt OB). The hardware
interrupt OBs interrupt the cyclical program processing due to a hardware event.
The following example shows how to determine the event name for an NCK module:
Note
The PLC must be in offline mode while the archives are being created. The safety mode must not
be active.
You create SINUMERIK archives via the TIA Portal project property HwUtilities with the
SinumerikArchiveProvider service.
Calling SinumerikArchiveProvider
Project project = ...;
SinumerikArchiveProvider archiveProvider =
project.HwUtilities.Find("SinumerikArchiveProvider") as SinumerikArchiveProvider;
if (archiveProvider != null)
{
// Work with the provider
}
The following example shows how to create a PLC archive which contains the hardware
information and all of the data blocks:
try {
// The file extension is required
string archivePath = string.Format(@"D:\some_path\{0}.dsf", plc.Name);
The following example shows how to update the software portions of a previously created
archive:
Note
Effects on telegram configuration
The Safety Integrated mode used affects the telegram configuration because telegrams other
than the ones used for inactive Safety Integrated mode are used in Safety Integrated plus (F-PLC)
mode.
However, added or changed telegrams are retained if they are compatible with the newly
selected Safety Integrated mode.
If applicable, after the mode change in the telegram configuration, ensure that any adjustments
are still available.
You activate and deactivate Safety Integrated (F-PLC) with the SafetyModeProvider service.
Note
The PLC must be in offline mode if Safety Integrated (F-PLC) is being activated or deactivated.
Calling SafetyModeProvider
...
Siemens.Engineering.HW.Device ncu = ...;
try
{
SafetyModeProvider provider = ncu.GetService<SafetyModeProvider>();
//Perform the safety mode change:
provider.SetSafetyMode(SafetyMode.DbSI);
}
catch( (EngineeringException ex) )
{
// Handle safety mode change failure
}
The following example shows how to call the current Safety Integrated setting on the device:
Overview
The following diagram shows the software container and the PLC software in the object model
(Page 767):
'HYLFH
5DFN'HYLFH,WHP
3/&'HYLFH,WHP
6RIWZDUH&RQWDLQHU
3OF6RIWZDUH
The following code example shows how to find a PLC, irrespective of its specific implementation
(integrated SINUMERIK PLC, SIMATIC PLC, software PLC in the PC) based on the "CPU" property:
Finding PLCs
Device ncuDevice = ...
DeviceItem plc = GetPlc(ncuDevice.DeviceItems);
...
DeviceItem GetPlc(DeviceItemComposition deviceItems)
{
if (deviceItems.Count == 0)
{
return null;
}
foreach (var deviceItem in deviceItems)
{
if (deviceItem.Classification == DeviceItemClassifications.CPU)
return deviceItem;
return null;
}
Find out more about accessing the PLC software container under "Accessing software goals".
Preparing telegrams
The drive communication of a SINUMERIK NCU is realized using telegrams via the SINAMICS
Integrated subcomponent and, if applicable, via additionally connected NX modules.
Note
The SINUMERIK NCU and a SINAMICS Integrated are located at the same level in the TIA Portal
Openness object model, and appear under "DeviceComposition" as two different devices.
The following example shows how to find "DriveObjectCollection" via the "Header
module" property:
The SINUMERIK NCU contains a SINAMICS Integrated proxy object with references to SINAMICS
Integrated.
To access a SINAMICS Integrated device or an NX module, from the SINUMERIK NCU navigate to
the DP Integrated interface via NCK. Then determine the PROFIBUS master system and navigate
to the connected slave.
//Create telegram
const int tgrmId = 136;
drvObj.Telegrams.CreateTelegram(tgrmId);
safetyTgrm.SetAttribute("Failsafe_FMonitoringtime", 300);
Remove telegram
using Siemens.Engineering.MC.DriveConfiguration;
//Delete telegram
const int tgrmId = 136;
drvObj.Telegrams.DeleteTelegram(tgrmId);
Extending telegrams
The following example shows how to insert an extension and change the size of a standard
telegram. You require a drive object for access.
Preparing telegrams
The drive communication of a SINUMERIK NCU is realized using telegrams via the SINAMICS
Integrated subcomponent and, if applicable, via additionally connected NX modules.
Note
The SINUMERIK NCU and a SINAMICS Integrated are located at the same level in the TIA Portal
Openness object model, and appear under "DeviceComposition" as two different devices.
The SINUMERIK NCU contains a SINAMICS Integrated proxy object with references to SINAMICS
Integrated.
To access a SINAMICS Integrated device or an NX module, from the SINUMERIK NCU navigate to
the DP Integrated interface via NCK. Then determine the PROFIBUS master system and navigate
to the connected slave.
//Add telegram
const int tgrmNumber = 136;
drvObj.Telegrams.InsertTelegram(tgrmNumber);
//Find telegram
Telegram telegram = drvObj.Telegrams.Find(TelegramType.MainTelegram);
safetyTgrm.SetAttribute("Failsafe_FMonitoringtime", 300);
Telegram telegram =
drvObj.Telegrams.Find(TelegramType.SupplementaryTelegram);
Remove telegram
using Siemens.Engineering.MC.Drives;
//Remove safety telegram
drvObj.Telegrams.EraseTelegram(TelegramType.SafetyTelegram);
Note
You can change, but not delete, a main telegram (MainTelegram).
Extending telegrams
The following example shows how to insert an extension and change the size of a standard
telegram. You require a drive object for access.
5.20.1 Introduction
Using TIA Portal-Openness, you automate the engineering and control the TIA Portal using a
program that you created yourself.
In this help document, you can find a lot of information and code examples for this program that
you generate yourself. You can also generate and use your own programs for the TIA Portal
"Startdrive" application.
Before you configure your own program for Startdrive from the subsequently listed code
example, please carefully observe the general information relating to Openness, which you can
find under the following keywords in this help document:
• Preconditions for using TIA Portal Openness
• Install TIA Portal Openness
• Access the TIA Portal
• TIA Portal Openness object model
• Programming steps
Note
SecureString passwords for secure communication
In order to secure communication between Openness API and the TIA Portal when using
Startdrive Openness functions, use passwords which have been encrypted with a SecureString.
Note
Direction of communication
It is only possible to use SecureString passwords when downloading Openness functions to the
TIA Portal and not in the opposite communication direction.
Note
A SecureString object should never be constructed from a String because the sensitive data is
already subject to the memory persistence consequences of the immutable String class. The
best way to construct a SecureString object is from a character-at-a-time unmanaged source,
such as the Console.ReadKey method.
Note
The API user is responsible for security measures when handling passwords using code.
You can find more information on configuring SecureString passwords in the code examples
download (Page 825) and Creating SecureString passwords (Page 843).
See also
Passwords in TIA Openness (Page 803)
See also
Encrypted communication with SecureString passwords (Page 802)
To read out the TypeIdentifier for a component in the inspector window, proceed as follows:
1. In the device view of the Startdrive project, double-click on the required component.
The inspector window opens. The active component version is shown in the list.
2. The associated TypeIdentifiers are listed in the outer right-hand column.
Example: OrderNumber:6SL3131-7TE23-6Axx
Copy this TypeIdentifier to your Openness application.
5.20.4 References
5.20.4.1 AddressComposition
AddressComposition
The AddressComposition class represents the address of a telegram.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
See also
TelegramType (Page 819)
5.20.4.2 AddressContext
AddressContext
The Enum AddressContext contains information on the context of the address.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
AddressContext.None No context has been found for the address
AddressContext.Device Context is a device address
AddressContext.Head Context is a head address
5.20.4.3 AddressIoType
AddressIoType
The Enum AddressIoType contains information on the type of the address.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
AddressIoType.None The IO type cannot be used
AddressIoType.Input Type is an input address
AddressIoType.Output Type is an output address
AddressIoType.Diagnosis Type is a diagnosis address
AddressIoType.Substitute Type is a substitute address
5.20.4.4 Commissioning
Commissioning
The Commissioning class is used for commissioning a drive. It can be applied
to DriveFunctionInterface or OnlineDriveFunctionInterface. If the user uses the
function for a SINAMICS S drive, it returns the return value zero.
The following table describes the methods of the class:
See also
Setting the SIMOGEAR article number for G115D drives (Page 845)
5.20.4.5 ConfigurationEntry
ConfigurationEntry
Class ConfigurationEntry is used to save parameter data, which can be determined from
the ConfigurationEntryCompositions of a motor or encoder configuration.
The following table describes the properties of the class:
5.20.4.6 DriveDomainFunctions
DriveDomainFunctions
Class DriveDomainFunctions is used to restore the factory settings or the backup of the RAM
content to the ROM.
It can only be applied to an OnlineDriveFunctionInterface object.
For G120 drives, the DriveDomainFunctions object can only be accessed if the Power
Module is connected to the device. Otherwise, null or an exception is returned.
The following table describes the methods of the class:
Name Description
PerformFactoryReset This method is responsible for restoring the factory settings.
PerformRAMtoROMCopyAllDriveObject The date of all drive objects is written from the RAM to the memory card/
hard disk.
5.20.4.7 DriveObject
DriveObject
The DriveObject class allows access to the drive object. Access to the drive parameters or the
telegram is possible via the drive object, for example.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
See also
Determining a drive object (Page 823)
5.20.4.8 DriveObjectActivation
DriveObjectActivation
Class DriveObjectActivation is used to activate the modules or determine the module
status. It can be applied to DriveObjectFunctions from DriveFunctionInterface
or OnlineDriveFunctionInterface.
The following table describes the methods of the class:
Name Description
ChangeActivationState(DriveObjectAc Changes the activation status of the drive object. Returns false if the oper‐
tivationState) ation cannot be completed.
Possible status values:
• Deactivate
• Activate
• DeactivateAndNotPresent
5.20.4.9 DriveObjectContainer
DriveObjectContainer
The DriveObjectContainer is a service of the drive object (DeviceItem) for the current
device (Device).
The following table describes the navigators of the DriveObjectContainer:
5.20.4.10 DriveObjectTypeHandler
DriveObjectTypeHandler
Class DriveObjectTypeHandler is used to switch over the drive object type for every drive
object and to determine the drive object type - as well as all possible drive object types of the
actual drive object. It can only be applied to DriveFunctionInterface.
The following table describes the methods of the class:
Name Description
ChangeDriveObjectType((target)Drive Changes the actual type of the drive object to a new type that can be
ObjectType) selected.
Returns false if the operation cannot be completed.
5.20.4.11 DriveParameter
DriveParameter
The DriveParameter class allows access to a drive parameter. Not all drive parameters are
available for access via Openness.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
See also
Reading and writing parameters (Page 840)
5.20.4.12 DriveParameterComposition
DriveParameterComposition
The DriveParameterComposition class allows access to parameters of the drive. Not all
drive parameters are approved for access via Openness.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
Find(string) Returns the DriveParameter (Page 810) object for which a
search is being made via the name.
null if the parameter is not found
Example
Find("P108[1]");
Find(UInt16, Int32) Returns the DriveParameter (Page 810) object for which a
search is being made via the parameter index and array index.
null if the parameter is not found
Examples
• cu.Find(108, 1);
• cu.Find(51, -1);
WriteParameters(IEnumerable<s Writes values in parameters.
tring>, IEnumerable<string>, With the ignoreErrors = true setting, an attempt is
bool) made to write all values in the event of an error and
an EngineeringTargetInvocationException is trig‐
gered at the end.
For SINAMICS G drives, parameter values can only be written
with a configured Power Module (PM).
Example
List<string> names = new List<string>();
List<string> values = new List<string>();
names.add("p300[0])");
values.add("17");
names.add("p5391[0])");
values.add("20");
5.20.4.13 EncoderConfiguration
EncoderConfiguration
Class EncoderConfiguration saves data of non-Siemens encoders.
• The user must populate the ConfigurationEntryComposition object.
• Object RequiredConfigurationEntries must also be populated.
Namespace: Siemens.Engineering.MC.Drives
Siemens.Engineering.MC.Drives.DFI
Siemens.Engineering.MC.Drives.Enum
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
5.20.4.14 HardwareProjection
Class HardwareProjection is responsible for commissioning the motor and the encoder. The
object can be found for DriveFunctionInterface
and OnlineDriveFunctionInterface.
For G120 drives, motors and encoders can be configured both online and offline. On the other
hand, for S120 drives, configuration is only possible offline.
For G120 drive devices, the HardwareProjection object can only be accessed if the Power
Module is inserted in the drive device. Otherwise, when calling functions
HardwareProjection, a null or an exception is returned.
For an offline configuration, use the hardware configuration of the
DriveFunctionInterface. For an online configuration, use the hardware configuration of
the OnlineDriveFunctionInterface.
Namespace: Siemens.Engineering.MC.Drives
Siemens.Engineering.MC.Drives.DFI
Siemens.Engineering.MC.Drives.Enums
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the methods of the class:
Name Description
SetMotorType(MotorType type, Sets the motor type at the Control Unit (only for G120).
ushort driveDataSet)
GetCurrentMotorConfiguration( Depending on the data set number of the drive, determines
ushort driveDataSet) the currently existing configuration area.
ProjectMotorConfiguration(Mot Configures the motor configuration of a drive device depend‐
orConfiguration motConfig, ing on the data set number of the drive.
ushort driveDataSet)
SetEncoder(EncoderType type, Sets the encoder at the Control Unit (only for G120).
EncoderInterface
interfaceType,
AbsoluteIncrementalFlag
absIncFlag, RotaryLinearFlag
rotLinFlag, ushort
encDataSet)
GetCurrentEncoderConfiguratio Depending on the data set number of the encoder, deter‐
n(ushort encDataSet) mines the currently existing configuration area.
ProjectEncoderConfiguration(E Configures the motor configuration of a drive device depend‐
ncoderConfiguration ing on the data set number of the encoder.
encConfig, ushort encDataSet)
5.20.4.15 MotorConfiguration
MotorConfiguration
Class MotorConfiguration is responsible for commissioning motors and encoders.
Namespace: Siemens.Engineering.MC.Drives
Siemens.Engineering.MC.Drives.DFI
Siemens.Engineering.MC.Drives.Enums
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
5.20.4.16 OnlineDriveObject
OnlineDriveObject
The OnlineDriveObject class allows online access to the drive object. Drive parameters can
be accessed via the drive object.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
See also
Determining a drive object (Page 823)
Reading and writing parameters (Page 840)
Reading and writing parameters online (Page 842)
5.20.4.17 OnlineDriveObjectContainer
OnlineDriveObjectContainer
The OnlineDriveObjectContainer is a service of the drive object (DeviceItem) for the
current device (Device).
5.20.4.18 StartDriveDownloadCheckConfiguration
StartDriveDownloadCheckConfiguration
Class StartDriveDownloadCheckConfiguration is derived from the
class DownloadCheckConfiguration and has the same properties.
Class DownloadCheckConfiguration is described in the standard Openness help.
The class provides the configuration settings via checkboxes from the user.
The following table describes the properties of the class:
See also
Download (Page 825)
5.20.4.19 SafetyTelegram
SafetyTelegram
Class SafetyTelegram stands for the telegram of the drive object.
Exception EngineeringTargetInvocationException is displayed for errors in the write
attributes.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the properties of the class:
5.20.4.20 Telegram
Telegram
Class Telegram allows access to the structure of a telegram from a drive object.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
CanChangeTelegram(Int32) Returns true if the telegram can be changed to the parame‐
terized standard type.
GetSize(AddressIoType (Page 806)) Returns the size of the inputs or outputs of the telegram.
CanChangeSize(AddressIoType Returns true if the size of the telegram can be changed as
(Page 806), Int32, bool) parameterized. Standard telegrams can only be enlarged.
The retention of the previous telegram address is taken into
account when the option is parameterized with true.
ChangeSize(AddressIoType Returns true if the size of the telegram could be changed as
(Page 806), Int32, bool) parameterized.
The retention of the previous telegram address is taken into
account when the option is parameterized with true.
5.20.4.21 TelegramComposition
TelegramComposition
The TelegramComposition class allows access to the telegrams of a drive object. The
structure of a telegram can be read out via class Telegram (Page 817).
Note that referenced objects may become invalid through class TelegramComposition. For
example, object Telegram (Page 817) becomes invalid after the telegram size is changed.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
CanInsertAdditionalTelegr Returns true if an extension can be created in accordance with the
am(Int32, Int32) parameterized sizes (input and output sizes).
CanInsertTorqueTelegram When adding a new torque telegram with an already existing tele‐
(Int32, telegramNumber) gram number, checks whether this is possible.
CanInsertSupplementaryTel Returns true if a supplementary telegram can be created in ac‐
egram(Int32) cordance with the parameterized telegram number.
EraseTelegram(TelegramTyp Deletes a telegram with a known telegram type from the drive ob‐
e) ject.
Returns true if the parameterized telegram could be deleted.
If a torque telegram is used as type, then object "torqueTelegram" is
deleted.
If a Safety Integrated telegram is used as type, then object "safety‐
Telegram" is deleted.
Standard telegrams cannot be deleted.
In the event of an error,
an EngineeringTargetInvocationException is initiated.
Find(TelegramType) Returns the Telegram (Page 817) object if it could be found via the
parameterized telegram type or Safety Integrated telegram type.
null if the telegram is not found.
If a torque telegram is used as type, then object torqueTelegram
is returned, assuming that it exists.
If a Safety Integrated telegram is used as type, then
object safetyTelegram is returned, assuming that it exists.
Example
Telegram telegram =
telegrams.Find(TelegramType.MainTelegram);
Name Description
InsertAdditionalTelegram( Creates an extension for the drive object in accordance with the
Int32, Int32) parameterized sizes and returns true if the extension could be
inserted.
In the event of an error,
an EngineeringTargetInvocationException is initiated.
InsertTorqueTelegram Adds a new torque telegram with an already existing telegram
(Int32, telegramNumber) number to a drive object.
InsertSafetyTelegram Adds a Safety Integrated telegram with its specified telegram num‐
(Int32, telegramNumber) ber to a drive object.
InsertSupplementaryTelegr Creates the supplementary telegram with the parameterized tele‐
am(Int32) gram number and returns true if the telegram could be inserted.
In the event of an error,
an EngineeringTargetInvocationException is initiated.
5.20.4.22 TelegramType
TelegramType
The Enum TelegramType contains predefined telegram types.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following table describes the syntax of the class:
Name Description
MainTelegram ID of the main telegram
SupplementaryTelegram ID of the supplementary telegram
AdditionalTelegram ID of an extension
5.20.4.23 TorqueTelegram
TorqueTelegram
Class TorqueTelegram stands for the telegram of the drive object.
Exception EngineeringTargetInvocationException is displayed for errors in the write
attributes.
Namespace: Siemens.Engineering.MC.Drives
Assembly: Siemens.Engineering.MC.Drives in Siemens.Engineering.dll
The following code examples describe the basic procedure for various applications. The code is
not necessarily complete or compilable.
// dfi can be null in case of the actual driveobject does not support it.
Device s120Device =
tiaproject.Devices.CreateWithItem(@"OrderNumber:6SL3246-0BA22-1FA0/4.7.6/"
, "Device_0", null);
Device s120Device =
tiaproject.Devices.CreateWithItem(@"OrderNumber:6SL3040-1MA01-0Axx/V4.8/
S120", "Device_0", null);
//S device
Project project = portal.Projects.Open("..."); //Destination folder to
open the project
DeviceItem item = project.Devices[0].Items[0];
DriveObject driveObject =
item.GetService<DriveObjectContainer>().DriveObjects[0];
//S device
Project project = portal.Projects.Open("..."); //Destination folder to
open the project
DeviceItem item = project.Devices[0].Items[0];
OnlineDriveObject onlineDriveObject =
item.GetService<OnlineDriveObjectContainer>().OnlineDriveObjects[0];
// dfi can be null in case of the actual driveobject does not support it.
// driveObjectTypeHandler can be null, if the actual driveObject does not support it.
//Call the ChangeDriveObjectType method with the current drive object type.
//The method parameter should be the target drive object type.
driveObjectTypeHandler.ChangeDriveObjectType(possibleDriveObjectTypes[0]);
5.20.5.8 Download
After starting the download, you must adapt and confirm the configuration settings. The
configuration settings are provided as child objects of object DownloadConfiguration – and
there are three different types:
• StartDriveDownloadCheckConfiguration
• DownloadSelectionConfiguration
• DownloadPasswordConfiguration
The following examples show the evaluation of the different types of configuration settings in
the PreDownload Delegate.
DownloadPasswordConfiguration downloadPasswordConfiguration =
configuration as DownloadPasswordConfiguration;
if (downloadPasswordConfiguration != null)
{
SecureString s = new SecureString();
string passwordText = "password";
foreach (var str in passwordText)
{
s.AppendChar(str);
}
downloadPasswordConfiguration.SetPassword(s);
return;
}
DownloadSelectionConfiguration downloadSelectionConfiguration =
configuration as DownloadSelectionConfiguration;
if (downloadSelectionConfiguration != null)
{
downloadSelectionConfiguration.SelectedIndex = 0;
return;
}
}
ConnectionConfiguration connConfiguration =
downloadProvider.Configuration;
ConfigurationMode configurationMode = connConfiguration.Modes.Find("PN/
IE");
ConfigurationPcInterface pcInterface = configurationMode.PcInterfaces[0];
ConfigurationSubnet subnet = pcInterface.Subnets.Find(/*subnet name*/);
IConfiguration configuration = subnet.Addresses.Find(/*IP address of the
device*/);
downloadProvider.Download(configuration, pre, post,
DownloadOptions.Software);
}
catch (Exception e)
{
Console.WriteLine(e.Message);
}
See also
Encrypted communication with SecureString passwords (Page 802)
Device device =
tiaproject.Devices.CreateWithItem(@"OrderNumber:6SL3040-1MA01-0Axx/V4.8/
S120", "Device_0", null); //Create the device
NetworkPort subModulDQ =
((IEngineeringServiceProvider)subModulDQInterface.DeviceItems[0]).GetServi
ce<NetworkPort>(); //We need the DriveCliq port of the DQ interface from
the submodul
NetworkPort cuDQ =
((IEngineeringServiceProvider)cuDQInterface.DeviceItems[0]).GetService<Net
workPort>(); //We need the DriveCliq port of the DQ interface
from the CU
The following example shows how you can localize or generate a Startdrive project.
The following example shows how you can determine as to whether a specific Startdrive variant
(package and version) is installed.
Setting the encoder type and/or the encoder data set number offline via the hardware configuration
using Siemens.Engineering.MC.Drives
using Siemens.Engineering.MC.Drives.DFI
using Siemens.Engineering.MC.Drives.Enums;
Setting the encoder type and/or the encoder data set number offline via the hardware configuration
DeviceItem cuDeviceItem = m_Device.DeviceItems[1];
DriveObject cuDriveObject =
cuDeviceItem.GetService<DriveObjectContainer>().DriveObjects[0];
DriveFunctionInterface cuDriveFunctionInterface =
cuDriveObject.GetService<DriveFunctionInterface>();
HardwareProjection hardwareProjection = cuDriveFunctionInterface.HardwareProjection;
hardwareProjection.SetEncoder(
EncoderInterface.Terminal,
EncoderType.HTLTTL,
AbsoluteIncrementalFlag.Incremental,
RotaryLinearFlag.Rotary,
1);
The following example shows how you can set the encoder type or the encoder data set number
using an online connection.
Setting the encoder type and/or the encoder data set number online via the hardware configuration
using Siemens.Engineering.MC.Drives
using Siemens.Engineering.MC.Drives.DFI
using Siemens.Engineering.MC.Drives.Enums;
Setting the encoder type and/or the encoder data set number online via the hardware configuration
DeviceItem cuDeviceItem = m_Device.DeviceItems[1];
OnlineDriveObject cuOnlineDriveObject =
cuDeviceItem.GetService<OnlineDriveObjectContainer>().OnlineDriveObjects[0];
OnlineDriveFunctionInterface cuDriveFunctionInterface =
cuOnlineDriveObject.GetService<OnlineDriveFunctionInterface>();
HardwareProjection hardwareProjection = cuDriveFunctionInterface.HardwareProjection;
hardwareProjection.SetEncoder(
EncoderInterface.Terminal,
EncoderType.HTLTTL,
AbsoluteIncrementalFlag.Incremental,
RotaryLinearFlag.Rotary,
1);
The following example shows how you can read out the actual encoder configuration from the
drive.
encoderProjection.SetEncoder(
EncoderInterface.Terminal,
EncoderType.HTLTTL,
AbsoluteIncrementalFlag.Incremental,
RotaryLinearFlag.Rotary,
1);
EncoderConfiguration encoderConfiguration =
encoderProjection.GetCurrentEncoderConfiguration(1);
The following example shows how you can configure the actual encoder configuration offline.
DriveObject cuDriveObject =
cuDeviceItem.GetService<DriveObjectContainer>().DriveObjects[0];
DriveFunctionInterface cuDriveFunctionInterface =
cuDriveObject.GetService<DriveFunctionInterface>();
HardwareProjection hardwareProjection = cuDriveFunctionInterface.HardwareProjection;
hardwareProjection.SetEncoder(
EncoderInterface.Terminal,
EncoderType.HTLTTL,
AbsoluteIncrementalFlag.Incremental,
RotaryLinearFlag.Rotary,
1);
The following example shows how you can configure the actual encoder configuration online.
// GoOnline...
// To use these function in Online, you have to use the OnlineDriveFunctionInterface
OnlineDriveObject onlineDriveObject =
cuDeviceItem.GetService<OnlineDriveObjectContainer>().OnlineDriveObjects[0];
OnlineDriveFunctionInterface onlineDfi =
onlineDriveObject.GetService<OnlineDriveFunctionInterface>();
HardwareProjection hardwareProjection = onlineDfi.HardwareProjection;
hardwareProjection.SetEncoder(
EncoderInterface.Terminal,
EncoderType.HTLTTL,
AbsoluteIncrementalFlag.Incremental,
RotaryLinearFlag.Rotary,
1);
The following example shows how you can write the configuration entry to the console.
// dfi can be null in case of the actual driveobject does not support it.
// hardwareProjection can be null, if the actual driveObject does not support it.
// For example: On G120 drives, you have to use the CU as driveobject. On S120
// drives, you have to use the MotorModul as driveObject.
The following example shows how you can configure G120 drive devices online.
The following examples show how you can read out the motor type for G120 drives from the
drive:
The following example shows how you can create a motor configuration for G120 drives:
config.RequiredConfigurationEntries.ToList().ForEach(ce =>
{
switch (ce.Number)
{
case 305:
ce.Value = 20;
break;
case 307:
ce.Value = 30;
break;
case 311:
ce.Value = 200;
break;
case 304:
ce.Value = 450;
break;
case 310:
ce.Value = 50;
break;
case 335:
ce.Value = 1;
break;
default:
break;
}
});
bool result =
cuDriveFunctionInterface.HardwareProjection.ProjectMotorConfiguration(config, 0);
Access to parameters
using Siemens.Engineering.MC.Drives;
Access to parameters
//Access a parameter via its name
DriveParameter parameter = driveObject.Parameters.Find("p5391[0]");
Access to parameters
}
// For example: On G120 and S210 drives, you have to use the CU to get the
onlineDriveObject.
// Please, pay attention at S120 drives. Here you can use any module (CU, MotorModul,
lineModul) as onlineDriveObject but preferable the CU, because it will run on CU!
The following example shows how you can copy the parameterization for S120, S210 or G120
drives from RAM to ROM - and therefore retentively save the parameter assignment.
//In case of S120 and S210 device you should generally get the CU driveobject.
DeviceItem cuDeviceItem = m_Device.DeviceItems[0];OnlineDriveObject cuDriveObject =
cuDeviceItem.GetService<OnlineDriveObjectContainer>().OnlineDriveObjects[0];
return securePwd;
See also
Encrypted communication with SecureString passwords (Page 802)
safetyTgrm.SetAttribute("Failsafe_FMonitoringtime", 300);
See also
Commissioning (Page 806)
5.21.1 Introduction
Using TIA Portal-Openness, you automate the engineering and control the TIA Portal using a
program that you created yourself.
In this help document, you can find a lot of information and code examples for this program that
you generate yourself. You can also generate and use your own programs for the TIA Portal "DCC"
application.
Before you generate your own program for DCC from the sample codes listed in the following,
please note the general information on Openness, which you can find in this help under the
following keywords:
• Preconditions for using TIA Portal Openness
• Installing TIA Portal Openness
• Accessing the TIA Portal
• TIA Portal Openness object model
• Programming steps
Introduction
With TIA Portal Openness V16, you program applications that are automated in TIA Portal
engineering.
Note
Subcharts
Charts that contain subcharts can be imported using Openness. However, Openness cannot be
used to access subcharts.
Additional information
See TIA information system "Openness: Automate project creation".
Overview
The following diagram describes the DCC Openness object model:
5.21.4 References
5.21.4.1 DriveControlChartContainer
DriveParameter
DriveControlChartContainer is a service that represents the DCC chart container under a
DriveObject, so that it can be retrieved from the appropriate DriveObject. The service is not
provided if the DriveObject is not from a supported device.
5.21.4.2 DriveControlChartComposition
DriveControlChartComposition features
DriveControlChartComposition lists the available charts.
See also
DriveControlChartComposition exceptions (Page 860)
DccImportResultData (Page 851)
DriveControlChart (Page 852)
DccImportOptions (Page 851)
5.21.4.3 DccImportOptions
DccImportOptions
These settings are possible when importing charts:
• DccImportOptions.None:
The import has been successfully completed if there is no name conflict. Otherwise
exception DccImportChartWithSameNameAlreadyAvailableException is thrown.
• DccImportOptions.RenameOnConflict:
If there is a chart name conflict, the CFC automatically assigns a name to the newly imported
chart. For example, if a chart with the name CFC_1 already exists on import, then the newly
imported chart is assigned name CFC_2.
See also
DriveControlChartComposition (Page 850)
5.21.4.4 DccImportResultData
DriveParameter
DccImportResultData contains information about the result when importing charts.
See also
DriveControlChartComposition (Page 850)
5.21.4.5 DriveControlChart
DriveControlChart Features
DriveControlChart corresponds to a chart within the chart container (Openness does not
support subcharts).
The following table describes the attributes of the DriveControlChart:
See also
DriveControlChart Exceptions (Page 859)
DriveControlChartComposition (Page 850)
Deleting a chart (Page 856)
ImportDCBextensionlibrary
The following table describes the Methods of ImportDCBextensionlibrary:
5.21.5.1 General
The following code examples describe the basic procedure for various applications. The code is
not necessarily complete or compilable.
Accessing a DriveControlChartContainer
using Siemens.Engineering.MC.Drives;
using Siemens.Engineering.MC.Drives.DCC;
Project project = portal.Projects.Open("..."); //Destination folder to
open the project
DeviceItem item = project.Devices[0].Items[0];
DriveObject
driveObject = item.GetService<DriveObjectContainer>().DriveObjects[0];
DriveControlChartContainer
chartContainer = driveObject.GetService<DriveControlChartContainer>();
//chartContainer can be null in case the DriveObject does not support DCC.
Retrieving charts
Accessing charts
// or looping...
foreach(DriveControlChart chart in charts)
{
...
}
Importing charts
try
{
DriveControlChartComposition charts = ...
DccImportResultData result = charts.Import(@"c:\Charts.dcc",
DccImportOptions.None);
}
catch (DccImportException exc)
{
}
See also
DCC Openness (Page 848)
Exporting charts
try
{
DriveControlChart chart;
...
chart.Export(@"c:\CFC_1.dcc");
}
catch (DccExportException exc)
{
}
See also
DCC Openness (Page 848)
See also
DCC Openness (Page 848)
Retrieving charts
Finding charts
See also
DCC Openness (Page 848)
Deleting charts
try
{
DriveControlChart chart;
...
chart.Delete();
}
{
}
See also
DCC Openness (Page 848)
DriveControlChart (Page 852)
try
{
DriveControlChart chart;
...
chart.OptimizeRunSequence();
}
catch (DccLicenseUnavailableException exc)
{
}
See also
DCC Openness (Page 848)
try
{
Project myProject;
...
myProject.ProjectLibrary.ImportDcbLibrary(@"c:\GMCV5_1_sinamics5_1_(5.1.15
).zip");
}
catch (DccImportException exc)
{
}
See also
DCC Openness (Page 848)
Exception handling
For applications that could fail because of user error, DCC Openness throws a DCC specific
exception derived from EngineeringTargetInvocationException. These exceptions
are hierarchical, which means that all specific exceptions are derived from the higher-level
exception DccException:
If client does not want to evaluate or distinguish between different error causes, then the
simplest way is to catch the general DccException:
try
{
Project myProject;
…
myProject.ProjectLibrary.ImportDcbLibrary(@"c:\GMCV5_1_sinamics5_1_(5.1.15
).zip");
...
DriveControlChartContainer chartContainer = driveObject.GetService<DriveC
ontrolChartContainer>();
chartContainer.Charts.Import(@"d:\Charts.dcc", DccImportOptions.None);
}
catch (DccException exc)
{
}
If you wish to respond based on the type of error, then catch all relevant exceptions:
try
{
DriveControlChartContainer
chartContainer = driveObject.GetService<DriveControlChartContainer>();
chartContainer.Charts.Import(@"d:\Charts.dcc", DccImportOptions.None);
}
catch (DccImportLibraryIsMissingException missingLibExc)
{
}
catch (DccImportChartWithSameNameAlreadyAvailableException sameNameExc)
{
}
catch (DccImportException exc)
{
}
catch (DccException exc)
{
}
Exceptions
Exceptions that can be thrown when exporting:
• DccExportException:
Is thrown for all export error types.
Exceptions that can be thrown when executing the function to optimize the sequence in which
charts are run.
• DccLicenseUnavailableException:
Is thrown if a DCC license is not available. In this case, the function to optimize the run
sequence is not available.
See also
DriveControlChart (Page 852)
Exceptions
Exceptions that can be thrown when importing:
• DccImportException:
General import exception, which DCC throws in the case of an import error.
• DccImportBlockCreationException:
Is thrown if a block was not able to be created when being imported.
• DccImportBlockTypeNotFoundException:
Is thrown if a referenced DCB block type was not able to be found in a standard DCBLib or in
an extension library.
• DccImportChartCreationException:
• Is thrown if a chart was not able to be created when being imported.
• DccImportChartWithSameNameAlreadyAvailableException:
Is thrown if a chart with the same name already exists in the chart container and
DccImportOptions.None is used.
• DccImportLibraryIsMissingException:
Is thrown if a referenced DCB Extension library does not exist in the project.
• DccImportFileAlreadyInUseException:
Is thrown if the file being imported is already being used in another process.
• DccImportDcbTypeDifferentVersionAlreadyUsedException:
Is thrown if a DCB type in a different version of the same DCB Extension library is already being
used in the device.
See also
DriveControlChartComposition (Page 850)
Exceptions
Exceptions thrown by ImportDcbLibrary:
• DccImportException:
Is thrown for all import error types.
• DccLibraryImportAlreadyAvailableException:
Is thrown if the same version of the DCB Extension library already exists in the project.
• DccLibraryImportCorruptedStudioLibraryException:
Is thrown if the DCB Extension library zip file is corrupted and cannot be imported.
• DccLibraryImportIntegrityBrokenException:
Is thrown if the zip file of the DCB Extension library is corrupted.
• DccLibraryImportOverallPinLimitExceededException:
Is thrown if the DCB Extension library contains a DCB type that exceeds the maximum
number of pins permitted.
• DccLibraryImportStandardLibraryAlreadyAvailableException:
Is thrown if the DCB Extension library selected for import is the standard DCBLib, and already
exists.
• DccLibraryImportUnsupportedLibraryTypeException:
Is thrown if the selected DCB Extension library is not supported by DCC and SINAMICS drives.
5.22 Exceptions
Exceptions when accessing the TIA Portal via TIA Portal Openness APIs
During the execution of an TIA Portal Openness application via the TIA Portal Openness API, all
errors which occur are reported as exceptions. These exceptions contain information that will
help you to correct the errors which have occurred.
Program code
The following example shows the options you have for responding to exceptions:
try
{
...
}
catch(EngineeringSecurityException engineeringSecurityException)
{
Console.WriteLine(engineeringSecurityException);
}
catch(EngineeringObjectDisposedException engineeringObjectDisposedException)
{
Console.WriteLine(engineeringObjectDisposedException.Message);
}
catch(EngineeringNotSupportedException engineeringNotSupportedException)
{
Console.WriteLine(engineeringNotSupportedException.MessageData.Text);
Console.WriteLine();
foreach(ExceptionMessageData detailMessageData in
engineeringNotSupportedException.DetailMessageData)
{
Console.WriteLine(detailMessageData.Text);
}
}
catch (EngineeringTargetInvocationException)
{
throw;
}
catch (EngineeringException)
{
//Do not catch general exceptions
throw;
}
catch(NonRecoverableException nonRecoverableException)
{
Console.WriteLine(nonRecoverableException.Message);
}
Requirement
Making changes in the F-Program is only allowed in the Offline mode. In other cases an exception
is thrown.
If an F-Program password has been set, the client needs to be logged in, in order to make
changes in the F-Program. Otherwise, the client is reminded about the need to login to the F-
Program beforehand with an exception.
The TIA Portal Openness application is connected to TIA Portal.
See "Connecting to the TIA Portal (Page 81)".
Openness service
The Openness interface (Siemens.Engineering.dll) has been extended with
the GlobalSettings service (see name area Siemens.Engineering.Safety) which
provides two actions:
• SafetyModificationsPossible(bool safetyModificationsPossible)
• UsernameForFChangeHistory(string userName)
The Openness interface (Siemens.Engineering.dll) has been extended with the
SafetySignatureProvider service which provides three actions:
• SafetySignatureComposition Signatures
• UInt64 SafetySignature.Value
• SafetySignatureType SafetySignature.Type
The Openness interface (Siemens.Engineering.dll) is extended by the service
SafetyAdministration with the following actions and properties in the namespace
Siemens.Engineering.Safety.
• bool IsSafetyOfflineProgramPasswordSet
• void SetSafetyOfflineProgramPassword(SecureString newPassword)
• void RevokeSafetyOfflineProgramPassword(SecureString
currentPassword)
• bool IsLoggedOnToSafetyOfflineProgram
• void LoginToSafetyOfflineProgram(SecureString currentPassword)
• void LogoffFromSafetyOfflineProgram()
The Openness interface (Siemens.Engineering.dll) is extended by the service
SafetyAdministration, which is accessible from a Plc-DeviceItem. The
SafetyAdministration provides the following properties defined in the namespace
Siemens.Engineering.Safety. This two properties contain further properties that are listed in
the following section.
• RuntimegroupComposition RuntimeGroups { get; }
• SafetySettings Settings { get; }
The Openness interface (Siemens.Engineering.dll) is extended by the service
SafetyPrintout with the following action in the namespace
Siemens.Engineering.Safety:
• bool Print(SafetyPrintoutFilePrinter filePrinter, FileInfo
fullOutputPath, string documentLayout, SafetyPrintoutOption
documentationOption);
Principle
Get the Safety.GlobalSettings service from the TiaPortal instance:
Engineering.Safety.GlobalSettings globalSettings =
TiaPortal.GetService<Engineering.Safety.GlobalSettings>();
5.23.2 SafetyModificationsPossible
Application
The SafetyModificationsPossible(bool safetyModificationsPossible)
action of the GlobalSettings service is used to prevent changes to the safety program in TIA
Portal.
When the parameter safetyModificationsPossible is true, TIA Portal behaves
according to the current safety settings for the safety program.
If the parameter safetyModificationsPossible is false, all changes to the safety
program are locked, regardless of whether the user has already entered the password for
changing the safety program or not. The system uses feedback messages to provide information
that the current user is not authorized to change the safety program.
If no password has been configured or assigned for the safety program,
safetyModificationsPossible false has no effect. This means the safety program can be
changed. However, the setting up of new passwords is blocked.
The table below shows the parameters required by the method:
Program code
Prevent changes to the safety program:
globalSettings.SafetyModificationsPossible(false);
5.23.3 UsernameForFChangeHistory
Application
The action UsernameForFChangeHistory(string userName) specifies the user name
that is used by TIA Portal for subsequent logging in the F-change history.
The maximum length of the string is limited to 256 characters. Strings which exceed the
maximum length are cut off.
An empty user name (zero or empty string) resets the user name to the default value.
The table below shows the parameters required by the method:
Program code
Sets the preferred user name:
globalSettings.UsernameForFChangeHistory("username");
5.23.4 SafetySignatureProvider
The signatures read out give a first indication about changes to F-blocks. For plant acceptance,
continue as described in the section entitled "System acceptance" in the "SIMATIC Safety -
Configuring and Programming" manual.
Application
Signatures: SafetySignatureComposition returns a collection
of SafetySignature objects. Objects of this type have a property
of SafetySignature.Value: UInt64, which return an integer value for the F-signature. In
addition, the property SafetySignature.Type: SafetySignatureType, which returns
the type of the F-signature, encapsulated in the SafetySignature instance.
If the F-signature does not exist or is no longer valid due to a recent change, 0 is returned. This
also applies to blocks without an F-signature (e.g. system blocks).
Program code
Get the SafetySignatureProvider service from the PlcBlock instance.
SafetySignatureProvider signatureProvider =
block.GetService<SafetySignatureProvider>()
If the block is not an F-block or not a block of an F-CPU S7-1200/1500, signatureProvider
returns null.
If there is a non-nullable block, you can query the F-signature with the following code:
SafetySignature signature =
signatureProvider.Signatures.Find(SafetySignatureType.BlockOfflineSi
gnature);
UInt64 value = signature.value;
5.23.5 SafetyAdministration
5.23.5.1 SafetyAdministration
This features are available for S7-1200/1500 F-CPUs.
A valid Safety license must be installed for actions and setting values. A missing license will result
in an exception. Reading values is possible without a license.
Program code
Obtain the SafetyAdministration service from the PLC DeviceItem instance at hand.
SafetyAdministration safetyAdministration =
deviceItem.GetService<SafetyAdministration>();
// check if the service is not null
if (safetyAdministration != null)
{
// ...
}
5.23.5.2 IsSafetyOfflineProgramPasswordSet
Program code
bool isPasswordSet =
safetyAdministration.IsSafetyOfflineProgramPasswordSet
Application
The property IsSafetyOfflineProgramPasswordSet returns true if the safety program
password is set.
5.23.5.3 SetSafetyOfflineProgramPassword
Program code
if (!safetyAdministration.IsSafetyOfflineProgramPasswordSet)
{
SecureString newPassword = new NetworkCredential("", "new
password").SecurePassword;
safetyAdministration.SetSafetyOfflineProgramPassword(newPassword);
}
Application
The action SetSafetyOfflineProgramPassword sets the safety program password if it
isn't set before. After the password is set successfully, the user is not logged ininto the safety
program. The LoginToSafetyOfflineProgram action needs to be called explicitly to
perform a login.
The user gets feedback in the form of an exception in the following cases.
• The given password is invalid (e.g. length equals 0 or is greater than 30)
• The given password is null
• A safety program password is already set
• If the Euchner key or UMAC is in use, manipulating the safety program password via
Openness is not allowed
• The user is not offline
• Safety license is not present
5.23.5.4 RevokeSafetyOfflineProgramPassword
Program code
if (safetyAdministration.IsSafetyOfflineProgramPasswordSet)
{
SecureString password = new NetworkCredential("",
"password").SecurePassword;
safetyAdministration.RevokeSafetyOfflineProgramPassword(password);
}
Application
The action RevokeSafetyOfflineProgramPassword clears the F-Program password if it's
correct.
After the password was revoked successfully, the user can set a valid new F-Program password
with the action SetSafetyOfflineProgramPassword.
The user gets feedback in the form of an exception in the following cases.
• If no password is set, it cannot be revoked
• The given password is null
• If the Euchner key is in use, manipulating the F-Program password via Openness is not
allowed
5.23.5.5 IsLoggedOnToSafetyOfflineProgram
Program code
bool isLoggedOn =
safetyAdministration.IsLoggedOnToSafetyOfflineProgram
Application
The property IsLoggedOnToSafetyOfflineProgram returns true if a password is set and
the user is logged on.
5.23.5.6 LoginToSafetyOfflineProgram
Program code
if (!safetyAdministration.IsLoggedOnToSafetyOfflineProgram)
{
SecureString password = new NetworkCredential("",
"password").SecurePassword;
safetyAdministration.LoginToSafetyOfflineProgram(password);
}
Application
The action LoginToSafetyOfflineProgram logs-in the user into the safety program if the
passed password is correct. After a successful login changes to the safety program can be
made.
The user gets feedback in the form of an exception in the following cases.
• A safety program password is not set
• The password is null
• The password is wrong
• The Euchner key is in use
• The user is not offline
• Safety license is not present
5.23.5.7 LogoffFromSafetyOfflineProgram
Program code
if (safetyAdministration.IsLoggedOnToSafetyOfflineProgram)
{
safetyAdministration.LogoffFromSafetyOfflineProgram();
}
Application
This action LogoffFromSafetyOfflineProgram the user from the safety program. Thus,
it's not possible to make changes to the safety program anymore.
The user gets feedback in the form of an exception in the following cases.
• A safety program password is not set
• The Euchner key is in use
• The user is not offline
• Safety license is not present
Runtime Groups
Program code
foreach (RuntimeGroup runtimeGroup in
safetyAdministration.RuntimeGroups)
{
// access the properties on the RuntimeGroup object...
}
RuntimeGroup runtimeGroup1 =
safetyAdministration.RuntimeGroups.Find("RTG1");
Application
The property RuntimeGroups returns all runtime groups. Furthermore, one specific runtime
group can be retrieved by using the Find method. The Find method returns null if a runtime
group with the given name does not exist.
The following properties can be accessed from a RuntimeGroup instance at hand.
Program code
string name = runtimeGroup.Name;
Application
Returns the name of the runtime group.
FOB Name
Program code
string name = runtimeGroup.FOBName;
Application
Returns the FOB name or null if no FOB is set.
FOB EventClass
Program code
string eventClass = runtimeGroup.FOBEventClass;
Application
Returns the FOB event class or null if no FOB is set.
FOB Number
Program code
Int32 number = (Int32) runtimeGroup.GetAttribute("FOBNumber");
runtimeGroup.SetAttribute("FOBNumber", 123);
Application
Returns and sets the FOB number. If the FOB number is not available, null is returned. If the value
is set and no FOB is available, an exception is thrown.
Program code
Int32 cycleTime = (Int32) runtimeGroup.GetAttribute("FOBCycleTime");
runtimeGroup.SetAttribute("FOBCycleTime", 100000);
Application
Returns and sets the cycle time of the runtime group. If the value is not available, null is returned.
If the set value is not available or within the valid range, an exception is thrown.
Program code
Int32 phaseShift = (Int32)
runtimeGroup.GetAttribute("FOBPhaseShift");
runtimeGroup.SetAttribute("FOBPhaseShift", 120);
Application
Returns and sets the Fail-safe organization block's phase shift of the runtime group. If the value
is not available, null is returned. If the set value is not available or within the valid range, an
exception is thrown.
FOB Priority
Program code
Int32 priority = (Int32) runtimeGroup.GetAttribute("FOBPriority");
runtimeGroup.SetAttribute("FOBPriority", 10);
Application
Returns and sets the Fail-safe organization block's priority of the runtime group. If the value is
not available, null is returned. If the set value is not available or within the valid range, an
exception is thrown.
Program code
string mainSafetyName = runtimeGroup.MainSafetyBlockName;
Application
Returns the name of the main safety block or null if no block is set.
Program code
string mainSafetyIDbName = runtimeGroup.MainSafetyBlockIDbName;
Application
Returns the name of the main safety's IDb block or null if no block is set.
Program code
Int32 warnCycleTime = runtimeGroup.WarnCycleTime;
runtimeGroup.WarnCycleTime = 110000;
Application
Returns and sets the warn cycle time of the runtime group. If the set value is not within the valid
range, an exception is thrown.
Program code
Int32 maximumCycleTime = runtimeGroup.MaximumCycleTime;
runtimeGroup.MaximumCycleTime= 120000;
Application
Returns and sets the maximum cycle time of the runtime group. If the set value is not within the
valid range, an exception is thrown.
Program code
string infoDbName = runtimeGroup.InfoDbName;
Application
Returns the information DB name of the runtime group.
Pre Processing
Program code
string preProcessingName = runtimeGroup.PreProcessingName;
Application
Returns the name of the pre processing FC or null if no FC is set.
PostProcessing
Program code
string postProcessingName = runtimeGroup.PostProcessingName;
Application
Returns the name of the post processing FC or null if no FC is set.
Safety settings
Program code
SafetySettings settings = safetyAdministration.Settings;
Application
The property SafetySettings returns a container for the following properties that can be
accessed from the returned instance.
Program code
AssignmentOfBlockNumbers blockNumbers =
settings.AssignmentOfBlockNumbers;
ushort fromFBNumber = blockNumbers.FromFB;
ushort toFBNumber = blockNumbers.ToFB;
ushort fromFCNumber = blockNumbers.FromFC;
ushort toFCNumber = blockNumbers.ToFC;
ushort fromDBNumber = blockNumbers.FromDB;
ushort toDBNumber = blockNumbers.ToDB;
Application
Gets or sets the block numbers generated by the safety system. If a number is set and the value
is not within the valid range, an exception is thrown. If a number is set and the management
mode is FSystemManaged, an exception is thrown.
Program code
SafetySystemVersion version = settings.SafetySystemVersion;
IList<SafetySystemVersion> versions =
settings.GetApplicableSafetySystemVersions();
settings.SafetySystemVersion = versions.Last();
Application
Gets or sets the Safety system version of the F-CPU.
With GetApplicableSafetySystemVersions() a list of the applicable Safety system
versions for the corresponding F-CPU can be fetched. The received list is sorted by recency.
With .Last() the latest version is received.
A specific version can also be fetched by selecting an item from the applicable Safety system
version list.
Program code
bool safetyModeCanBeDisabled = settings.SafetyModeCanBeDisabled;
settings.SafetyModeCanBeDisabled = true;
Application
Gets or sets whether the Safety mode can be disabled.
Program code
bool activationOfFChangeHistory =
settings.ActivationOfFChangeHistory;
settings.ActivationOfFChangeHistory = true;
Application
Gets or sets the activation of the F-change history.
Program code
bool consistentUpload = (bool)
settings.GetAttribute("EnableConsistentUploadFromFCpu");
settings.SetAttribute("EnableConsistentUploadFromFCpu", true);
Application
Gets or sets whether the consistent upload from a F-CPU is enabled. This setting is only available
for read and write on specific F-CPUs.
Program code
bool fCommunicationIdTag = (bool)
settings.GetAttribute("EnableFCommunicationIdTag");
settings.SetAttribute("EnableFCommunicationIdTag", true);
Application
Gets or sets whether the F-Communication ID tag is enabled.
For safety assessment of this information refer to the manual "SIMATIC Safety – Configuring and
Programming".
Program code
bool prefix = settings.CreateDriverInstanceDataBlocksWithoutPrefix;
settings.CreateDriverInstanceDataBlocksWithoutPrefix = true;
Application
Gets or sets whether the names of the F-I/O DBs are created without prefix.
Program code
settings.CleanSystemGeneratedObjects();
Application
Cleans up the system generated objects by the compile.
5.23.6 SafetyPrintout
This feature is available for S7-1200/1500 F-CPUs.
Program code
Obtain the SafetyPrintout service from a DeviceItem instance at hand. Then call
the Print() function on this service. This function returns true on success.
SafetyPrintout printoutService =
deviceItem.GetService<SafetyPrintout>();
if (printoutService != null) {
FileInfo path = new FileInfo(@"C:\safety_printout.pdf");
bool success =
printoutService.Print(SafetyPrintoutFilePrinter.MicrosoftPrintToPdf,
path, "DocuInfo_ISO_A4_Portrait", SafetyPrintoutOption.All)
}
Application
The action Print(...) of the service SafetyPrintout is used to trigger the safety printout
with the given parameters. The given function returns true on a successful printout.
The given path needs to be valid in order to save the printout.
For the printout a given documentLayout (e.g. "DocuInfo_ISO_A4_Portrait") can be set.
Furthermore, a All or Compact safety printout is selectable with the documentationOption
parameter.
Furthermore, the selected digital printer (SafetyPrintoutFilePrinter enum) in the
system is used to create the digital safety printout. The "Microsoft Print to PDF" or "Microsoft XPS
Document Writer" printer can be selected. These printers are available and are activated by
default on Windows 10 ("Microsoft XPS Document Writer" since Windows 7). For the printout to
succeed, the selected printer needs to be activated. If this is not the case, these printers can be
enabled in the Windows feature window by executing the following file after pressing the
Windows + R keys.
optionalfeatures.exe
Introduction
You can export certain configuration data and then re-import the data to the same or a different
project after editing.
Note
There are no obligations or guarantees of any kind associated with using this description to
manually modify and evaluate the source file. Siemens therefore accepts no liability arising from
the use of all or part of this description.
Restrictions
The export format is internal and valid exclusively for the current version of TIA Portal Openness.
The export format may change in future versions.
All errors which occur during the import and export are reported as exceptions.
For more information on exceptions, see section Handling exceptions (Page 862).
See also
Field of application for Import/Export (Page 881)
Exporting configuration data (Page 884)
Introduction
The Import/Export functionality allows you to export specific objects in a targeted manner.
You can edit the exported data in an external program, or reuse it unchanged in other TIA Portal
projects.
If you structure the import file correctly, you can also import configuration data created
externally without having to carry out an export first.
Note
If you import externally created configuration data which contain code errors or a wrong
structure this could cause unexpected errors.
Field of application
Exporting and importing data is useful for the following tasks:
• For externally editing configuration data.
• For importing externally-created configuration data, e.g. text lists and tags.
• For distributing specified configuration data to different projects, e.g. a modified process
screen which is to be used in several projects.
• For replicating and adjusting the hardware configuration between the TIA Portal project and
an ECAD program.
See also
Basic principles of importing/exporting (Page 879)
Application
As of TIA Portal Openness V14 SP1 the SimaticML import is useable cross-version. You will be
able to import your older export files at least into the next two major versions.
Each version of the Openness API is able to import Simatic ML files from corresponding version
and any supported version from previous release, for example import of Simatic ML file V15,
V15.1 and V16 will be supported in Openness API V17.
The following table shows an example of which Simatic ML version can be imported by a given
Openness API version.
Openness Simatic ML file V15 Simatic ML file Simatic ML V16 Simatic ML V17
API version V15.1
V15 Import supported Import unsuppor‐ Import unsup‐ Import unsupported
ted ported
V15.1 Import supported Import supported Import unsup‐ Import unsupported
ported
V16 Import supported Import supported Import suppor‐ Import unsupported
ted
V17 Import supported Import supported Import suppor‐ Import supported
ted
Note
V14SP1 Siemens.Engineering.dll will not be available as part of TIA Portal Openness V17.
Each version of the Openness API supports export of Simatic ML files. However, the version of the
exported Simatic ML file should match with the version of the TIA Portal rather than that of the
Openness API used.
To support this feature, SimaticML files contains the model version information as shown below:
Note
If the version information is not provided in the SimaticML file, the system will use the current
model version.
Introduction
Use an XML editor or text editor for editing an XML file for importing configuration data.
If you are making comprehensive changes or are creating custom object structures, we
recommend that you use an XML editor with auto-complete function.
Note
Changing the XML content requires comprehensive knowledge of the structure and validation
rules in XML. Work manually in the XML structure only in exceptional cases in order to avoid
validation errors.
Introduction
The configuration data of each start object (root) is exported separately to an XML file.
Editing the export file requires an adequate knowledge of XML. Use an XML editor for more
convenient editing.
Example
You have a process screen that contains an IO field. An external tag is configured in the IO field.
An export of the process screen includes the screen and the IO field. The tag and the connection
used by the tag are not exported. Instead, only an open reference is included in the export.
Note
Export of object types from the library is not supported
You can create objects as a type in the library. Instances of the object type used in the project can
be edited like other objects using the TIA Portal Openness application. When you export objects,
the instances are exported without the type information.
When you re-import these objects into the project, the instances of the object types are
overwritten and the instance is detached from the object type.
The export file does not necessarily contain all the attributes of an object. You define what data
is to be exported:
• ExportOptions.None
This setting exports only the modified data or the data that differs from the default.
The export file also contains all values that are obligatory for the subsequent data import.
• ExportOptions.WithDefaults1
The default values are also exported.
• ExportOptions.WithReadOnly1
The write-protected values are also exported.
1
: You can combine these two options with the following syntax:
Export(path,ExportOptions.WithDefaults |
ExportOptions.WithReadOnly);
The entire contents of the export file are in English. Regardless of this, any project texts
contained are exported and imported in all the languages present.
All configuration data is modeled as XML objects in the export file.
See also
Basic principles of importing/exporting (Page 879)
Exporting blocks (Page 998)
Introduction
Configuration data is imported from a previously exported and edited XML file or from an XML
file you have created yourself. The data contained in this file is checked during the import. This
approach prevents the configuration data in the TIA Portal from becoming inconsistent as a
result of the import.
Restrictions
• All root objects in the import file have to be of the same kind, e.g. tag tables, blocks, ...
• If an import file includes several root objects and one of them is not valid, the entire contents
of the import file are not imported.
• When importing texts, the corresponding project languages must have been set up in the
target project in order to exclude import failure. If necessary you can modiy the language
settings via TIA Portal Openness.
• If you specify invalid attributes of an object in the import file that cannot be edited in the
graphical user interface of TIA Portal, the import is canceled.
• Only the area pointers listed in the "separately for each connection" field can be imported or
exported.
• The import of object types from the library is not supported. You can create objects as a type
in the library. Instances of the object type used in the project can be edited like other objects
using the TIA Portal Openness application. When you export objects, the instances are
exported without the type information. When you re-import these objects into the project,
the instances of the object types are overwritten and the instance is detached from the object
type.
Note
Device-dependent value ranges for graphical attributes
If values of graphical attributes exceed the valid value range, these values are reset to the
possible maximum values for the HMI device during import.
See also
Basic principles of importing/exporting (Page 879)
Importing user data type (Page 1032)
Introduction
The export of configuration data from the TIA Portal to the XML file does not include selected
graphics, or graphics referenced by an object. The graphics are saved separately during the
export. In the XML file, the graphics are referenced by a relative path and their file name. A
graphic reference is modeled in the XML file as an object and contains an attribute list and, if
necessary, a link list, just like the other objects.
Exporting graphics
The export of configuration data includes only graphics that were selected directly for export.
The exportable graphics are stored in the TIA Portal for the specific language. If a project is
configured in multiple languages, all the language versions used are exported.
When you export graphics, a new folder is created in the export file folder. The file folder name
is built by concatenating the xml-filename with " files". This folder contains the exported
graphics. If this folder exists already, a new folder is created and supplemented by a consecutive
number.
The graphics are saved in the same file format as in the project. The data format is not changed
or converted, and the resolution and color depth remain unchanged.
The ID "default" is used as the file extension for the language selected as the default language.
If the folder already contains a file of the same name, the file name of the exported graphic is
supplemented by a consecutive number.
Importing graphics
The following requirements apply when importing graphics:
• The graphics must have a file format that is supported by TIA Portal.
• The graphics must be referenced in the XML file by a relative path specification.
Once you have exported a graphic, you can edit it outside TIA Portal using a graphics program
and then re-import it.
See also
Basic principles of importing/exporting (Page 879)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can export either a single graphic or all graphics of the graphics collection of a project in all
languages. An XML file with all project graphic entries concerned is created during the export
and referenced along with the exported graphics. The relevant graphics are saved along with the
XML file to the same directory of the file system.
To allow the exported graphics ("*.jpg", "*.bmp", "*.png", "*.ico", etc.) to be changed, these
graphics are not write-protected.
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
An XML file is saved along with the language versions of a graphic to a directory of your file
system.
You can reference all graphics in a relative path in the XML file.
You can now import all language versions of a graphic contained in the XML file to the graphics
collection.
You should also observe the Importing configuration data (Page 885).
Program code
Modify the following program code to import one or several graphics:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
In TIA Portal you can find project texts below the "Languages & resources" node of a project.
These texts are exported to a "*.xlsx" file which is used for example for translations. The
limitations of exporting and importing project texts are the same as in the UI. These limitations
include:
• Exported texts can only be imported into the project from where they were exported.
• You can only translate texts to languages that are available in in the project. If necessary you
can add project languages via TIA Portal Openness.
• Only existing texts can be re-imported, if text from the original project has been deleted or
re-created the import for that text will fail.
You have to define the following parameters:
Note
Multilingual texts will be exported together with the parent object to which they belong.
Multilingual texts can not be exported explicitly.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
In TIA Portal you can find project texts below the "Languages & resources" node of a project. You
can import project texts from a ".xlsx" file which is used for example for translations. The
limitations of exporting and importing project texts are the same as in the UI. These limitations
include:
• Exported texts can only be imported into the project from where they were exported.
• You can only import translated texts in languages that are available in project from where
they were exported.
• Only existing texts can be re-imported, if text from the original project has been deleted or
re-created the import for that text will fail.
You have to define the following parameters:
Note
Multilingual texts will be imported together with the parent object to which they belong.
Multilingual texts can not be imported explicitly.
Program code
The use of the example parameters leads to the following program code to import project texts:
The import of the Project Texts returns an object indicating the status of the Import and path to
which the import log is saved. These attributes can be accessed with the following code:
Introduction
The data in the export file from the import/export is structured with reference to a basic
structure.
,QIRUPDWLRQ
DERXWWKH
GRFXPHQW
6FUHHQREMHFW
+PL6FUHHQ6FUHHQ,' ಯಯ!
$WWULEXWH/LVW!
$FWLYH/D\HU!$FWLYH/D\HU!
$WWULEXWHVRIWKH
%DFN&RORU!%DFN&RORU!
VFUHHQREMHFW
1DPH!6FUHHQB1DPH!
$WWULEXWH/LVW!
/LQN/LVW!
/LQNVIURPWKH 7HPSODWH7DUJHW,' ಯ#2SHQ/LQNಯ!
6FUHHQREMHFW
VFUHHQREMHFWWR 1DPH!7HPSODWHB1DPH!
RWKHUREMHFWV 7HPSODWH!
/LQN/LVW!
2EMHFW/LVW!
ORZHUOHYHO
REMHFWV 2EMHFW/LVW!
+PL6FUHHQ6FUHHQ!
See also
Basic principles of importing/exporting (Page 879)
Objects
The basic structure is the same for all objects.
Every object in the XML file starts with its type, for example, "Hmi.Screen.Button", and an ID. The
ID is created automatically during export.
Each object apart from the start object also contains an "CompositionName" XML attribute. The
value for this attribute is preset. It is occasionally necessary to specify this attribute, for example,
to change the label when a button is pressed or released.
Attributes
Every object contains attributes that are contained in an "AttributeList" section. Every attribute
is modeled as an XML element, e.g. "BackColor". The value of an attribute is modeled as XML
content, e.g. "204, 204, 204".
For referencing objects, each object contains a "LinkList" section, if necessary. This section
contains links to other objects inside or outside the XML file. Every link is modeled as an XML
element. The designation of a link is defined by the target object in the schema file. Every link
also contains the "TargetID" attribute. When the target object is included in the XML file, the
value of the "TargetID" attribute is the ID of the referenced object preceded by a "#". When the
target object is not included in the XML file, the value of the "TargetID" attribute is "@OpenLink".
The actual reference to the object is modeled as subordinate XML element.
Figure 6-1 Relation between the WinCC user interface and the XML structure.
Figure 6-2 Relation between the settings in WinCC and the XML structure.
6.3.1.3 Cycles
Exporting cycles
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The TIA Portal Openness API interface supports the export of all cycles of a known HMI device to
an XML file. The generation of the corresponding export file indicates that the export is
complete.
Program code
Modify the following program code to export cycles from an HMI device to an XML file:
Importing cycles
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
When you use ImportOptions.None, you can identify the cycles that have actually been
imported based on the composition number (Composition count). You have access to these
imported cycles.
Note
Standard cycles have attributes that cannot be edited in the user interface. If you specify in the
import file that these attributes should be changed, the import causes a
NonRecoverableException and closes the TIA Portal.
Program code
Modify the following program code to import one or several cycles from an XML file into an HMI
device:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
One XML file is exported per HMI tag table. The API supports this export process. The export of
tag tables is also available in subfolders.
Program code: Exporting all HMI tag tables from a specified folder
Modify the following program code to export all HMI tag tables from a specific folder:
if (table != null)
{
FileInfo info = new FileInfo(string.Format(@"C:\OpennessSamples\TagTables\{0}.xml",
table.Name));
table.Export(info, ExportOptions.WithDefaults);
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to import the HMI tag table of an XML file to a user-defined
folder or to a system folder:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following object model object types may possibly exist as sublevel items of an HMI tag and
are taken into account during export:
Program code
Modify the following program code to export an individual tag from an HMI tag table to an XML
file:
if (myTag != null)
{
FileInfo info = new FileInfo(string.Format(@"C:\OpennessSamples\Tags\{0}.xml",
myTag.Name));
myTag.Export(info, ExportOptions.WithDefaults);
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following object model object types may possibly exist as sublevel items of an HMI tag and
are taken into account during import:
Program code
Modify the following program code to import an HMI tag from an XML file into an HMI tag table:
Introduction
Special considerations apply to the export and import of the following HMI tags:
• External HMI tags with integrated connection
• HMI tags with the "UDT" data type
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Special considerations for the export/import of an external HMI tag with integrated connection
When exporting an external HMI tag with integrated HMI connection, only the link of the HMI
tag to the PLC tag is saved in the export file instead of the PLC tag data.
Before the import, you must ensure that the PLC, the corresponding PLC tags and the integrated
connection to the corresponding PLC exist in the project. If this is not the case, these items must
be created before the import. During the subsequent import of the external HMI tag, the link to
the PLC tag will be activated again.
Names of external HMI tags must be unique across all tag tables of a project. If you do not specify
the suitable tag table for the HMI tag during import, the import is canceled.
Use the following XML structure to import an external HMI tag with integrated connection:
Special considerations for the export/import of an HMI tag of the "UDT" data type
The link is exported to the data type when an HMI tag of the "UDT" data type is exported. Only
versioned data types are supported for import.
The data types must be saved in the project library. Data types in the global library are not
supported.
The following rules apply to the import:
• The referenced data type must be contained in the project library.
The import is terminated if the data type is not contained in the project library.
• The referenced data type must be versioned. Versioning is supported as of TIA Portal V13 SP1.
An exception is thrown if the data type is not versioned.
Note
The first data type found is used during the import to resolve the reference.
The following applies here: First, the root directory of the project library is searched, then the
subfolders.
Use the following XML structure to import an HMI tag of the "UDT" data type:
6.3.3 VB scripts
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
All sublevel user-defined folders are taken into account for the export. A separate XML file is
created for each exported VB script.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A separate XML file is created for each exported VB script.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
Bulk imports are supported. As an alternative, you can use a program code with a Foreach loop
(Exporting VB scripts (Page 907)).
Program code
Modify the following program code to import a VB script from an XML file into an HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The export of text and graphic lists includes all their entries. Text and graphic lists can be
exported separately.
The text lists of an HMI device are exported. A separate XML file is created for each exported text
list.
Program code
Modify the following program code to export text lists from an HMI device:
//Export TextLists
private static void ExportTextLists(HmiTarget hmitarget)
{
TextListComposition text = hmitarget.TextLists;
foreach (TextList textList in text)
{
FileInfo info = new FileInfo(string.Format(@"D:\Samples\Export\{0}.xml",
textList.Name);
textList.Export(info, ExportOptions.WithDefaults);
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API interface supports the import of a text list from an XML file into an HMI device.
Program code
Modify the following program code to import a text list from an XML file into an HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• Standard export of text lists
See Exporting text lists from an HMI device (Page 910)
• Standard import of text lists
See Importing text lists into an HMI device (Page 910)
Application
A text list may also contain formatted texts. This primarily concerns the following formatting:
• Text formatting
• References to other objects within the text
Pure text formatting within a text list to be exported results in an advanced XML export format.
Object references are characterized as Open Links. The same applies to text lists to be imported
with formatted texts.
Advanced XML export formats may also become considerably more complex. For example, more
than just the object name may be linked in the text list, perhaps by means of an Open Link to a
PLC tag of a different device. In this case, all information must be coded in a string in order to
remove the Open Link.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The export of text and graphic lists includes all their entries. Text and graphic lists can be
exported separately.
One XML file is created per graphic list. Global graphic objects contained in the graphic lists are
exported as Open Links.
Program code
Modify the following program code to export graphic lists of an HMI device:
//Exports GraphicLists
private static void ExportGraphicLists(HmiTarget hmitarget)
{
GraphicListComposition graphic = hmitarget.GraphicLists;
foreach (GraphicList graphicList in graphic)
{
FileInfo info = new FileInfo(string.Format(@"D:\Samples\Export\{0}.xml",
graphicList.Name));
graphicList.Export(info, ExportOptions.WithDefaults);
}
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API interface supports the import of a graphic list from an XML file into an HMI device.
All referenced graphic objects of the graphic list are included in the import. References to global
graphics are not included. If the referenced global graphics exist in the target project, the
references to the global graphics are restored during the import.
Program code
Modify the following program code to import a graphic list from an XML file into an HMI device:
6.3.6 Connections
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API interface supports the export of all connections of an HMI device to an XML file.
Note
Export of integrated connections
Export of integrated connections is not supported.
Program code
Modify the following program code to export all connections of an HMI device to an XML file:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API interface supports the import of all connections of an HMI device from an XML file into
an HMI device. If you want to import several communication connections, import the
corresponding XML file for each one.
Note
If you import a connection into a project in which an integrated connection has already been
configured, this connection is not overwritten. The import is canceled and an Exception is
thrown.
Program code
Modify the following program code to import an individual connection of an HMI device from an
XML file into an HMI device:
6.3.7 Screens
Application
You can export or import the screens below using TIA Portal Openness APIs:
You can export or import the screen objects below using TIA Portal Openness APIs:
See also
Basic principles of importing/exporting (Page 879)
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
A different program code is required for exporting all aggregated screens of all user-defined
screen folders of an HMI device.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of a screen is exported:
Screen Data
Attributes ActiveLayer, BackColor, Height, Width, Name, Number, HelpText
Open links Template
Compositions • Layers
• Animations
All configured animations that are based on Runtime Advanced are exported.
• Events
All configured events that are based on Runtime Advanced are exported.
• Softkeys
All configured softkeys are exported.
Note
By default, the layer name in the TIA Portal is an empty text.
If you do not change the layer name in the TIA Portal, the exported layer name will be an empty
text. In this case, the displayed layer name in the TIA Portal depends on the user interface
language.
If you do change the layer name in the TIA Portal, the modified layer name is displayed in all
relevant languages.
Layer Data
Attributes Name, Index, VisibleES
Compositions ScreenItems (with screen items)
Program code
Modify the following program code to export an individual screen from the user folder or from
the system folder of an HMI device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The screens can only be imported to a specific type of HMI device. The HMI device and the device
from which the screens were exported must be of the same device type.
The following data of a screen is imported:
Screen Data
Attributes ActiveLayer, BackColor, Height, Width, Name, Number, HelpText
Open links Templates
Compositions • Layers
• Animations
All animations configurable for screens are imported.
• Events
All events configurable for screens are imported.
• Softkeys
All softkeys configurable for screens are imported.
Note
If you have specified an empty text for the layer name before the import, the displayed layer
name in the TIA Portal after the import depends on the user interface language.
If you have assigned a layer name, the specified layer name is displayed in all relevant languages
after the import.
Layer Data
Attributes Name, Index
Compositions ScreenItems
Restrictions
• The import is canceled and an Exception is thrown if the width and height of a screen do not
correspond to the dimensions of the device. Adaptation of the screen items contained is not
supported. For this reason, certain screen items may be located beyond the screen
boundaries. A compiler warning is output in this case.
• The screen number must be unique for all screens of the device. A screen import is canceled
if a screen with a screen number that was already created in the device is found. If you have
not yet assigned a screen number, a unique number is assigned to the screen during the
import.
• The layout of the screen items within the Z-order must be unique and contiguous for each
layer in the screen. For this reason, after the import of the screen, a consistency check is
performed that repairs the layout, if necessary. This action may lead to modified "tab indexes"
for certain screen items.
You can change the Z-order of the screen items in the XML file manually. The screen item in
first place is at the very end in the Z-order.
Note
You can change the values for width and height of the screen items in the XML file if the attribute
"Fit size to content" is enabled for the screen item.
Note
Import of screen types from the library is not supported
As of WinCC V12 SP1, you can create a screen as type in the library. Instances of the screen type
used in the project can be edited like other screens using the TIA Portal Openness application.
When you export screens, the instances of screen types are exported without the type
information.
When you re-import these screens into the project, the instances of the screen types are
overwritten and the instance is detached from the screen type.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of the permanent area is exported:
Layer Data
Attributes Name, Index
Compositions ScreenItems (with screen items)
Program code
Modify the following program code to export a permanent area of an HMI device to an XML file:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of the permanent area is imported:
Layer Data
Attributes Name, Index
Compositions ScreenItems (with screen items)
The import is canceled and an Exception is thrown if the width and height of a screen do not
correspond to the dimensions of the device. Adaptation of the included device items (Screen
items) is not supported. For this reason, some device items may be located beyond the screen
boundaries. A compiler warning is output in this case.
The layout of the device items must be unique and contiguous in the permanent area. For this
reason, after the import of the permanent area, a consistency check is performed that repairs the
layout, if necessary. This action may lead to modified "tab indexes" for certain device items.
Program code
Modify the following program code to import a permanent area from an XML file into an HMI
device:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
One XML file is created per screen template.
Because bulk exports are not supported, you need to enumerate and export all screen templates
separately. In the course of this action, make sure that the screen template names used conform
to the file naming conventions of your file system.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of the screen template is exported:
Layer Data
Attributes Name, Index
Compositions ScreenItems (with screen items)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of a screen template is imported:
Layer Data
Attributes Name, Index
Compositions ScreenItems (with screen items)
The import is canceled and an Exception is thrown if the width and height of a screen template
do not correspond to the dimensions of the device. Adaptation of the included screen items is
not supported. For this reason, certain screen items may be located beyond the screen
boundaries. A compiler warning is output in this case.
The layout of the screen items must be unique and contiguous in the screen template. For this
reason, after the import of the screen template, a consistency check is performed which repairs
the layout, if necessary. This action may lead to modified "tab indexes" for certain screen items.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of the pop-up screen is exported:
Layer Data
Attributes Name, Index, VisibleES
Compositions ScreenItems
All exportabe screen objects are exported.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of a pop-up screen is imported:
Layer Data
Attributes Name, Index, VisibleES
Compositions ScreenItems
All importable screen objects are imported.
Restrictions
If a device doesn't support pop-up screens, the import is cancelled and an Exception is thrown.
If the width and height of a pop-up screen do not comply to the following dimensions
restrictions for a device, the import is cancelled and an Exception is thrown:
• Minimum height = 1 pixel
• Minimum width = 1 pixel
• Maximum height = sixfold height of the device's screen
• Maximum width = twofold width of the device's screen
• For devices with runtime version V13 SP1 the maximum height and the maximum width is
equal with th height and width of the device's screen.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data and values of the slide-in screen is exported:
Note
Slide-in screens do not have a name but a SlideinType.
Layer Data
Áttributes Name,
Index
VisibleES
Compositions ScreenItems All exportabe screen objects are exported.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data and values of a slide-in screen is imported:
Layer Data
Attributes Name, Index, VisibleES
Compositions ScreenItems
All importable screen objects are imported.
Restrictions
• If a device does not support slide-in screens, the import is cancelled and an Exception is
thrown.
• If a slide-in screen is referenced from another element, the slide-in screen must be referenced
via openlink and not via SlideinType, e. g. in system function "ShowSlideinScreen").
The following table shows the mapping of the attribute "SlideinType" with the corresponding
openlink:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of a faceplate instance in a screen is exported:
Screen Data
Attributes Left, Top, Width, Height, ObjectName, Resizing, TabIndex, FaceplateTypeName
Interface Attributes All configured interface attributes of a faceplate instance are exported for ex‐
portable screen items.
Compositions • Animations
All movement animations are exported.
Tag animations rely on interface attributes.
• Events
All configured events are exported.
The following data of inner screen items of a faceplate instance is excluded from the export:
Program code
Modify the following program code to export an individual screen including a faceplate instance:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The following data of a faceplate instance in a screen is imported:
Screen Data
Attributes Left, Top, Width, Height, ObjectName, Resizing, TabIndex, FaceplateTypeName
Interface Attributes All configured interface attributes of a faceplate instance are imported for im‐
portable screen items.
Compositions • Animations
All movement animations are imported.
Tag animations rely on interface attributes.
• Events
All configured events are imported.
The following data of inner screen items of a faceplate instance is excluded from the export and
import:
Restrictions
• Unknown Faceplate, event or interface attribute
If a faceplate type name, an event name or an interface attribute name is specified in the
import file which does not exist in the project, the import is aborted with an Exception.
• Resizing behavior of a faceplate instance
The attribute "Resizing" is imported in any case, independent of the export options.
Examples:
If "Resizing" is set to "KeepRatio", the "Height" attribute is used to calculate the "Width"
attribute value.
– The size of a faceplate type is 100 x 100 pixel. If a faceplate instance is imported with size
300 x 100 pixel and value "FixedSize" is set for the "Resizing" attribute, the import
succeeds and the faceplate size is set to 100 x 100 pixel.
– The size of a faceplate type is 100 x 50 pixel. A faceplate instance is imported with size 100
x 100 pixel and value "KeepRatio" is set for the "Resizing" attribute.The import succeeds
and the faceplate size is set to 200 x 100 pixel.
Note
Sizing behavior of imported faceplate instances
The values of "Resizing" and values of interface attributes can affect the size of the imported
faceplate instance and even the size of the inclosed screen items.
To avoid unrequested changes of the appearance of a faceplate instance, import a faceplate
with the initial size or even without "Width" and "Height" attribute values.
6.4.1 Blocks
Basic principle
The data in the export file from the import/export is structured with reference to a basic
structure. Every import file has to fulfill the basic structural conditions.
The export file includes all edited tags and constants of the interface section of an exported
block. All attributes with "ReadOnly="TRUE""and "Informative="TRUE"" are excluded.
If the information is redundant, it must exactly be identical in the import XML file and the project
data. Otherwise the import will throw a recoverable exception.
The project data can contain more data than the import XML file, e. g. an external type may have
additional members
Only writeable values can be imported via TIA Portal Openness XML.
Depending on the TIA Portal Openness export settings, the export file includes a defined set of
attributes and elements. The XML exported from higher versions of the product is not
compatible during the import operation in lower version of the TIA Portal.
Basic structure
The interface section of an exported block is covered in the <Interface> element in the
SimaticML of a block. The root object is the <Sections> element, which represents the
interface section of an exported block. The sequence of the following description of elements
represents the required sequence in the input file.
• Section
Section represents a single parameter or local data of a program block
• Member
Member represents the tags or constants used in the program block. Depending of the
datatype of a tag, members can be nested or have further structural sub elements.
In case of the data type "ARRAY" the structural element "Subelement Path" represents e. g.
the index of the components of an array element.
Only those members are exported, which were edited by the user.
• AttributeList
The <AttributeList> includes all defined attributes of a member. Attributes, that are
system defined or assigned by a standard value are not listed in the XML structure.
The member attributes <ReadOnly> and <Informative> are only written to the XML
export file if their value is TRUE.
• StartValue
The element <StartValue> is only written, if the default value of the tag or constant is set
by the user.
• Comment
The element <Comment> is written, if it is set by the user. Comments of a tag or constant are
exported as multilingual text:
Attributes
• Main attributes
The main attributes are written in the <Member> element in the XML structure.
The following table shows the main attributes of a tag or constant at the block interface
section.
Datatype "STRUCT"
The components of the datatype "STRUCT" are represented in the XML structure of an import/
export file as nested members:
Overlaid tags
If a tag is overlaid with a new datatype, the members are represented in the XML structure of the
new data type. The following XML structure shows a datatype WORD overlaid by an ARRAY of
BYTE.
Block Interface
All attributes with ReadOnly="TRUE" and Informative="FALSE" are excluded. The XML
structure of a block interface depends on the TIA Portal Openness export settings.
• ExportOptions.None
This setting exports only the modified data or the data that differs from the default.
In case their attribute definition does not specify a default value, the attribute is always
written.
The export file also contains all values that are obligatory for the subsequent data import.
• ExportOptions.WithDefaults
The following attributes are always written
– Name
– Datatype
– HmiAccessible exported as ExternalAccessible
– HmiVisible exported as ExternalVisible
– ExternalWritable
– SetPoint (if applicable)
– Offset (if applicable)
– PaddedSize (if applicable)
All other attributes are only written if their values differ from the default.
The <StartValue> element is only written to the XML if it has been explicitly set.
• ExportOptions.ReadOnly
For block interfaces this setting will not lead to meaningful result. In combination with other
settings it will have no influence on the result.
Introduction
To import a custom created or an edited XML file successfully to the TIA Portal via TIA Portal
Openness, the file must correspond to defined schemas.
The XML files always consist of two major parts:
• Interface
• Compile unit
The schemas they have to correspond to are explained in the following.
Interface
An interface can contain multiple sections (e. g. Input, InOut, Static): You can find all of these
sections in the schema in the following directory:
• C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.InterfaceSections_v3.xsd
• C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.Interface.Snapshot .xsd
Compile unit
There are seperate schemas for the compile units of GRAPH, LAD/FBD, STL and SCL blocks. You
can find these schemas in the following directories:
• GRAPH: C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.PlcBlocks.Graph_v4.xsd
• LAD/FBD: C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.PlcBlocks.LADFBD_v3.xsd
• STL: C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.PlcBlocks.STL_v3.xsd
• SCL: C:\Pogram Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas\
SW.PlcBlocks.SCL_v2.xsd
Subschemas
There are the following additional schema definitions used by all compile units:
• Access
• Common
Access
The Access node describes for example:
• local/global members and constant usages
• FB, FC, Instruction calls
• DBs for calls
You can find the access schema in the following directory:
C:\Program Files\Siemens\Automation\Portal V*\PublicAPI\V*\Schemas
\SW.PlcBlocks.Access_v3.xsd
Common
Common contains the commonly used attributes and elements, for example different types of
comments, texts and tokens.
You can find the common schema in the following directory:
Note
V* refers to the installed version of TIA Portal.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to export the DB's with snapshot values as XML and able to
compare the values with different snapshot times. With the compare result, you can manually
adapt single start values within the UI and store for a potential recovery. The schema
“SW.Interface.Snapshot.xsd” will support you to interpret or process the exported XML-file.
Program code
Modify the following program code to export Snapshot Values by using the Snapshot Service:
Note
Export of snapshot values using the Snapshot Service is independent of the standard interface
openness export and therefore will not influence the already existing export of the interface
members. It will not be possible to import the exported XML
If a DB does not contain any snapshot values, the content of the exported file would look like as
following:
<SnapshotValues xlmns="http://www.siemens.com/automation/Openness/SW/Interface/Snapshot/
v1"></SnapshotValues>
See also
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
The resulting XML file is similar to the export file of a block without know-how protection. With
PlcBlockProtectionProvider, you can unlock a know-how protected block by providing the
password using the Openness API and then export a KHP block with in complete with its code.
A block can be imported and then be protected with a password using the API again.
If the block is exported without unlocking, only the public block interface will be exported.
• TIA Portal block -> Unlock -> Export file without protection
• Import file without protection -> Lock -> TIA Portal block
The attribute list of the block indicates that the relevant block is know-how protected.
Program code
Modify the following program code to export the visible data of a block with know-how
protection to an XML file:
New line
New lines in SCL blocks are represented as NewLine XML tag.
• Contains unsigned Num attribute with default value 1.
• Num attribute does not have value 0.
• Supported only for SCL.
Blank
Blank spaces in SCL blocks are respresented as Blank XML tag.
• Contains unsigned Num attribute with default value 1.
• Num attribute does not have value 0.
• Supported only for SCL.
• Does not support Integer attribute available in other languages of STEP 7.
Based on the chosen identation, the imported SCL block XML file are idented.
Comment
Single-line and multi-line comments in SCL blocks are represented as LineComment XML tag.
• Only LineComment tag (for single language comment) is used in SCL.
• Comment tag (for mulitple language comment) is not used in SCL.
• Contains Inserted attribute with default value false
• Inserted="false" indicates "//" single comment in SCL block.
• Inserted="true" indicates "(**)" multi-line comment in SCL block.
Region
Regions in SCL blocks are represented as Token XML tag.
• Text XML tag represents the region_name.
• The Text attribute of the Token XML tag is case in-sensitive.
• The import operation is case in-sensitive, and the editor displays the keywords as configured
in the TIA Portal settings.
• If the end_region keyword ends with ";" (semi-colon) in SCL block, the symbol ";" is placed in
Text XML tag.
Pragma
Pragma in SCL blocks are represented as Token XML tag. The parameters are represented in
Access XML tag with Scope attribute as LiteralConstant.
<ConstantTypeInformative="true">STRING</
ConstantType>
</Constant>
</Access>
Literal constant: Typed #Out := int#10; <Access Scope="TypedConstant">
<Constant>
<ConstantValue>int#10</ConstantValue>
</Constant>
</Access>
Format of XML exported in ExportOptions.ReadOnly setting.
<Access Scope="TypedConstant">
<Constant>
<ConstantValue>int#10</ConstantValue>
<StringAttribute Name="Format"
Informative="true">Dec_signed</
StringAttribute>
<StringAttribute Name="FormatFlags"
Informative="true">TypeQualifier</
StringAttribute>
</Constant>
</Access>
Local constant #Out := #mylocal; <Access Scope="LocalConstant">
<Constant Name="mylocal" />
</Access>
Format of XML exported in ExportOptions.ReadOnly setting.
<Access Scope="LocalConstant">
<Constant Name="mylocal">
<ConstantType Informative="true">Int</
ConstantType>
<ConstantValue Informative="true">10</
ConstantValue>
<StringAttribute Name="Format"
Informative="true">Dec_signed</
StringAttribute>
</Constant>
</Access>
<Access Scope="GlobalConstant">
<Constant Name="myglobal">
<ConstantType Informative="true">Int</
ConstantType>
<ConstantValue Informative="true">10</
ConstantValue>
<StringAttribute Name="Format"
Informative="true">Dec_signed</
StringAttribute>
</Constant>
</Access>
The address constants are not supported in SCL blocks, and it is ignored in this table.
Variables
The local and global variables in SCL blocks are represented by Access XML tag.
• The Scope attribute has values of LocalVariable and GlobalVariable
• The XML tags for assigning the value 10 is ignored here.
<Access Scope="GlobalVariable">
<Symbol>
<Component Name="Tag_3" />
<Address Area="Memory" Type="Int"
BitOffset="96" Informative="true" />
</Symbol>
</Access>
Expressions
The simple expressions in SCL blocks are represented by Access XML tag. The Scope attribute has
value of LocalVariable for the expressions
<Blank Num="4"/>
<Token Text=";" />
<NewLine />
<Blank Num="2"/>
<Access Scope="LiteralConstant">
<Constant>
<ConstantValue>2</ConstantValue>
<ConstantType
Informative="true">LINT</ConstantType>
</Constant>
</Access>
<Token Text=".." />
<Blank Num="2"/>
<Access Scope="LiteralConstant">
<Constant>
<ConstantValue>4</ConstantValue>
<ConstantType
Informative="true">LINT</ConstantType>
</Constant>
</Access>
<Blank />
<LineComment>
<Text> Statement section case 2 to 4</Text>
</LineComment >
<NewLine />
<Blank Num="4"/>
<Token Text=";" />
<NewLine />
<Blank Num="2"/>
<Token Text="ELSE" />
<NewLine />
<Blank Num="4"/>
<Token Text=";" />
<NewLine />
Referencing attributes
The SCL block referencing attributes are represented by AccessModifier attribute of Component
tag.
• For simple referencing, AccessModifer has value as Reference.
• For array referencing, AccessModifier has value as ReferenceToArray.
Global access
In SCL statements, the global access variables and constants are represented in quotes. The
comments written between the variables and address parts are represented by LineComment
XML tag.
<Access Scope="GlobalVariable">
<Symbol>
<Component
Name="Data_block_1" />
<Token Text="." />
<Component Name="Static_1" /
>
</Symbol>
</Access>
Format of XML exported in ExportOptions.ReadOn‐
ly setting.
<Access Scope="GlobalVariable">
<Symbol>
<Component
Name="Data_block_1" />
<Token Text="." />
<Component Name="Static_1" /
>
<Address Area="DB"
Type="Word" BlockNumber="1"
BitOffset="0" Informative="true" />
</Symbol>
</Access>
Array
SCL allows to add comment within the array indexes around "[" and "]". To mark the existence of
array, XML file uses AccessModifier attribute in Component tag.
• If Accessmodifier contains the value Array, then a child tag Access is mandatoy to indicate the
index variable of the array.
• The default value for AccessModifier is None.
Absolute Access
SCL allows different types of access such as absolute, absolute offset, mixed (database and
member variable), slice, peripheral, and direct type. The absolute access specifiers are
represented by Address tag in XML.
• The % character of the DB is not written in XML. It is created automatically during the import.
• Blanks are allowed between the address parts
<Access Scope="Address">
<Address Area="DB" BlockNumber="20"
BitOffset="83" Type="Bool" />
</Access>
<Access Scope="Address">
<Symbol>
<Address Area="DB"
BlockNumber="20" />
<Token Text="." />
<Address Area="DB"
BitOffset="83" Type="Bool"/>
</Symbol>
</Access>
Absolute offset
In STL, AbsoluteOffset tag represents the absolute offset access. In SCL, Address tag is used for
absolute access.
Slicing
In SCL, the SliceAccessModifier attribute is not supported and the slicing is represented by Token
tag.
Peripheral access
The peripheral access is represented by Token tag.
<Access Scope="Call">
<CallInfo BlockType="FB">
<Instance
Scope="LocalVariable">
<Component
Name="Callee_Instance" />
</Instance>
<Token text="(" />
<Parameter Name="Input_1">
<Blank />
<Token text=":=" />
<Blank />
<Access Scope="LiteralConstant">
<Constant>
<ConstantType>Int</
ConstantType>
<ConstantValue>5</
ConstantValue>
</Constant>
</Access>
</Parameter>
<Token text=")" />
</CallInfo>
</Access>
<Token text=";" />
Format of XML exported in ExportOptions.ReadOn‐
ly setting
<Access Scope="Call">
<CallInfo BlockType="FB">
<IntegerAttribute
Name="BlockNumber"
Informative="true">1</
IntegerAttribute>
<DateAttribute
Name="ParameterModifiedTS"
Informative="true">2016-10-24T08:27:
34</DateAttribute>
<Instance
Scope="LocalVariable">
<Component
Name="Callee_Instance" />
</Instance>
<Token text="(" />
<Parameter Name="Input_1">
<StringAttribute
Name="InterfaceFlags"
Informative="true">S7_Visible</
StringAttribute>
<Blank />
<Token text=":=" />
Function call
Absolute call
In SCL, the call can be initiated using absolute address of the DB. Due to absolute address, the
Name attriubute of CallInfo node is empty.
A recoverable exception is thrown by the import of
• An "Address" node is available, with valid value of Name attribute.
• Non-existence of Address node with no valid value of Name attribute.
Instruction
The instruction in SCL block is checked in system library during the import operation, and the
instruction versions are not exported in export operation.
The general instruction type is given below.
<Access Scope="LocalVariable">
<Symbol>
<Component Name="myInt" />
</Symbol>
</Access>
<Blank />
<Token text=":=" />
<Blank />
<Access Scope="Call">
<Instruction Name="ATTACH">
<Token text="(" />
<Parameter Name="OB_NR">
<Blank />
<Token text=":=" />
<Blank />
<Access Scope="LiteralConstant">
<Constant>
<ConstantType>OB_ATT</
ConstantType>
<ConstantValue>1</
ConstantValue>
</Constant>
</Access>
</Parameter>
<Token text="," />
<Blank />
<Parameter Name="EVENT">
<Blank />
<Token text=":=" />
<Blank />
<Access Scope="LiteralConstant">
<Constant>
<ConstantType>EVENT_ATT</
ConstantType>
<ConstantValue>15</
ConstantValue>
</Constant>
</Access>
</Parameter>
<Token text="," />
<Blank />
<Parameter Name="ADD">
<Blank />
<Token text=":=" />
<Blank />
<Access Scope="LiteralConstant">
<Constant>
<ConstantType>Bool</
ConstantType>
<ConstantValue>TRUE</
ConstantValue>
Conversion
For conversion functions, the real instruction name and its template values are not exported.
Instead, the name used in the SCL block is exported.
Alarm constant
The alarm constants are only used in S7 400 PLCs, and the exported XML is similar to other
languages.
<Access Scope="Call">
<CallInfo Name="Block_1"
BlockType="FB">
<Instance Scope="GlobalVariable">
<Component Name="Block_1_DB" />
</Instance>
<NamelessParameter>
<Access Scope="AlarmConstant">
<Constant>
<ConstantType>C_Alarm_8</
ConstantType>
<ConstantValue>16#0000_0001</
ConstantValue>
</Constant>
</Access>
</NamelessParameter >
</CallInfo>
</Access>
Format of XML exported in ExportOptions.ReadOn‐
ly setting
<Access Scope="Call">
<CallInfo Name="Block_1"
BlockType="FB">
<Instance Scope="GlobalVariable">
<Component Name="Block_1_DB" />
</Instance>
<NamelessParameter>
<Access Scope="AlarmConstant" >
<Constant>
<ConstantValue>16#00000001</
ConstantValue>
<ConstantType>C_Alarm</
ConstantType>
<StringAttribute
Name="Format"
Informative="true">Hex</
StringAttribute>
</Constant>
</Access>
</NamelessParameter>
</CallInfo>
</Access>
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
It is possible in TIA Portal Openness to support import and export multilingual comments in SCL
editor by the following ways:
• During SCL export in Openness, all the multilingual comments with its translation, according
to enabled project languages, are exported into the same openness xml file.
• During SCL import in Openness, all the multilingual comments with its translation, according
to enabled project languages, shall be imported back from the openness xml file. It shall be
reflected in the project text area. The language gets enabled in if the language is not enabled
in the project during import.
• After import, it shall be verified that all multilingual comment in SCL editor is liked to the
appropriate comments in the project text.
Example
The following figure shows an example of Multilingual comment in SCL Editor:
The following figure shows an example for export of multilingual comment in openness XML file:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Exporting blocks (Page 998)
Exporting blocks with know-how protection (Page 956)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The project contains a system block.
• The system block is not a F-block
• PLC is not online.
Application
Only visible system blocks will be available in the blocks composition, e.g. no SFBs or SFCs. The
resulting XML file is similar to the export file of a block.
Program code
Modify the following program code to export the visible data of a block to an XML file:
<Steps>
<Step Number="1" Init="true" Name="Step1" MaximumStepTime="T#10S" WarningTime="T#7S">
<StepName>
<MultiLanguageText Lang="de-DE">stepDE</MultiLanguageText>
<MultiLanguageText Lang="en-US">stepEN</MultiLanguageText>
<MultiLanguageText Lang="it-CH">stepIT</MultiLanguageText>
</StepName>
..
</Step>
..
</Steps>
<Transitions>
<Transition IsMissing="false" Name="Trans1" Number="1" ProgrammingLanguage="LAD">
<TransitionName>
<MultiLanguageText Lang="de-DE">transDE</MultiLanguageText>
<MultiLanguageText Lang="en-US">transEN</MultiLanguageText>
<MultiLanguageText Lang="it-CH">transIT</MultiLanguageText>
</TransitionName>
..
</Transition>
..
</Transitions>
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
The TIA Portal Openness API supports the import of blocks with "LAD", "FBD", "GRAPH", "SCL" or
"STL" programming languages from an XML file. The following block types are supported:
• Function blocks (FB)
• Functions (FC)
• Organization blocks (OB)
• Global data blocks (DB)
Note
Importing optimized data blocks
Optimized data blocks are only supported by CPUs as of S7-1200. If you import optimized data
blocks into S7-300 or S7-400, an exception is thrown and the import fails.
Response to importing
The following rules apply when importing a block:
• The XML file can contain less data than the block in the project, e.g., fewer parameters.
• Redundant information, such as call information, must be identical in the project and in the
XML file. Otherwise, an exception is thrown.
• The data in the XML file may be "inconsistent" regarding their ability to be compiled in the TIA
Portal.
• Attributes with the attributes "ReadOnly=True" and "Informative=True" are not imported.
• Missing instance DBs are not created automatically.
• If no block number is specified in the xml file, the block number is assigned automatically.
• If the block is not existing in the project and no version information is specified in the xml
file, the version "0.1" is assigned.
Program code
Modify the following program code:
//Import blocks
private static void ImportBlocks(PlcSoftware plcSoftware)
{
PlcBlockGroup blockGroup = plcSoftware.BlockGroup;
IList<PlcBlock> blocks = blockGroup.Blocks.Import(new FileInfo(@"D:\Blocks
\myBlock.xml"), ImportOptions.Override);
}
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online.
Application
The API interface supports exporting consistent blocks and user data types to an XML file.
The XML file receives the name of the block. The following block types are supported:
• Function blocks (FB)
• Functions (FC)
• Organization blocks (OB)
• Global data blocks (DB)
The following programming languages are supported:
• STL
• FBD
• LAD
• GRAPH
• SCL
Note
There are certain conditions where MemoryLayout attribute can be readonly.
Attributes applicable for program blocks (except OB), DB, and UDT blocks
The following attributes are exported for program blocks (except OB), DB, and UDT blocks under
a unit with the selected ExportOptions.
Imported under unit Imported not under unit Imported not under unit
(without SWImportOp‐ (with SWImportOptions.Ig‐
tions.IgnoreUnitAttributes) noreUnitAttributes)
XML exported from under unit 'Access' used and set RecoverableException is 'Access' ignored
thrown
XML exported from not under 'Access' gets its default value 'Access' doesn't exist 'Access' doesn't exist
unit
Program code
Modify the following program code to export a block without know-how protection to an XML
file:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is not online
Application
Using Openness API, you can use a new import mode for STEP7 objects to import blocks and
UDTs even if a related object is missing.
The Openness interface supports the new import mode for the following conditions:
Program code
You can use the new mode by a new overload of the respective Import method. The new
overload has an additional parameter which accepts a value of the new flagged enum
SWImportOptions. To allow the import, you can use
SWImportOptions.IgnoreMissingReferencedObject, even if the referenced object is missing.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
Application
Using Openness API, you can import blocks and UDTs even if instance data is lost because of a
structural change of related objects.
The Openness interface supports the new import mode for the following conditions:
Program code
You can use new mode by a new overload of the respective Import method. The new overload
has an additional parameter which accepts a value of the new flagged enum SWImportOptions.
To allow the import althoughthere are structural change and maybe a data loss using
"SWImportOptions.IgnoreStructuralChanges".
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
The 'Access' attribute exists only for blocks, plc types, and tag tables located under a unit.
therefore the exported XML will contain it. The exported XML of the same block, type, or tag
table located in non-unit environment won't contain it.
The general Openness XML import rules won't allow importing XMLs containing unknown/
undefined attributes. Because of this rule the exported XMLs originated from object in a unit
environment cannot be imported in a non-unit environment. This would be a huge limitation in
the usage therefore a following extension is defined.
The import () method has an overload to pass three parameters. The following are the these
parameters:
Program code:
Program code: Object exported from a unit and imported into a unit
The examples below are demonstrating the behavior of the new import option by using blocks,
the same applies for plc types and tag tables as well.
Modify the following program code to export a block with ‘Access’ attribute set to value
‘Unpublished’ (default value) with ExportOptions.WithDefaults and import with
SWImportOptions.None:
block1.SetAttribute("Access", UnitAccessType.Unpublished);
block1.Export(new FileInfo("somepath"), ExportOptions.WithDefaults);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.None);
Modify the following program code to export a block with ‘Access’ attribute set to value
‘Unpublished’ (default value) with ExportOptions.WithDefaults and import with
SWImportOptions.IgnoreUnitAttributes:
block1.SetAttribute("Access", UnitAccessType.Unpublished);
block1.Export(new FileInfo("somepath"), ExportOptions.WithDefaults);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.IgnoreUnitAttributes);
Modify the following program code to export a block with 'Access' attribute set to value
'Published' with ExportOptions.None and import with SWImportOptions.None:
block1.SetAttribute("Access", UnitAccessType.Published);
block1.Export(new FileInfo("somepath"), ExportOptions.None);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.None);
Modify the following program code to export a block with 'Access' attribute set to value
'Published' with ExportOptions.None and import with SWImportOptions.IgnoreUnitAttributes:
block1.SetAttribute("Access", UnitAccessType.Published);
block1.Export(new FileInfo("somepath"), ExportOptions.None);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.IgnoreUnitAttributes);
Note
In all of the above program codes, No exception is thrown, and import succeeds.
Program code: Object exported from a unit and imported into non-unit environment
Modify the following program code to export a block with 'Access' attribute set to value
'Unpublished' (default value) with ExportOptions.WithDefaults and import with
SWImportOptions.None:
block1.SetAttribute("Access", UnitAccessType.Unpublished);
block1.Export(new FileInfo("somepath"), ExportOptions.WithDefaults);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.None);
Note
In the above program code, Import does not succeed and a Recoverable Exception is thrown,
Modify the following program code to export a block with ‘Access’ attribute set to value
‘Unpublished’ (default value) with ExportOptions.WithDefaults and import with
SWImportOptions.IgnoreUnitAttributes:
block1.SetAttribute("Access", UnitAccessType.Unpublished);
block1.Export(new FileInfo("somepath"), ExportOptions.WithDefaults);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.IgnoreUnitAttributes);
Note
In the above program code, import succeed and No exception is thrown.
Modify the following program code to export a block with 'Access' attribute set to value
'Published' with ExportOptions.None and import with SWImportOptions.None:
block1.SetAttribute("Access", UnitAccessType.Published);
block1.Export(new FileInfo(„somepath"), ExportOptions.None);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.None);
Note
In the above program code, Import succeed and a Recoverable exception is thrown.
Modify the following program code to export a block with ‘Access’ attribute set to value
‘Published’ with ExportOptions.None and import with SWImportOptions.IgnoreUnitAttributes:
block1.SetAttribute("Access", UnitAccessType.Published);
block1.Export(new FileInfo(„somepath"), ExportOptions.None);
block1.Delete();
plcUnit2.BlockGroup.Blocks.Import(new FileInfo("somepath"), ImportOptions.None,
SWImportOptions.IgnoreUnitAttributes);
Note
In the above program code, No exception is thrown and import succeed.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is opening
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to create instance DB for programming languages such as
SCL, LAD, FBD, STL, Graph, and CEM.
Program code: Creating Instance DB for SCL, LAD, FBD, STL, Graph, & CEM block
Modify the following program code to create Instance DB of SCL block:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• You have opened a project via a TIA Portal Openness application
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to read/write the start value of a member in all kinds of DB's
using two ways:
• Indexed access of members in the DB
• Finding the member using the member name
You can access the following properties name in DB using TIA Portal Openness:
You can use the following method name to access the properties of a member in DB:
• public Member Find(string Name)
Program code
Modify the following program code to read start value from DB:
PlcBlockInterface bi = dbbblock.Interface;
MemberComposition members = bi.Members;
Member member = members.Find("Room_Temperature");
object startValue = member.StartValue;
//Normal get attribute should be possible as usual
startValue = member.GetAttribute("StartValue");
//Array
initialSpeedvar = members.Find("Motor.InitialSpeed[0]");
object motorInitialSpeed = initialSpeedvar.StartValue;
//UDT-struct
axisSpeedvar = members.Find("FillingStation.Conveyer.AxisSpeed");
object axisSpeed = axisSpeedvar.StartValue;
axisSpeed = axisSpeedvar.GetAttribute("StartValue");
//Struct
initialSpeedvar = paramF.Find("DischargeValve.FlowMeter.InitialSpeed[0]");
object initialSpeed = initialSpeedvar.StartValue;
initialSpeed = initialSpeedvar.GetAttribute("StartValue");
PlcBlockInterface bi = dbbblock.Interface;
MemberComposition members = bi.Members
Member member = members.Find("Room_Temperature");
member.StartValue = 10.2;
//Normal set attribute should be possible as usual
member.SetAttribute("StartValue", 20.3);
//Array
initialSpeedvar = members.Find("Motor.InitialSpeed[0]");
initialSpeedvar.StartValue = 36;
initialSpeedvar.SetAttribute("StartValue", 56);
//UDT-struct
axisSpeedvar = members.Find("FillingStation.Conveyer.AxisSpeed");
object axisSpeed = axisSpeedvar.StartValue;
axisSpeed.SetAttribute("StartValue", 40.5);
initialSpeedvar = paramF.Find("DischargeValve.FlowMeter.InitialSpeed[0]");
object initialSpeed = initialSpeedvar.StartValue;
initialSpeed.SetAttribute("StartValue", 12);
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use TIA Portal Openness to export/import Plc alarm text lists. The format of the Export/
Import is XLSX.
Results
The TextListXlsxResult object contains information about the result of the export or import. It
contains a FileInfo named LogFilePath, which points to the logfile of the finished process. The
State (which is of type TextListXlsxResultState) will show the final state of the process, which can
be OK, Warning or Error. If the result is Error, the process failed, if it is Warning, the process
partially succeeded.
Export
Two API methods are provided for the export. If all text lists of a PLC/SW Unit in all activated
project languages is to be exported, the only required parameter is the 'path' that defines the
location where the result XLSX file has to be located after the successful export.
If not all text lists of a PLC/SW Unit has to be exported or the languages - in which the text lists
have to be exported - should be filtered, another method is also available in the API, where the
list of text list names identify the text lists to be exported, and the list of Languages identify the
languages in which the text lists have to be exported.
}
return unit.GetService<PlcAlarmTextListProvider>();
}
return plcTarget.GetService<PlcAlarmTextListProvider>();
}
Error Handling:
• If the given language is not activated as a project language a UserException is expected to be
thrown. For example, "Required language 'Konkani (India)' cannot be exported, because it is
not used culture in this project. Valid languages are 'German (Germany)', 'English (United
States)'"
• If there is no user text list exist, a UserException will be thrown (TextListNotFoundException)
with the following message: "There is no text list on the following item: <PLCName>."
• If a given text list name does not exist, or exists but not a user text list, a UserException is
expected to be thrown. Such as
"Text list User_1 is not found at PLC_1."
"Text list SYSTEM_SDiag_CmpCpuName cannot be exported, because it is not user text list."
Import
The following action is present at the PLCAlarmTextListProvider class for import. With the
importOptions parameter it can be clarified if the import should override existing text lists or not.
If the importOptions is set to ImportOptions.None and during the import an already existing text
list should be updated, a UserException is expected to be thrown. If the importOptions
parameter is set to ImportOptions.Override, then the already existing text lists will be updated
during the import.
Existing text lists are identified by their name. New data (text list, entry) will be appended.
Existing text list will not be deleted if there is not any corresponding data in the import file,
however if the Excel file contains text list entries for an already existing text list, the already
existing entries will be removed, and the entries given in the Excel file will be imported to the TIA
project for that specific text list (No merge for text list entries).
If invalid entries exist in the file, the text list containing the invalid entry will not be imported.
(Examples for invalid entries: overlap, inconsistent with the containing text list data type.). Texts
will be imported only in languages, which are active in the project. If the file contains more
languages than the project, texts in extra languages will not be imported and a warning will be
logged. If the project contains more languages than the file, texts which have no corresponding
data in the file will remain untouched (or empty, if import inserts new text lists or ranges).
No import can be done into a read-only project. A UserException is expected in case the user tries
to import into a read-only project.
Import is a complex process, so several kinds of errors can occur. If the error is not critical, the
import will be finished and the method returns with a TextListXlsxResult object that contains the
path to the log file (that contains the messages that are generated during the import), and has
a State of TextListXlsxResultState.Warning.
If the error is critical a UserException is expected to be thrown that contains the details about the
error.
Note
• XLSX files generated during Export by TIA Portal V16 should have FileVersion custom
property specified with value 1.
• XLSX files generated during Export by TIA Portal V16 should have FileContent custom
property specified with value Alarm text lists.
• Log file is generated during Import at the TIA project's Logs folder
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to export/import Alarm classes.
The format of the Export/Import is XML. However, XML is not provided to the TIA user as the
result of export, but is archived and used with .DAT extension.
Using TIA Portal Openness, you have the possibility to choose between the .XML extension or the
archived .DAT extension as the result of the export, or as the input of the import.
Results
The AlarmClassExportImportResult object will contain an Information about the result of the
export or import. It contains an AlarmClassExportImportResultMessageComposition navigator
named Messages, which points to the messages generated during the export/import process.
The State (which is of type AlarmClassExportImportResultState) will show the final state of the
process, which can be Success, Warning or Error. If the result is Error, the process failed, if it is
Warning, the process succeeded.
Export
The following action is present at the AlarmClassDataProvider class for Export:
The export action has one parameter: path.
With the path parameter the file path can be given where the result of the export is to be placed.
The type of the parameter is FileInfo.
The result of the action is an AlarmClassExportImportResult object. It contains the count of
errors, warnings and the state of the export result (Success, Warning or Error).
It also has a Messages composition property, that contains the messages generated during the
export together with the state (Success, Error or Warning).
A sample usage of the Export action:
Error Handling:
• If the overall state of the export process is Error a UserException is raised, and the list of error
messages is stored in the exception itself.
From client side an EngineeringTargetInvocationException exception can be caught, where the
DetailMessageData property contains the error messages.
• Possible errors:
– IO error during the export process
Import
The import action is similar to the export action.
Error handling:
• If the overall state of the export process is Error a UserException is raised, and the list of error
messages is stored in the exception itself.
From client side an EngineeringTargetInvocationException exception can be caught, where the
DetailMessageData property contains the error messages
• Possible errors
– File to be imported has invalid file extension
– File to be imported missing file extension
– With the import the count of alarm classes would exceed the maximum allowed number
of alarm classes in the project
– The file to be imported uses not the correct schema version (Only version 1.0 and 2.0 is
supported)
– No overlapping between the activated project languages and the languages given in the
import file
– No language is defined
– IO error during the export process
Note
• XML files generated during Export with TIA Portal V17 shall have
AlarmServiceGlobalSettingsData XML root element with SchemaVersion="2.0".
• It shall be supported to import XML files generated during Export with TIA Portal V16.
See also
Opening a project (Page 113)
Connecting to the TIA Portal (Page 81)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 113)
• A project is open
See Opening a project (Page 81)
Introduction
You can use the TIA Portal Openness to support export/import of global supervisions of ProDiag
block.. This functionality is supported by service provider mechanism and the same service
provider is used by the block under Plc and software unit to perform export and import
operations.
On perfoming export\import you shall be communicated with proper result state or with proper
user exceptions.
The following method can be used to export and import global supervisions of ProDiag block:
Method Description
ExportSupervisionsToXlsx(FileInfo Export the supervisions tags including settings in the TIA portal
path) supported format and generates the results of the export
ImportSupervisionsFromXlsx(FileInfo
path, ImportOptions importOptions) Import supervision tags with supported import options
ImportSupervisionSettings‐ Import supervision settings which are placed in exported file
FromXlsx(FileInfo path,ImportOptions along with supervised tags
importOptions)
ENUM Values
SupervisionXlsxResultState Success
Failure
Program code
Modify the following program code to export global supervisions of ProDiag block:
Modify the following program code to import global supervisions of ProDiag block:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• Opening a project
See Opening a Project (Page 113)
Introduction
You can use the TIA Portal Openness to support export\import of global supervisions available
under Plc or under Unit. The functionality is supported by service provider mechanism and the
same service provider is used mainly by both Plc and software unit to perform export and import
operations. On performing export\import, you shall be communicated with proper result or with
exceptions.
The following method can be used to export and import global supervisions:
Method Description
ExportSupervisionsToXlsx(FileInfo Export the supervisions tags including settings in the TIA portal
path) supported format and generates the results of the export
ImportSupervisionsFromXlsx(FileInfo
path, ImportOptions importOptions) Import supervision tags with supported import options
ImportSupervisionSettings‐ Import supervision settings which are placed in exported file
FromXlsx(FileInfo path,ImportOptions along with supervised tags
importOptions)
ENUM Values
SupervisionXlsxResultState Success
Failure
Program code
Modify the following program code to export global supervisions:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Introduction
You can use the TIA Portal Openness to support export/import of supervision settings.
The following properties are available under SupervisionSettingsExportImportResult:
ENUM Value
SupervisionSettingExportImportResultState Success
ErrorRollback
Program code
Modify the following program code to export supervision settings:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement:
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• You have opened a project with your TIA Portal Openness application.
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to export Watch Table and Force Table from TIA Portal to
SIMATIC ML and import the Watch Table and Force Table from SIMATIC ML.
SoftwareContainer softwareContainer =
((IEngineeringServiceProvider)item).GetService<SoftwareContainer>();
PlcSoftware plcSoftware = softwareContainer.Software as PlcSoftware;
PlcWatchTableComposition exportWatchTables =
plcSoftware.PlcWatchAndForceTableGroup.WatchTables;
PlcWatchTable watchTable = exportWatchTables.Find(watchTableName);
if(watchTable != null)
{
watchTable.Export((FileInfo) fileInfo, ExportOptions.None);
}
Note
Export options in Watch Table should be set (None, WithDefaults, WithReadOnly,
WithDefaultsAndReadOnly.). A WatchTable has only one published property i.e. the name. The
name is published for read.
SoftwareContainer softwareContainer =
((IEngineeringServiceProvider)item).GetService<SoftwareContainer>();
PlcSoftware plcSoftware = softwareContainer.Software as PlcSoftware;
PlcForceTableComposition exportForceTables =
plcSoftware.PlcWatchAndForceTableGroup.ForceTables;
PlcForceTable forceTable = exportForceTables[0];
forceTable.Export((FileInfo) fileInfo, ExportOptions.None);
Note
There is only one ForceTable in every situation, and it has a read-only name.
SoftwareContainer softwareContainer =
((IEngineeringServiceProvider)item).GetService<SoftwareContainer>();
PlcSoftware plcSoftware = softwareContainer.Software as PlcSoftware;
PlcWatchTableComposition importWatchTables =
plcSoftware.PlcWatchAndForceTableGroup.WatchTables;
IList<PlcWatchTable> WatchTables = importWatchTables.Import((FileInfo)fileInfo,
ImportOptions.None);
Note
The imported WatchTable will be added to the list of WatchTables. Import options in Watch Table
should be set to the required one (None, Override).
ForceTables can be imported in a similar way, but it is only allowed to have one ForceTable. If you
use the None option instead of Override and a (non-empty) ForceTable already exists, then the
import will fail with the following RecoverableException: Only one ForceTable is allowed to be
imported. Please use Override importOption to overwrite the existing one.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online
Program code
Modify the following program code to export an user data type to an XML file:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
Connecting to the TIA Portal (Page 81)
• A project is open.
Opening a project (Page 113)
• PLC is not online.
Application
The API interface supports the importing of user data types from an XML file.
<Section Name="Input">
<Member Name="Input1" Datatype=quot;myudt1">
<Sections>
<Section Name="None">
<Member Name="MyUDT1Member1" Datatype="bool"/>
<Member Name="MyUDT1Member2" Datatype="myudt1">
<Sections...
Note
Syntax for user-defined data types of elements
An exception is thrown if the user-defined data type of an element in the import file for user data
types has incorrect syntax.
Make sure that user-defined data types are noted with ".
Program code
Modify the following program code to import a user data type:
See also
Importing configuration data (Page 885)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is not online
Application
You can use the TIA Portal Openness to export PLC data as OPC UA XML file. As input parameter
for the action you need an absolute directory path, where the xml file will be saved.
Program code
Modify the following program code to export PLC data as OPC UA XML file:
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can use the TIA Portal Openness to define a supervision for bool members inside UDT and
assign prodiagFB for UDT instances in global data while creating the global Datablock. You
should be able to provide and fetch this supervison information through TIA Portal Openness
export and import respectively.
<Conditions>
<Condition>
<ConditionOperand Number="1" Name="" />
<TriggeringStatus>true</TriggeringStatus>
</Condition>
<Condition>
<ConditionOperand Number="2" Name="" />
<TriggeringStatus>true</TriggeringStatus>
</Condition>
<Condition>
<ConditionOperand Number="3" Name="" />
<TriggeringStatus>true</TriggeringStatus>
</Condition>
</Conditions>
<CategoryNumber>1</CategoryNumber>
<SubCategory1Number>0</SubCategory1Number>
<SubCategory2Number>0</SubCategory2Number>
</PLCDataTypeSupervision></PLCDataTypeSupervisions></Supervisions>
</AttributeList>
<ObjectList>
<MultilingualText ID="1" CompositionName="Comment">
<ObjectList>
<MultilingualTextItem ID="2" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
<MultilingualText ID="3" CompositionName="Title">
<ObjectList>
<MultilingualTextItem ID="4" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
</ObjectList>
</SW.Types.PlcStruct>
</Document>
When you want to import a UDT and assign the supervision for the bool variable, the above-
mentioned XML tags can be used. However, you cannot set the supervision information to a bool
variable through openness after import.
Note
Supervision is only applicable for bool variables for UDT, when you attempt to import or export
the "PLCDataTypeSupervisions" tags for any non-boolean members in UDT then no exception is
thrown.
<ObjectList>
<MultilingualTextItem ID="2" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
<MultilingualText ID="3" CompositionName="Title">
<ObjectList>
<MultilingualTextItem ID="4" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
</ObjectList>
</SW.Blocks.GlobalDB>
</Document>
Note
It is valid to have assignedProDiagFB attribute only for UDT instance. It is not possible to export
any invalid data as it should be compile clean so you don’t get any exception during export. You
will encounter the not supported exception , if you try to import the "AssignedProDiagFB" tag for
non UDT instances inside global DB or any other member in any block.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Quintessence
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to export and import the Array DB and instance DB of UDT
instances so that the information about assigned proDiagFB sould be exported appropriately.
Similarly, the same attribute should be supported for Openness user during import as well so
that you would be able to assign the possible proDiagFB for Array DB and instance DB of UDT.
Note
It is valid to have assignedProDiagFB only for Array DB of UDT, it is not possible to export any
invalid data so you don’t get any exception during export.
When you try to import the "AssignedProDiagFB" tag for any other ArrayDB which is not of UDT
then you will encounter the not supported exception and this is not supported for System
defined Datatype as well though they have bool variable or not.
...
<SW.Blocks.InstanceDB ID="0">
<AttributeList>
<AssignedProDiagFB>Default_SupervisionDB</AssignedProDiagFB>
<InstanceOfName>User_data_type_4</InstanceOfName>
<InstanceOfType>UDT</InstanceOfType>
<Interface>
<Sections>
<Section Name="Static">
<Member Name="Element_1" Datatype="Bool" />
</Section>
</Sections>
</Interface>
<MemoryLayout>Optimized</MemoryLayout>
<Name>Data_block_9</Name>
<Number>19</Number>
<ProgrammingLanguage>DB</ProgrammingLanguage>
</AttributeList>
<ObjectList>
<MultilingualText ID="1" CompositionName="Comment">
<ObjectList>
<MultilingualTextItem ID="2" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
<MultilingualText ID="3" CompositionName="Title">
<ObjectList>
<MultilingualTextItem ID="4" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
</ObjectList>
</SW.Blocks.InstanceDB>
</Document>
...
Note
The appropriate "Not Supported attribute" exception should be thrown to you, If you try to set
the assignedProDiagFB to instance DB.
See also
Opening a project (Page 113)
Technology objects
The following table shows the available technology objects for import and export.
Basic principle
The data in the XML file from the import/export is structured with reference to an openness XML
file format. Every import file must fulfill the structural conditions.
The export file includes all edited tags and constants of the interface section of an exported
technology object. The project data can contain more data than the import XML file, e.g.
external references. These must be exported separately. Only writeable values can be imported
via TIA Portal Openness XML.
Depending on the TIA Portal Openness export settings, the export file includes a defined set of
attributes and elements. Export files from higher versions of the TIA Portal are not compatible
with lower versions of the TIA Portal and could not be imported in those. SimaticML files
exported with the latest TechObject version are also supported for the newer ones.
Attributes
The SimaticML format is largely taken over from the export/import format of user blocks.
Particularly important are the following additional attributes:
• OfSystemLibElement
• OfSystemLibVersion
• Interface
The attribute OfSystemLibVersion contains the version of the TO, and the attribute
OfSystemLibElement contains the type of the TO.
The attribute Interface contains all members of the TO DB including the structure elements
and versions.
Technology data that are not stored in the DB itself are stored in an additional attribute
ParameterData.
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• A project contains TO to be exported.
• PLC is not online.
Application
The TIA Portal Openness API supports the export of all technology objects listed in the
table Overview of technology objects and versions (Page 1046) to an XML file. You can only
export consistent technology objects. HWCN or TagTable are not exported with the technology
object, but must be exported separately. You check the consistency of a technology object using
the IsConsistent attribute. This flag can be set by successfully compiling of the respective
technology object. The generation of the corresponding export file indicates that the export is
completed.
Exceptions
• When you try to export an inconsistent technology object an exception is thrown.
• When you try to export the technology object that not supports the export functionality an
exception is thrown. This exception is also thrown in case of older technology object versions
that not support export.
• When you try to export the technology object while you are in online mode an exception is
thrown.
Additional parameters
Most parameters of Motion Control technology objects are directly mapped to data block tags,
but there are also some additional parameters that do not map directly to data blocks. See
also Specific attributes for TO_PositioningAxis and TO_CommandTable (Page 1052), Specific
attributes for Axis and Encoder technology objects (Page 1055), Specific attributes for
OutputCam, CamTrack and MeasuringInput technology objects (Page 1058).
Program code
void Export(FileInfo path, ExportOptions options);
The path parameter describes the path and file name of the export file that should be created.
The parameter (ExportOptions options) specifies options for the export (Page 884).
Attributes Description
ExportOptions.None Exports only modified parameters.
ExportOptions.WithDefaults This option exports the parameters that have their default value. The de‐
fault value itself is not exported. The same behavior is defined also for the
TO specific parts of the XML export. The respective default values that are
exported are defined for each TO type.
ExportOptions.WithReadOnly This option exports additional informative attributes and values. During
import, read only values are not written back to the DB. The respective
read only values that are exported are defined for each TO type.
ExportOptions.WithDefaults | ExportOptions.With‐ Combination of the two options above.
ReadOnly
Modify the following program code to find and export a technology object to an XML file:
Modify the following program code to export a technology object OutputCam to an XML file:
// Export OutputCam
private static void ExportTechnologicalObject(FileInfo path, ExportOptions options,
PlcSoftware plcSoftware, String nameOfTO)
{
//Retrieve service OutputCamMeasuringInputContainer
OutputCamMeasuringInputContainer container =
technologyObject.GetService<OutputCamMeasuringInputContainer>();
//Get access to TO_OutputCam container
TechnologicalInstanceDBComposition outputcamCamtrackContainer = container.OutputCams;
//Find technology object TO_OutputCam
TechnologicalInstanceDB outputCam = outputcamCamtrackContainer.Find("OutputCamName");
// Export
outputCam.Export(path, options);
}
Requirements
Application
The TIA Portal Openness API supports the import of technology objects from an XML file.
Exceptions
If the import data contains parameters that are not defined for the respective TO type, an
EngineeringTargetInvocationException is thrown.
If the value of a parameter has a wrong format and cannot be converted to the type of the
parameter, an EngineeringTargetInvocationException is thrown. The Import will be succeeded
but an error will be produced on compile.
Open connection
In TIA Portal, open connections are created when a tag that is connected to a TO is deleted. The
further behavior of open connections is identical to the behavior of open connections created
by deleting a connected tag. If the partner TO is missing during the import, an open connection
will be established in this case. This also applies to TO types that can not be used for certain
connections.
Program code
IList<SW.TechnologicalObjects.TechnologicalInstanceDB>
Import(FileInfo path, ImportOptions options);
Modify the following program code to import one or several technology objects from an XML
file. For more information about the ImportOptions see Importing configuration data
(Page 885).
// Import TO
technologicalObjects.Import(path, options);
}
Application
The API supports the export and import of technology objects.
Parameters of TO_PositioningAxis and TO_CommandTable that are data block members are
exported in the "Interface" section of the export file. Additional parameters are exported in the
"ParameterData" section of the export file. The next chapter shows all additional parameters.
You can find a list of all available variables in SIMATIC STEP 7 S7-1200 Motion Control function
manual on the internet (https://support.industry.siemens.com/cs/ww/en/view/109754206).
Note
The data type information is only exported for parameters that are part of the "Interface" section.
External references
In case of PTO-Axis:
An explicit set of _Actor.Interface.PTO has be done over TO openness parameter API to connect
the TO to the PTO-Output.
The following parameters can be set via Openness API:
• _Actor.Interface.PTO_OutputA
• _Actor.Interface.PTO_OutputBEnable
• _Actor.Interface.PTO_OutputB
• _Actor.Interface.PTO_SignalType
If Homing- or Position Limit inputs are used in PTO-Axis, activation of EdgeDetection will be done
with setting of following parameters over TO openness parameter API:
• _Sensor[1].ActiveHoming.DigitalInput
• _Sensor[1].PassiveHoming.DigitalInput
• _PositionLimits_HW.MaxSwitch
• _PositionLimits_HW.MinSwitch
In case of Analog/ProfiDrive:
An explicit set of following parameters has to be done over TO openness parameter API to
activate the PIP to OB-Servo:
• _Actor.Interface.ProfiDriveOutName
• _Actor.Interface.ProfiDriveInName
• _Sensor[1].Interface.ProfiDriveOutName
• _Sensor[1].Interface.ProfiDriveInName
Application
The API supports the import and export of technology objects. The following section describes
the specific attributes.
Sensor.Type - - X
CrossPlcSynchronousOpera‐ - X X
tion.Interface[n].EnableLea‐
dingValueOutput2)
_Properties.UseHighResolution‐ false - X X
PositionValues
_CrossPlcSynchronousOpera‐ true - X X
tion.ActivateLocalLeadingValue‐
DelayTimeCalculation
_Units.LengthUnit 1013 (mm) - X X
_Units.VelocityUnit 1062 (mm/s) 1083 (1/mm) X X
_Units.TorqueUnit 1126 (Nm) X X -
_Units.ForceUnit 1120 (N) - X -
_Actor.Interface.Telegram 0 X X -
_Sensor[n].Interface.Telegram1) 0 - X -
_Sensor.Interface.Telegram 0 - - X
_Actor.DataAdaptionOffline false X X -
_Sensor[n].DataAdaptionOff‐ false - X -
line1)
_Sensor.DataAdaptionOffline false - - X
In contrast, the additional TechnologicalParameters that reference tags in the Openness API are
treated differently in SimaticML. The affected Parameters are shown in the following Table. In the
Openness API, they have the data type SW.Tags.PlcTag, but in SimaticML, the name of the
connected tag is exported.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API supports the import and export of technology objects. The following section describes
the specific attributes.
The attribute ParameterData contains the following parameters for TO_OutputCam and
TO_MeasuringInput:
Application
The API supports the import and export of technology objects. The following section describes
the specific attributes.
XML elements
Application
The API supports the import and export of technology objects. The following section describes
the specific attributes.
Export TO_Kinematics
For the TO type TO_Kinematics the EOM attribute ParameterData contains the following
parameters.
The following parameters corresponding to TO DB parameters have the data type and the
default value as defined in the TO DB:
• Kinematics.TypeOfKinematics
• MotionQueue.MaxNumberOfCommands
The following parameters have the same data type in SimaticML as the respective
TechnologicalParameters in the Openness API:
• _X_Minimum
• _X_Maximum
• _Y_Minimum
• _Y_Maximum
• _Z_Minimum
• _Z_Maximum
• _A3_Maximum
XML elements
Application
The API supports the import and export of technology objects. The following section describes
the specific attributes.
Export TO_LeadingAxisProxy
For the TO type TO_LeadingAxisProxy the EOM attribute ParameterData contains additional
parameters _Interface.AddressIn. The additional TechnologicalParameter references a tag. Here
the same rules apply as described inSpecific attributes for Axis and Encoder technology objects
(Page 1055).
Export
For the TO type PID_Compact all parameters correspond to TO DB members and have the data
type and the default value as defined in the TO DB. The EOM attribute ParameterData is empty.
Import
The following parameters for PID_Compact are not part of the import:
• PhysicalUnit
• PhysicalQuantity
• _Config.OutputSelect
• _Retain.CtrlParams.SetByUser
These parameters will have the default value after the import.
Note
Remake the associated settings manually after an import of a PID_Compact export file. This can
be done by using the function Writing parameters (Page 609).
Export
For the TO types PID_3Step and PID_Temp all parameters correspond to TO DB members and
have the data type and the default value as defined in the TO DB. The EOM
attribute ParameterData is empty.
Import
The following parameters for PID_3Step and PID_Temp are not part of the import:
• PhysicalUnit
• PhysicalQuantity
These parameters will have the default value after the import. If you want to modify them you
have to use the function Writing parameters (Page 609).
Note
Remake the associated settings manually after an import of a PID_3Step or PID_Temp export file.
6.4.2.8 Counting
The API interface supports the export and import of technology objects. You can find a list of all
available parameters in the product information "Parameters of technology objects in TIA Portal
Openness" on the internet (https://support.industry.siemens.com/cs/ww/en/view/109744932).
For the TO types High_Speed_Counter and SSI_Absolute_Encoder all parameters correspond to
TO DB members and have the data type and the default value as defined in the TO DB. The EOM
attribute ParameterData is empty.
The API interface supports the export and import of technology objects. You can find a list of all
available parameters in the product information "Parameters of technology objects in TIA Portal
Openness" on the internet (https://support.industry.siemens.com/cs/ww/en/view/109744932).
For the TO type AXIS_REF all parameters correspond to TO DB members and have the data type
and the default value as defined in the TO DB. The EOM attribute ParameterData is empty.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
One XML file is exported per PLC tag table.
The TIA Portal Openness API supports the export of all PLC tag tables from the system group and
its subgroups.
Program code
Modify the following program code to export all PLC tag tables from the system group and its
subgroups:
See also
Exporting configuration data (Page 884)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Program code
Modify the following program code to import PLC tag tables or a folder structure with PLC tag
tables from an XML file into the system group or a user-defined group:
See also
Notes on performance of TIA Portal Openness (Page 112)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
The API interface supports the export of a tag or constant from a PLC tag table to an XML file.
Make sure that the tag table names used conform to the file naming conventions of your file
system.
The comment of a tag or constant is only exported if at least one language is set for the
comment. If the comment is not set for all project languages, this comment is only exported for
the set project languages.
Note
PLC system constants
PLC system constants are excluded from export and import.
Program code
Modify the following program code to export a specific tag or constant from a PLC tag table to
an XML file:
plcConstant.Export(new FileInfo(string.Format(@”D:\Samples\{0}.xml”,
plcConstant.Name)), ExportOptions.WithDefaults);
}
See also
Exporting configuration data (Page 884)
Notes on performance of TIA Portal Openness (Page 112)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can import either tags or constants in an import call.
Note
Constants can oly beimported as user constants.
Program code
Modify the following program code to import tag groups or individual tags and constants from
an XML file:
tagTable.UserConstants.Import(new FileInfo(@"D:\Samples\myConstants.xml"),
ImportOptions.Override);
}
See also
Exporting configuration data (Page 884)
Notes on performance of TIA Portal Openness (Page 112)
Introduction
AutomationML is a neutral data format based on XML for the storage and exchange of plant
engineering information, which is provided as open standard. Goal of AutomationML is to
interconnect the heterogeneous tool landscape of modern engineering tools in their different
disciplines, e.g. mechanical plant engineering, electrical design, HMI, PLC, robot control.
The class model used for the export and import of CAx data is based on the following AML
standards:
• Whitepaper AutomationML Part 1 – AutomationML Architecture, October 2014
• Whitepaper AutomationML Part 2 –AutomationML Role Libraries, October 2014
• Whitepaper AutomationML Part 4 –AutomationML Logic, May 2010
• Whitepaper AutomationML– AutomationML Communication, September 2014
• Whitepaper AutomationML– AutomationML and eCl@ss Integration, November 2015
• Application Recommendations: Automation Project Configuration - AR_001E Version 1.0.0,
Mai.2017
Schema
The AutomationML data exchange model is described by the CAEX schema Version 2.15. You
can download this file from the homepage of AutomationML e.V. (https://
www.automationml.org/o.red.c/dateien.html)
Introduction
Pruning is the act of optimizing the content by removing certain things which are not necessarily
to be provided. In case of external tools like EPLAN , the auto created sub module information
within a hardware configuration has no significance with respect to EPLAN. Hence, these tools
generate an AML file by removing the auto created sub module information from the hardware
configuration. This file is called as pruned AML.
$XWRPDWLRQ3URMHFW
3URMHFW1DPH
3URMHFW0DQXIDFWXUHU
3URMHFW6LJQ
3URMHFW5HYLVLRQ
3URMHFW,QIRUPDWLRQ
'HYLFH,WHP
1DPH
7\SH1DPH 7DJ7DEOH 7DJ8VHU)ROGHU
'HYLFH,WHP7\SH
3RVLWLRQ1XPEHU 1DPH 1DPH
%XLOW,Q $VVLJQ7R'HIDXOW
7\SH,GHQWLILHU
)LUPZDUH9HUVLRQ
3ODQW'HVLJQDWLRQ,(&
/RFDWLRQ,GHQWLILHU,(&
&RPPHQW
$GGUHVV>Q@6WDUW$GGUHVV/HQJWK,27\SH
&KDQQHO 7DJ
7\SH 1DPH
,R7\SH 'DWD7\SH
1XPEHU /RJLFDO$GGUHVV
/HQJWK &RPPHQW
&RPPXQLFDWLRQ,QWHUIDFH
/DEHO
Note
CAx shall perform export and import of AR APC version in AML file in accordance to the installed
version of TIA Portal.
• Instance hierarchy
This section contains the hierarchical sequence of the exported internal elements.
Internal elements
All objects inside the instance hierarchy of the AML file are InternalElements. The internal
element AutomationProject contains all internal elements of all role classes. Every internal
element supports a set of attributes.
The attribute <TypeIdentifier> identifies every object type of a hardware object that is
creatable via TIA Portal Openness.
Note
Auto-created objects
Auto-created objects can only be created by other objects. They do not have properties or a type-
identifier. They are included in the exported file, but you cannot trigger the export of a specific
autocreated object.
At the end of the AML-element of an internal element, the following are defined:
• Role class
The SupportedRoleClass element defines the object type of the internal element. The
object type is defined in the role class library that maps the standard AML to the object model
of TIA Portal Openness and TIA Portal.
• Internal link
The element InternalLink defines the communication partners of a connection.
Attributes
Attributes are assigned to internal elements as follows:
• Export-only
The attribute value is determined by the TIA Portal internally, e. g. the type name of a device
item. If it is present in an import file, it will be ignored by the TIA Portal during import.
• Import-only
The attribute can influence the import behavior. If the attribute is missing in an import file,
the behavior will correlate to the standard value for the attribute.
See also
AML type identifiers (Page 1080)
Internal elements
The TypeIdentifier string consists of several parts:
• <TypeIdentifierType>:<Identifier>
The following values for TypeIdentifierType are possible:
• OrderNumber used to specify pyhsical modules
• GSD used to specify GSD/GSDML based devices
• System used to specify systems and generic devices
The following formats for the type identifier are supported of the CAx import/export:
• GSD.<GsdName>/<GsdType>
Examples:
GSD:SIEM8139.GSD/DAP
GSD:GSDML-V2.31-SIEMENS-SINAMICS_DCP-20140313.XML/D
• <GsdName>/<GsdType>/<GsdId>
Examples:
GSD:SIEM8139.GSD/M/4
GSD:GSDML-V2.31-SIEMENS-SINAMICS_G110M-20140704.XML/M/IDM_DRIVE_47
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline
Application
In TIA Portal, you can export and import base unit information from and to TIA Portal so as to
facililate the information exchange with other tools like EPLAN.
There are two types of base units supported during export and import in TIA Portal project:
• Single base unit
• Double base unit
During export, only first module which is configured with base unit having IX300 suffix shall be
exported with a base unit sub-module in the AML file. The second module, the one configured
with IX301 shall not be injected with any Sub-module under it.
Single BaseUnit shall be identified from the TypeIdentifier in AML file with a specific pattern as
below:
OrderNumber:xxxx 193-6[B|U|T]xYx-xxxx where value of Y (11th Position) can be in the range
of 0 to 5.
Import of double base unit:
During double base unit import, two modules(adjacent) shall be displayed with base unit
information in TIA Portal. The first module configured with double base unit submodule in AML
file shall be imported with a double base unit by appending suffix '|X300' to base unit MLFB. The
second module, the one not having any base unit sub-module under it shall be imported with
same double base unit by appending suffix '|X301' to base unit MLFB. Double BaseUnit shall be
identified from the TypeIdentifier in AML file with a specific pattern as below:
OrderNumber:xxxx 193-6[B|U|T]x6x-xxxx
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
In TIA Portal, you can export the devices with multiple racks having extension rack connection
to an AML file and also import it back to get the same device configuration created back in the
TIA Portal project.
AML structure
In TIA Portal, extension rack connections between multiple racks are modeled under sender and
receiver modules (both are DeviceItem objects) directly. However as per AR APC
recommendation, these connections to be modeled as Port-to-Port connection under a
CommunicationPort. A dummy CommunicationInterface having dummy CommunicationPort
objects shall be added under IM modul to make inline with the recommendation.
The following sample shows a partial element structure of the exported AML file for above device
configuration:
Note
The extension rack interface shall be exported only when extension rack connections are
present. Also, the number of dummy ports added under ExtensionRack dummy interface is
based on ports participating in extension rack connection at module level. In above example, the
"IM 460-0_1" module supports two ports (IM 46x SenderPort_1 and IM 46x SenderPort_2).
However, only one port is configured with connection in TIA Portal. Hence, the exported AML
file shall contain only one port under extension rack interface.
ExternalInterface-
<ExternalInterface> internal element shall be added under <CommunicationPort> internal
element which participates in the connection
Internal link
Extension racks connections are represented using <InternalLink> tags. The <InternalLink> tags
shall be added under common parent of multiple racks (i.e., Device). Internal link name shall be
unique across the common parent.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
You can use the TIA Portal Openness to fetch, add, and remove extension rack connections so
that you can make use of TIA Portal Openness to implement extension rack connection support
during CAx export/import.
Program code
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
In TIA Portal you can export your configuration in the device&networks editor to an AML file. This
function is based on TIA Portal Openness and enables you to export hardware data from project
or device level.
TIA Portal Openness provides the following ways to export CAx data:
• Export function
The export function is accessed via CaxProvider service. To get the CaxProvider service
invoke the GetService method at Project object.
• Command line interface
You execute the "Siemens.Automation.Cax.AmiHost.exe" located in "C:\Program Files
\Siemens\Automation\Portal V..\Bin\" by passing specific command line arguments.
With TIA Portal V17 user interface, It shall be possible to perform CAx export and import
operation in multiuser environment. If a Server project is opened alongside the local session,
then Export and Import will happen for Server Project. For exporting and importing local session,
the Server project needs to be closed.
Furthermore, for purpose of single device export as CAx, device context menu shall have menu
entry for performing Export for a Server project in case it is open. In this case the context menu
shall not appear for local Session. For a single device export as CAx, the context menu shall be
available for a local session only when user closes Server project view.
It shall also be possible in TIA Portal Openness V17 to perform CAx export and import operation
in multi user environment. For multiuser project (local session and server project) to participate
in exchange via AML, a new API for export is used. The new Export API takes 'ProjectBase' as an
argument. You can now use Export API to export both single and multiuser project.
Note
This Command line interface is applicable only for single user project. Multi user projects (local
session and server project) are not yet supported via Command line.
As of TIA Portal OpennessV17, CAx export/import functionality through UI, API or Command line
will no longer check:
• Windows Group for Openness 'Siemens TIA Openness' is present
• Windows User is a member of 'Siemens TIA Openness' Group
Note
For invoking CAx APIs in a client application, you have to make sure that either the application
is signed with proper Openness certificate, or Openness 'Siemens TIA Openness' Group is
present and the user is a member of the group.
• OrderNumber:6ES7 677-1FD00-0FB0
• OrderNumber:6ES7 677-1FD10-0FB0
Note
From TIA Portal Openness V17 onwards, Normalized format of TypeIdentifier of above
mentioned device items can also be considered for exclusion.
To export CAx data at project level, use the Export method with the following parameters in TIA
Portal V17 onwards:
Return Type
Type Description
bool True, if CAx Export operation completed without
errors; otherwise False
Modify the following program code to export CAx data at project level:
Return Type
Type Description
bool True, if CAx Export operation completed without
errors; otherwise False
Modify the following program code to export CAx data at project level:
Modify the following program code to o export CAx data at project level via the command line:
//please adapt the path and the extension apx to the installed version of
TIA Portal
Siemens.Automation.Cax.AmiHost.exe -p "D:\Temp\MyProject.apx" -m "AML" -e
"D:\Import\CAx_Export.aml"
Modify the following program code to o export CAx data at device level via the command line:
//please adapt the path and the extension apx to the installed version of
TIA Portal
Siemens.Automation.Cax.AmiHost.exe -p "D:\Temp\MyProject.apx" -d "S7300/
ET200M station_1" -m "AML" -e "D:\Import\CAx_Export.aml"
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
In TIA Portal you can import your configuration in the device&networks editor from an AML file.
This function enables you to import hardware data from project or device level.
TIA Portal Openness provides the following ways to export CAx data:
• Import function
The import function is accessed via CaxProvider service. To get the CaxProvider service
invoke the GetService method at Project object.
• Command line
You execute the "Siemens.Automation.Cax.AmiHost.exe" located in "C:\Program Files
\Siemens\Automation\Portal V..\Bin\" by passing specific command line arguments:
if(caxProvider != null)
{
// Perform Cax export and import operation
}
CAx import
To import CAx data into a TIA Portal project, you use the Import method with the following
parameters:
Modify the following program code to o import CAx data via the command line:
//please adapt the path and the extension apx to the installed version of
TIA Portal
Siemens.Automation.Cax.AmiHost.exe -p "D:\Temp\MyProject.apx" -m "AML" -i
"D:\Import\CAx_Export.aml"
Requirements
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is offline
Application
You can have round trip exchange of sub modules data between the TIA Portal and other
engineering tools, e.g. CAD tool like EPLAN by keeping a common hierarchy for sub modules
inside AML file during export and import. For example, the sub modules like Bus Adapters shall
have different internal hierarchy in TIA Portal than in other applications (e.g., CAD tools like
EPLAN).
The following example depicts the partial AML file structure that shall be generated during the
export of Bus Adapter as sub module from TIA Portal .
<Value>1</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<InternalElement ID="8fb775eb-96c6-48d6-af8a-96ba72418830" Name="IE1">
<Attribute Name="Type" AttributeDataType="xs:string">
<Value>Ethernet</Value>
</Attribute>
<Attribute Name="NetworkAddress" AttributeDataType="xs:string">
<Value>192.168.0.1</Value>
</Attribute>
<Attribute Name="SubnetMask" AttributeDataType="xs:string">
<Value>255.255.255.0</Value>
</Attribute>
<Attribute Name="IpProtocolSelection" AttributeDataType="xs:string">
<Value>Project</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/Node" />
</InternalElement>
<InternalElement ID="f28a3d93-d821-4556-9df1-a45f0e4ff6a6" Name="Port_1">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>P1 R</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>1</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<InternalElement ID="ad6a0faa-3b70-4528-8c54-8183018b6714" Name="Port_2">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>P2 R</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>2</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
...
Note
CAx shall perform export and import of AR APC version in AML file in accordance to the installed
version of TIA Portal.
Note
• The export hierarchy change behavior shall be applicable only in versions V15.1 onwards
• The hierarchy in AML file shall not influence/affect the TIA Portal internal hierarchy after
Import.
• The AML files created using older TIA Portal versions shall also be imported without any
failure.
• This hierarchy change/transformation behavior is applicable for both built-in and non built-in
sub modules.
• Node details, which is duplicate of primary interface node are handled as mentioned below:
– Node Attributes: Overwrites node attribute details which set during Primary interface
processing
– Subnet Connection: Silently skipped if it is already connected otherwise connection shall
be established
• If the AML file contains IoSystem connection details on secondary interface, then
– Connection shall be skipped if already connected and user shall be notified with proper
error message in InfoTab.
– Connection shall be established if it is not connected.
The following configuration shows IO device configuration with master-slave and topology
connections.
The below example shows a partial AML file that shall be generated during export for the above
configuration:
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<ExternalInterface ID="81a7d9df-99b8-4eca-8e72-404b22bd05e7"
Name="LogicalEndPoint_Interface" RefBaseClassPath="CommunicationInterfaceClassLib/
LogicalEndPoint" />
<InternalElement ID="83eb7d69-8cd5-4217-a07a-0c656d215ec7" Name="IE1">
...
The AML file that shall be generated during export for the above configuration is depicted below:
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
<InternalElement ID="7be36254-5ed6-4a6f-9e7b-90be8b35e595" Name="PROFINET interface_1">
<Attribute Name="Type" AttributeDataType="xs:string">
<Value>Ethernet</Value>
</Attribute>
...
<InternalElement ID="61ac6187-8a5d-4f98-ae91-b809c0a3a15d" Name="Port_3">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>P3</Value>
</Attribute>
...
<ExternalInterface ID="425f5a5d-84e2-40c6-928f-e1aab73a8b86"
Name="CommunicationPortInterface"
RefBaseClassPath="AutomationProjectConfigurationInterfaceClassLib/
CommunicationPortInterface" />
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
Pruned AML
Pruning is an act of optimizing the content by removing certain things which are not necessary
to be provided. For information on Pruned AML, (Refer Pruned AML (Page 1072)).
There might be some scenarios where sub module configuration hierarchy is not same in TIA
Portal and CAD tools (like EPALN) due to pruned sub modules. In such scenarios, TIA Portal shall
support import of both pruned and unpruned AML files.
Note
• TIA Portal shall always export unpruned AML file.
• TIA Portal shall always import both pruned and unpruned AML file
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Introduction
With TIA Portal V17, it shall be possible to perform CAx export and import operations on a UMAC
protected project.
CAx operations on protected project is based on the below mentioned functions rights:
• Project with read and write access
• Modify project via Openness API
Export
CAx export operation is not restricted. So, it shall be possible to perform export operations on
protected project irrespective of the above mentioned users function rights.
Import
CAx import operation is restricted. When a user has above mentioned access rights then import
shall be successful, otherwise missing function rights error message shall be displayed in TIA
Portal user interface or Function rights not found exception shall be thrown for CAx API.
Note
• From TIA Portal V17 onwards, it shall be possible to perform CAx Export operation on read-
only project.
To perform Export and Import on UMAC protected project using CAx API, project needs to be
opened in UMAC protected environment. see Opening a Project (Page 113)via API for opening
project in UMAC protected environment.
See also
Opening a project (Page 113)
Introduction
In TIA Portal, there are different notations for order numbers inside type identifiers. In order to
allow import and export of these different notations of order numbers to integrate with other
tools, Tolerant handling of Order Numbers in Automation AML files is now possible.
In order to export TypeIdentifier format of TIA Portal V16 and below, a new setting has been
added:
If this checkbox "With TypeIdentifier format from V16 and below" is checked, TypeIdentifier value
in AML will be exported in old format, e.g. OrderNumber:6ES7 516-3AN00-0AB0.
If this checkbox is unchecked, TypeIdentifier value in AML will be exported with Order number's
wildcard characters denoted by "*" and blanks will be removed, e.g.
OrderNumber:6ES7590-1***0-0AA0.
During the import arbitrary wild card characters and blanks are accepted as part of the order
number of a TypeIdentifier.
Introduction
Custom attributes in general allow the exchange of data which are specific for a certain device
or module and not covered by an AutomationML based specification. Currently in TIA Portal
custom attributes are only supported for GSD/GSDML based modules. Only additional data of
the module itself can be exchanged by custom attributes but not additional data at ports,
interfaces, nodes, etc.
Custom attributes are defined in the AR APC V1.2 as an unordered list of name value pairs. The
AML structure is given here:
<Attribute Name="CustomAttributes">
<RefSemantic CorrespondingAttributePath="ListType" />
<Attribute Name="AttributeName1" AttributeDataType="xs:string">
<Value>AttributeValue1</Value>
</Attribute>
<Attribute Name="AttributeName2" AttributeDataType="xs:string">
<Value>AttributeValue2</Value>
</Attribute>
</Attribute>
To allow a correct identification of a custom attribute in the TIA Portal, the name of the custom
attribute must conform to the following definitions:
A custom attribute named consists of three parts <name>, <attribute_location>,
<value_location>.
• <name> is a string containing only alphanumeric letters, numbers , "_" and ".". Usually the
‘name’ is the attribute name found in GSD/GSDML file. It is an optional part for attributes in
parameter dataset otherwise mandatory.
• <attribute_location> defines the device item where the attribute is located. This is required
to identify the location of the attribute if it is not located directly at the module. It has the
form #<subslotnumber>#<subsubslotnumber>. That means, if the attribute is located at the
module the <attribute_location> is empty, if it is located at a Sub Module it is
"#<subslotnumber>" and in case of a location at a sub sub module the value is
"#<subslotnumber>#<subsubslotnumber>".
• <value location> defines how to access an attribute at its device item. In case the value is
part of a parameter data set, it is identified by the following quintuple:
– DatasetNumber: The number of the data set at the device item.
– ByteOffset: The position in bytes (starting with 0) where the value begins within the
parameter data set.
– Length: The overall length of the data set in bytes.
– BitOffset: The position in bits (starting with 0) where the value begins within its start byte
(see ByteOffset).
– BitLength: The complete length of the value in bit
Overall example for custom attributes:
In some (rare) cases the attribute is explicitly modelled (not part of parameter data set) in the
GSD/GSDML. Then the value is accessed via attribute name.
Note
On export TIA Portal always exports the complete data sets to allow partner applications full
access of the contained data
Export
Below snippet shows the format in which PrmData shall be expected in the AML file if it is found
over a pluggable module.
...
<InternalElement ID="049f1260-7c97-458e-84bd-12682f943f19" Name="Slave_1">
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>false</Value>
</Attribute>
<Attribute Name="TypeIdentifier" AttributeDataType="xs:string"> <Value>GSD:SI018098.GSD/
DAP</Value>
</Attribute>
<Attribute Name="CustomAttributes">
<RefSemantic CorrespondingAttributePath="ListType" />
<Attribute Name="PrmData-0-0-39-0-312" AttributeDataType="xs:string">
<Value>39,129,0,0,28,0,128,15,255,255,255,255,255,255,255,255,255,
255,255,255,255,255,255,15,255,255,255,255, 255,255,255,255,255,255,255,255,255,255,255</
Value>
</Attribute>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
Below snippet shows the format in which PrmData in case where it is available over a built-in
submodule in tia portal, but in the AML file it is given at the pluggable parent.
• In the above snippet custom attribute name "PrmData#0-130-0-4-0-32" has the following
meaning:
– PrmData#0: Name of the attribute and position number of the submodule containing it
– 130: Dataset number
– 0: Byte Offset
– 4: Dataset length in bytes
– 0: Bit Offset
– 32: Bit length
• Custom attributes in AML file shall never appear on any built-in modules expect for built-in
modules directly placed under the Rack.
• In case of a GSD/GSDML built-in module that has PrmData , the custom attribute shall be
exported over the immediate pluggable parent or a built-in parent directly under rack,
whichever is appropriate.
• In case of prunned files(files exported from E-plan) the built-in submodule which is the actual
owner of the custom attribute shall not be present in the AML file.
Import
CAx shall support import of PrmData custom attributes over GSD/GSDML modules in the
following cases:
• If a pluggable GSD/GSDML module has been provided with custom attributes.
• If the file has the built-in submodule prunned and the custom attributes are provided over the
appropriate pluggable parent module.
• If the file is not prunned, it has the built-in submodules and the custom attributes are
provided over the appropriate pluggable parent module
Custom attributes provided as individual attributes and not as full PrmDataset shall also be
supported with CAx import. This kind of a format is expected from Eplan exported files.
Below snippet shows such a sample.
In the example above all the individual custom attributes pertain to Data set number 0. But they
try to alter the value of different byte(s) and bit(s).
• CAx import shall support both Integer and Hex formats(e.g 0x67) for the value of a custom
attribute, but only one format at a time for any given attribute.
Export
CAx export shall ignore all such attributes that are read-only in TIA Portal, the custom attribute
section in a TIA Portal exported AML file shall contain attributes that are writable.
Below snippet shows the format in which custom attributes shall be expected in the AML file if
it is found over a pluggable module.
...
<InternalElement ID="806532c8-109a-42c6-82e9-84e8ba308aad" Name="cp1604">
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>false</Value>
</Attribute>
<Attribute Name="CustomAttributes">
<RefSemantic CorrespondingAttributePath="ListType" />
<Attribute Name="Author" AttributeDataType="xs:string">
<Value>AuthorValue</Value>
</Attribute>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
Below snippet shows the format in which custom attribute shall be exported in case where it is
available over a built-in submodule in TIA Portal, but in the AML file it is given at the pluggable
parent.
...
<InternalElement ID="806532c8-109a-42c6-82e9-84e8ba308aad" Name="cp1604">
...
<Attribute Name="CustomAttributes">
<RefSemantic CorrespondingAttributePath="ListType" />
<Attribute Name="Failsafe_FIODBNumber#0" AttributeDataType="xs:string">
<Value>0</Value>
</Attribute>
<Attribute Name="Failsafe_FParameterSignatureIndividualParameters#0"
AttributeDataType="xs:string">
<Value>5</Value>
</Attribute>
</Attribute>
<InternalElement ID="6b94abcd-3fe4-4800-9e18-ea7810d7afed" Name="PS_8Byte">
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>0</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
In the snippet above #0 signifies the position number of the built-in child item to which the
attribute really belongs to.
CAx export shall ignore all attributes that are already being exported as part of the applicable AR
APC version recommendation.
CAx shall not export custom attributes over interfaces and ports and any submodule under
them. The only exception being PrmData.
Import
CAx shall support import of custom attributes over GSD/GSDML modules in the following cases:
• If a pluggable GSD/GSDML module has been provided with custom attributes.
• If the file has the built-in submodule pruned and the custom attributes are provided over the
appropriate pluggable parent module.
• If the file is not pruned, it has the built-in sub modules and the custom attributes are provided
over the appropriate pluggable parent module.
CAx import shall ignore all custom attributes over interfaces and ports and any submodule under
them with appropriate warning. The only exception being PrmData.
CAx import shall ignore all attributes with appropriate warning that are already being imported
as part of the applicable AR APC version recommendation.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
Application
In TIA Portal, you can use CAx import to configure connection between channel and tag without
having the start address of an I/O module and/or logical address of tag specified in the AML file.
The following AML file example depicts the XML that shall be generated without start address
and logical address attributes.
<Value>Input</Value>
</Attribute>
<Attribute Name="Number" AttributeDataType="xs:int">
<Value>1</Value>
</Attribute>
<Attribute Name="Length" AttributeDataType="xs:int">
<Value>1</Value>
</Attribute>
</ExternalInterface>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
<InternalLink Name="Link To Tag_1" RefPartnerSideA="29e0bb63-0050-46e3-968a-
fcecf4eb050a:Channel_DI_0" RefPartnerSideB="9564bcc2-8ea0-4be7-a950-5c55b34e474a:Tag_1" />
<InternalLink Name="Link To Tag_2" RefPartnerSideA="29e0bb63-0050-46e3-968a-
fcecf4eb050a:Channel_DI_0" RefPartnerSideB="9564bcc2-8ea0-4be7-a950-5c55b34e474a:Tag_2" />
<InternalLink Name="Link To Tag_3" RefPartnerSideA="29e0bb63-0050-46e3-968a-
fcecf4eb050a:Channel_DI_1" RefPartnerSideB="9564bcc2-8ea0-4be7-a950-5c55b34e474a:Tag_2" />
<InternalLink Name="Link To Tag_4" RefPartnerSideA="29e0bb63-0050-46e3-968a-
fcecf4eb050a:Channel_DI_2" RefPartnerSideB="9564bcc2-8ea0-4be7-a950-5c55b34e474a:Tag_2" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
Device" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
AutomationProject" />
</InternalElement>
</InstanceHierarchy>
</CAEXFile>
Name Description
ChannelIoType Input (I) or Ouput (Q)
ByteAddress ByteAddress shall be calculated as specified below :
StartAddress of the I/O Module * 8 + BitOffsetAddress of the I/O Module + (Chan‐
nelNumber * ChannelLength) / 8
BitAddress BitAddress shall be calculated as specified below:
(BitOffsetAddress of the I/O Module + (ChannelNumber * ChannelLength)) % 8
Note
• In cases where a tag spans across more than one modules: The algorithm above gives
multiple byte addresses based on the start address of modules and an array of bit addresses
per byte address, corresponding to each channel number. Then the algorithm shall select the
lowest byte address and the lowest among the bit address array corresponding to this byte,
for calculating the logical address of the tag. Once the logical address is assigned to the tag,
the spanning is automatically taken care by the TIA Portal during import
• In TIA Portal, only few device configuration (for example ASI modules) supports Bit Offset
address attribute. For modules which does not support BitOffset address attribute, default
value "0" will be considered for above mentioned calculation.
Following are the list of tag data types which supports Bit address in TIA Portal:
During CAx import, If a boolean tag is configured to a channel type, then logical address
calculation includes bit offset address. The logical address along with bit offset shall be updated
as the tag's logical address in TIA Portal UI.
Name Description
ChannelIoType Input (I) or Ouput (Q)
TagDataType TagDataType is an abbreviation of the tag type.
Example: W for word and B for Byte
ByteAddress ByteAddress shall be calculated as specified below :
StartAddress of the I/O Module + ( ChannelNumber * ChannelLength) / 8
The algorithm explained above is used to calculate the Logical Address of a tag accurately in case
of
• Length of the datatype specified in the tag should be equal to the length of the channel it is
mapped to.
• For example, If a tag of datatype "Byte" is mapped to an Analog channel which is of length
2Bytes: upon import of AMl file which doesnot have Logical Address of the tag specified; The
tag in TIA portal shall always be mapped to the first byte of the channel irrespective of which
byte it was originally mapped to.
Note
• In cases where a tag spans across more than one modules: The algorithm above gives
multiple byte addresses based on the Start Address of the modules. Then the algorithm shall
select the lowest byte address for calculating the logical address of the tag. Once the logical
address having the lowest byte address is assigned to the tag, the spanning is automatically
taken care by the portal during import. If the StartAddress attribute for the I/O Module is not
provided in the AML file, the default value is assigned by TIA portal and same shall be used
for the above calculation.
• If the StartAddress attribute for the I/O Module is not provided in the AML file, the default
value is assigned by TIA portal and same shall be used for the above calculation.
Upon successful completion of import the following tag configuration shall be created in TIA
Portal for the example above.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
While performing the CAx operation through command-line, the following error diaglog
displays during the non-availablity of TIA Openness.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
You can exchange configuration data between the TIA Portal and other engineering tools, e. g.
an electrical planning tool like EPLAN or the TIA selection tool. For the identification of the
imported and exported devices, a global unique identifier, the AML GUID, is used.
During the round trips, the AML GUID is kept stable for physical assets like devices and device
items which are not built-in e.g. CPUs or modules, but not for virtual assets like tags, channels, ...
During the first export from the TIA Portal, the AML GUID for a device or a no built-in device item
is randomly generated, but kept stable afterwards.
If you export a device from an engineering tool into an empty TIA Portal project, the AML GUID
is added to the comment of the hardware object. If in the TIA Portal at "Tools > Settings > CAx
> Import settings" the correspondig setting is enabled the AML GUID is added in the current
editing language. The round trip process supports only one editing language to store the AML
GUIDs. When importing or exporting data, always use the editing language with which you
started the round trip.
For all following imports or exports, the AML GUID stays the same for this hardware object.
Changes to the hardware object are resumed.
Within a TIA Portal project object names have to be unique. The import of a device or a device
item into a TIA Portal project where a certain object with the same name already exists would
lead to a naming conflict. During the import you have the possibility to move the objects with
naming conflicts to the user defined parking lot. The name of the imported Object will be
extended with "_CAX".
During CAx export of the GUI
$0/ILOH 7,$3RUWDO
3DUNLQJORW
3/& ,PSRUW
*8,' *8,' *8,'
*8,'
3/& 3/&B&$;
To support AML roundtrip for previous project version, during project upgrade AML GUIDs are
now stored in "CustomIdentity" (App ID) instead of "Comment" part of device/deviceitem. The
AML GUIDs of device/deviceItem are expected to be unique and could be stored in any editing
language. So during project upgrade, all the comment editing languages are considered to get
the unique AML GUID. As the AML GUID of device/deviceItem is unique, but when a new GUID
with matching [AR_APC:ID:*] regex is added to comment in any editing language then the first
GUID which is picked from the editing languages is considered as the AML GUID for that device/
deviceItem.
Once the AML GUID's in the comment are moved to CustomIdentity, the device/deviceItem
comment is updated by removing the [AR_APC:ID:*] as shown in the image below
If the comment contains multiple [AR_APC:ID:*] section then the first GUID which matches the
pattern is set to CustomIdentity repository and the same is removed from comment. Rest of the
text is considered as comments.
Note
Copying an imported device
If you copy a device or a device item possessing an AML GUID you have to delete the AML GUID
in the comment of the copied object. Otherwise, devices or device items with identical AML
GUID exists in your project and lead to an invalid AML file.
Import settings
1. Define the parking lot folder name under "Options > Settings > CAx > Settings for conflict
resolution".
The parking lot folder is used to store objects with naming conflicts.
2. Activate "Options > Settings > CAx > Import settings > Save GUIDs during import".
During Import:
• The GUIDs of a physical asset shall be stored as part of its CustomIdentity section
• While importing an AML file, the GUIDs are stored as part of CustomIdentity
Note
Valid AML GUID
If you edit an AML GUID before the import, the AML GUID becomes invalid and then CAx import
operation shall be aborted and corresponding information shall be logged.
Note
Exceeding length of a comment
If the appending of the AML GUID the comment exceeds its maximum limit of 500 characters,
the user comment value will be trimmed to 500 characters. A corresponding information will be
logged.
Export
During export:
• GUID to be exported shall be fetched from CustomIdentity for the key AR_APC:ID.
• If the GUID is not available as part of CustomIdentity then the Multi user GUID shall be fetched
and exported as the AML GUID
• If above 2 steps fail to provide the GUID of a physical asset then a new random GUID shall be
generated by the export process and shall be treated as the AML GUID for physical assets.
AML structure
The generated ID is exported to AML file as depicted in the following code snippet:
<InternalElement ID="23aeefd0-ce05-4116-a644-e33d43901eaf"
Name="PLC_1"
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• The PLC is offline
Application
It shall be possible to import an AML file containing unknown artifacts into TIA Portal where the
unknown artifacts are ignored and only relevant information consumed. Unknown artifacts
contains un-neccessary information that are not relevant for TIA Portal during CAx import
operations. The possible unknown artifacts can be an attributes, sub attributes, internal
elements and external interfaces.
Below are the two possible reactions encountering an unknown artifact during import
operations:
• The unknown artifact is "known" but meaningless to TIA Portal and can be silently ignored
• The unknown artifact is "unknown" and will be ignored but reported by a warning
Below are the role class types available for configuring unknown artifacts to be ignored
The following example depicts the whitelist meta file for sub attributes:
Note
The value "*" in ItemType shall be used to ignore all the occurrences of a particular attribute/sub-
attribute under all the internal elements/external interfaces inside an AML file.
The following structure example depicts the whitelist meta file for link(s):
Note
• ItemType represents type of role class.
• The value "*" in ItemType shall be used to ignore all the occurrences of a particular external
interface under all the internal elements of an AML file.
• RefBaseClassPath represents RefBaseClassPath of an unknown external interface.
Note
ModuleAssignment shall be ignored from all the places in AML file
The following example depicts the whitelist meta file for object(s):
Note
• ItemType represents type of role class.
• If we put * in ItemType then this internal element will be ignored from all place of AML file
• WhiteListKey represents RefBaseClassPath
• WhiteListValue represents role class of internal element
Here, all roles under internal element Rail_0 are unknown/whitelisted so Rail_0 and its child
artifacts (attributes/sub attributes, internal elements and external interfaces) should ignored.
• Multiple role internal element with 1 or more roles are unknown/whitelisted should ignore
that role and its child attribute(s) and external interface(s) (but not child internal element(s))
should process partially.
AML file
AML file
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
In TIA Portal, you can export the devices with its topology information to an AML file. While
importing to an empty TIA Portal project, the imported device items retains the topology
information.
<InteralLink> element gives link details of port to port interconnection between the device
items. It appears under the common parent of the connected devices, and contains unique tag
names.
AML structure
The following figures shows a partial element structure of the exported AML file. It contains two
unique ID for the ports in PLCs.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
You can import device (station)/device item (module, sub-modules) in AML file into TIA Portal
using Library references.
AML Structure
The following AML structure describes the XML file that shall be used during the import
operations into TIA Portal project.
...
<InternalElement ID="bed34f88-7a3f-4e37-a32f-df1a6dcb954a" Name="S71500/ET200MP station_1">
<Attribute Name="TypeIdentifier" AttributeDataType="xs:string">
<Value>System:Device.S71500</Value>
<Attribute Name="TemplateIdentifier" AttributeDataType="xs:string">
<Value>GlobalLib://StationPlcLibrary/Master copies/DeviceFolder/S71500ET200MP station_1</
Value>
</Attribute>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
Device" />
...
<InternalElement ID="5082f437-4198-4dcb-b794-35b6b9fcd104" Name="PLC_1">
<Attribute Name="TypeIdentifier" AttributeDataType="xs:string">
<Value>OrderNumber:6ES7 214-1BE30-0XB0</Value>
<Attribute Name="TemplateIdentifier" AttributeDataType="xs:string">
<Value>GlobalLib://StationPlcLibrary/Master copies/PLC_1</Value>
</Attribute>
</Attribute>
</InternalElement>
...
</InternalElement>
...
• In the AML file the TemplateIdentifier sub-attribute under TypeIdentifier attribute can feature
on any Pluggable item and only on pluggable items. Any other entity in the AML file (e.g.
Channel/Tag) if it has a Template reference, shall be treated invalid and appropriate message
to be displayed to the user.
• The character '/' in the TemplateIdentifier path shall be considered as a delimiter for folder
segregation. In case a master copy object has a name having character '/', this might result in
CAx not able to find the master copy object.
• The import merge use cases with respect to device configuration having TemplateIdentifier
should work in same way as that of device configuration having TypeIdentifier
• Existing merge use cases with AML file having only TypeIdentifier should also behave as usual.
• In case of a conflict where the same device is present in both TIA and the AML file (with a
library reference to it), the Device in library if in this case has the PLC inside, the merge
operation shall only be able to rename the Station but not the PLC.
• There is a limitation in setting start address for input output modules when they are imported
from mastercopy. Once a start address is already assigned to a module, then it is not possible
to set the start address when it is created from TemplateIdentifier during import. The
important thing to note here is that users shall add the module into the mastercopy (while
preparing global libraries) before an address is assigned to it , that means the module should
not be connected to its master controller before it is put into the master copy.
Note
• A V16/V17 AML file with device/device item having 'TemplateIdentifier' should be imported
successful in TIA Portal V17
• A V16/V17 AML file with device/device item having 'TemplateReference' should not be
imported successfully in TIA Portal V17
• A V16 AML file with device/device item having 'TemplateReference' should be successful in
V16. This behavior for V16 TIAP shall not be changed.
• Prior to TIA Portal V17, device configuration which does not support module level(especially
main modules like Head module/CPU) library drag and drop support in TIA Portal could not
be supported in CAx library workflows.
However, this kind of configuration supports complete device level library drag and drop
where user shall include pre-configured rack and main module as part of device master copy
itself and put it in to library.
With this support from TIA Portal V17, CAx shall also extend to Import the whole device master
copy from library which shall have preconfigured rack and main module in it
Below are some of the expected behavior for importing preloaded device master copy using AML
file.
• In TIA Portal V17, any AML file with device configuration having device level library reference
(with rack and main module) should import successfully by creating device from library by
retaining rack and main module also from device master copy.
– Provided, Library reference is valid
– Provided, TypeIdentifier of rack and main module inside library is inline with respective
AML TypeIdentifier
• In TIA Portal V17, any AML file with device configuration having device level library reference
(with rack and main module) should import with error by still creating device from library
with retaining rack and main module also from device master copy
– When Library reference is valid
– When TypeIdentifier of rack or main module inside library is not matching with respective
AML TypeIdentifier
• In TIA Portal V17, any AML file with device configuration having device level library reference
(with rack and main module) should import without a warning by still creating device from
library with retaining rack and main module also from device master copy, when
– When Library reference is valid
– When FW of rack or main module inside device master copy is not matching with
respective AML FW
• In TIA Portal V17, any AML file with device configuration having device level library reference
(with rack and main module) should import without a warning by still creating device from
library with retaining rack and main module also from device master copy.
– When Library reference is valid
– When FW of rack or main module is missing in AML
Note
Every device configuration has different behavior wrt library workflows (drag and drop) in TIA
Portal. Some device families supports library workflows at granular level (device item level) ,
some at only complete device level and some even support both. Hence, CAx user shall
configure AML files with library references by keeping these TIA Portal aspects.
Below table shows list of device/deviceitems that supports import using library references.
Whitelist
TypeIdentifier FirmwareVersion
Whitelist
OrderNumber:6ES7 212-1HD30-0XB0
OrderNumber:6ES7 510-1DJ00-0AB0
OrderNumber:6ES7 221-3BD30-0XB0
OrderNumber:6ES7 511-1CK00-0AB0 V2.2
OrderNumber:6ES7 516-3AN01-0AB0 V1.8
OrderNumber:6ES7 518-4AP00-0AB0 V1.0
OrderNumber:6GK7 542-5DX00-0XE0 V1.8
OrderNumber:6ES7 611-4SB00-0YB7 V1.8
OrderNumber:6ES7 315-2FJ14-0AB0 V1.8
OrderNumber:6ES7 154-8AB01-0AB0 V1.0
OrderNumber:6ES7 141-4BF00-0AA0 V4.6
OrderNumber:6ES7 137-6BD00-0BA0 V3.1
OrderNumber:6ES7 147-4JD00-0AB0 V3.2
OrderNumber:6ES7 154-4AB10-0AB0
OrderNumber:3RK7 137-6SA00-0BC1 V2.2
OrderNumber:6ES7 518-4FP00-0AB0 V1.0
OrderNumber:6GK7 543-1AX00-0XE0 V7.0/Cu
OrderNumber:6ES7 516-2GN00-0AB0 V1.1
OrderNumber:6ES7 148-4CA00-0AA0 V2.5
OrderNumber:6ES7 148-4CA60-0AA0 V2.1
OrderNumber:6ES7 154-8FX00-0AB0 V2.1
OrderNumber:6ES7 148-4EA00-0AA0
OrderNumber:6ES7 151-7AA20-0AB0
OrderNumber:6ES7 138-4CA50-0AB0 V3.2
OrderNumber:6ES7 151-8AB00-0AB0
OrderNumber:6ES7 138-4CB11-0AB0 V2.6
OrderNumber:6ES7 151-7AA21-0AB0
OrderNumber:6ES7 138-4CA60-0AB0 V2.7
OrderNumber:6ES7 151-7FA21-0AB0
OrderNumber:6ES7 138-4CA01-0AA0 V3.3
OrderNumber:6GT2002-0HD00
OrderNumber:6ES7 142-4BD00-0AA0 V3.3
OrderNumber:6SL3 235-0TE21-1RB0
OrderNumber:6SL3 235-0TE21-1SB0 V1.0
OrderNumber:6SL3 514-1KE13-5AE0
OrderNumber:6ES7 148-4EB00-0AA0 V3.1
OrderNumber:6ES7 143-4BF00-0AA0 V3.1
OrderNumber:6ES7 134-6JD00-0CA1 V4.7.6
OrderNumber:6ES7 193-6PA00-0AA0
OrderNumber:6ES7 512-1SK00-0AB0
OrderNumber:3RK1 308-0AB00-0CP0 V2.0
OrderNumber:6ES7 512-1DK00-0AB0 V1.1
OrderNumber:6ES7 137-6BD00-0BA0 V1.8
OrderNumber:6ES7 135-6HD00-0BA1 V1.1
Whitelist
OrderNumber:6ES7 137-6AA00-0BA0 V1.8
OrderNumber:6ES7 510-1SJ01-0AB0 V2.1
OrderNumber:6ES7 138-6AA00-0BA0 V1.1
OrderNumber:3RK1 308-0BE00-0CP0 V1.0
OrderNumber:6ES7 135-6HB00-0DA1 V2.1
OrderNumber:6ES7 134-6FF00-0AA1 V1.2
OrderNumber:3RK1 308-0AE00-0CP0 V1.1
OrderNumber:6ES7 390-1***0-0AA0 V2.0
OrderNumber:6ES7 307-1BA00-0AA0 V1.0
OrderNumber:6ES7 318-3FL01-0AB0 V1.1
OrderNumber:6ES7 338-7XF00-0AB0
OrderNumber:6ES7 307-1KA01-0AA0
OrderNumber:6ES7 317-2FK13-0AB0 V3.2
OrderNumber:6GT2002-0GA10
OrderNumber:6ES7 307-1EA00-0AA0
OrderNumber:6ES7 317-6FF04-0AB0 V2.6
OrderNumber:6ES7 323-1BH01-0AA0
OrderNumber:6ES7 307-1EA80-0AA0
OrderNumber:6ES7 315-2FJ14-0AB0 V3.3
OrderNumber:6ES7 350-1AH03-0AE0
OrderNumber:6ES7 307-1EA01-0AA0
OrderNumber:6ES7 318-3EL00-0AB0 V3.2
OrderNumber:6ES7 321-7EH00-0AB0
OrderNumber:6ES7 307-1KA02-0AA0
OrderNumber:6ES7 317-2EK13-0AB0 V2.8
OrderNumber:6ES7 323-1BL00-0AA0
OrderNumber:6ES7 314-6BG03-0AB0
OrderNumber:6ES7 340-1AH02-0AE0 V2.6
OrderNumber:6ES7 313-6BG04-0AB0
Whitelist
TypeIdentifier FirmwareVersion
Whitelist
OrderNumber:6ES7 360-3AA01-0AA0 V2.6
OrderNumber:6ES7 314-1AG13-0AB0 V1.0
OrderNumber:6ES7 321-7TH00-0AB0 V3.3
OrderNumber:3RK1 335-0AS01-0AA0
OrderNumber:3RK1 305-0AS01-0AA0 V2.6
OrderNumber:3RW4900-0NC0
OrderNumber:6ES7 518-4AP00-0AB0 V41.0
OrderNumber:6ES7 155-5AA00-0AA0
OrderNumber:6ES7 523-1BL00-0AA0 V2.0
OrderNumber:6ES7 534-7QE00-0AB0 V2.1
OrderNumber:6ES7 157-1AA00-0AB0 V4.0
OrderNumber:6ES7 144-5KD00-0BA0 V1.0
OrderNumber:6ES7 145-5ND00-0BA0 V1.0
OrderNumber:6ES7 143-5AF00-0BA0 V1.0
OrderNumber:6ES7 147-5JD00-0BA0 V1.0
OrderNumber:6ES7 314-6EH04-0AB0 V1.0
OrderNumber:6ES7 153-4BA00-0XB0 V1.0
OrderNumber:6GK7 343-2AH01-0XA0 V1.0
OrderNumber:6ES7 155-6BU00-0CN0 V3.3
OrderNumber:6ES7 131-6BF00-0BA0 V4.0
OrderNumber:6ES7 516-3AN01-0AB0 V3.1
OrderNumber:6EP1332-4BA00 V3.1
OrderNumber:6EP3436-8MB00-2CY0 V1.1
OrderNumber:6EP4293-8HB00-0XY0 V2.1
OrderNumber:6EP4297-8HB00-0XY0
OrderNumber:6ES7 212-1BD30-0XB0 V1.1
OrderNumber:6EP4137-3AB00-2AY0 V1.1
OrderNumber:6EP4134-0GB00-0AY0 V1.1
OrderNumber:6ES7 516-3AN00-0AB0 V2.2
OrderNumber:6ES7 400-1TA01-0AA0 V2.2
OrderNumber:6ES7 405-0DA02-0AA0 V1.0
OrderNumber:6ES7 414-3EM05-0AB0 V1.8
OrderNumber:6ES7 412-1XJ05-0AB0
OrderNumber:6GK7 443-1EX11-0XE0
OrderNumber:6ES7 312-1AE13-0AB0 V5.3
OrderNumber:6GK7 343-1CX10-0XE0 V5.3
OrderNumber:6GK7 443-5DX04-0XE0 V2.7
OrderNumber:6GK7 342-5DA02-0XE0 V2.6
OrderNumber:6ES7 511-1AK00-0AB0 V2.4
OrderNumber:6GK7 542-1AX00-0XE0 V6.6
OrderNumber:6ES7 211-1BD30-0XB0 V5.0
OrderNumber:6GK7 242-7KX30-0XE0 V1.8
OrderNumber:6ES7 414-3EM05-0AB0 V1.0
OrderNumber:6ES7 151-1AA05-0AB0 V2.2
Whitelist
OrderNumber:6ES7 155-5AA00-0AC0 V1.0
OrderNumber:6ES7 155-6BU00-0CN0 V5.2
OrderNumber:6ES7 193-6PA00-0AA0
OrderNumber:6ES7 505-0KA00-0AB0 V3.0
OrderNumber:6ES7 521-1BH50-0AA0 V3.0
OrderNumber:6ES7 511-1TK01-0AB0 V1.0
OrderNumber:6ES7 515-2TM01-0AB0 V1.0
OrderNumber:6ES7 521-1BH00-0AB0 V2.0
OrderNumber:6ES7 521-1BL10-0AA0 V2.1
OrderNumber:6ES7 521-7EH00-0AB0 V2.1
OrderNumber:6ES7 521-1FH00-0AA0 V2.1
OrderNumber:6ES7 522-5HH00-0AB0 V1.0
OrderNumber:6AG1 511-1AK00-7AB0 V1.0
OrderNumber:6AG1 505-0KA00-7AB0 V2.0
OrderNumber:6AG1 531-7KF00-7AB0 V1.0
OrderNumber:6AG1 531-7NF10-7AB0 V1.8
OrderNumber:6AG1 532-5HD00-7AB0 V1.0
OrderNumber:6AG1 532-5HF00-7AB0 V2.0
OrderNumber:6AG1 521-1BH00-7AB0 V2.0
OrderNumber:6AG1 521-1FH00-7AA0 V2.0
OrderNumber:6AG1 522-1BF00-7AB0 V2.0
OrderNumber:6AG1 522-5FF00-7AB0 V2.0
OrderNumber:6AG1 550-1AA00-7AB0 V2.0
OrderNumber:6ES7 522-1BH01-0AB0 V2.0
OrderNumber:6AG1 513-1AL00-2AB0 V2.0
OrderNumber:6AG1 541-1AB00-7AB0 V1.1
OrderNumber:6AG1 542-5DX00-7XE0 V1.0
OrderNumber:6ES7 505-0RA00-0AB0 V1.8
OrderNumber:6ES7 518-4AP00-3AB0 V1.0
OrderNumber:6GK7 542-1AX00-0XE0 V1.0
OrderNumber:6ES7 551-1AB00-0AB0 V1.0
OrderNumber:6ES7 531-7PF00-0AB0 V2.1
OrderNumber:6AG1 516-3AN00-7AB0 V2.0
OrderNumber:6ES7 517-3TP00-0AB0 V1.1
OrderNumber:6ES7 540-1AD00-0AA0 V1.1
OrderNumber:6ES7 532-5HD00-0AB0 V1.8
OrderNumber:6ES7 507-0RA00-0AB0 V2.1
OrderNumber:6ES7 515-2AM00-0AB0 V1.0
OrderNumber:7MH4 980-1AA01 V2.1
OrderNumber:7MH4 980-2AA01 V1.0
OrderNumber:6ES7 553-1AA00-0AB0 V1.8
OrderNumber:6ES7 552-1AA00-0AB0
OrderNumber:6ES7 550-1AA00-0AB0
OrderNumber:6AG1 516-3AN00-2AB0 V1.0
Whitelist
OrderNumber:6AG1 540-1AD00-7AA0 V1.0
OrderNumber:6AG1 540-1AB00-7AA0 V1.1
OrderNumber:6AG1 541-1AD00-7AB0 V1.8
OrderNumber:6ES7 511-1CK00-0AB0 V1.0
OrderNumber:6ES7 531-7NF10-0AB0 V1.0
OrderNumber:6ES7 532-5HF00-0AB0 V1.0
OrderNumber:6ES7 512-1CK00-0AB0 V2.1
OrderNumber:6ES7 521-1BH10-0AA0 V2.1
OrderNumber:6ES7 522-1BF00-0AB0 V2.1
OrderNumber:6ES7 212-1BE40-0XB0 V2.1
OrderNumber:6ES7 234-4HE32-0XB0 V1.0
OrderNumber:6ES7 223-1BH30-0XB0 V2.1
OrderNumber:6GK7 243-1BX30-0XE0 V4.2
OrderNumber:3RK7243-2AA30-0XB0 V2.0
OrderNumber:6ES7 217-1AG40-0XB0 V1.0
OrderNumber:6GT2 002-0LA00 V3.0
OrderNumber:6ES7 518-4FP00-0AB0 V1.1
OrderNumber:6ES7 517-3UP00-0AB0 V4.2
OrderNumber:6ES7 511-1FK00-0AB0 V1.0
OrderNumber:6ES7 531-7QD00-0AB0 V2.1
OrderNumber:6ES7 517-3AP00-0AB0 V2.1
OrderNumber:6ES7 522-5EH00-0AB0 V1.8
OrderNumber:6ES7 522-1BH10-0AA0 V1.0
OrderNumber:3SU1 400-1LK10-*AA1 V2.1
OrderNumber:3SU1 400-1MA10-1BA1 V1.0
OrderNumber:6EP3436-8MB00-2CY0 V1.0
OrderNumber:6EP4436-8XB00-0CY0 V1.0
OrderNumber:6EP4131-0GB00-0AY0 V1.2
GSD:SIEM804C.GSD/M/0 V1.2
OrderNumber:6ES7 143-2BH*0-0AB0 V1.0
OrderNumber:6ES7 143-2BH00-0AB0
OrderNumber:6ES7 407-0DA02-0AA0
OrderNumber:6ES7 460-0AA01-0AB0
OrderNumber:6ES7 412-2XK07-0AB0
OrderNumber:6ES7 450-1AP00-0AE0
OrderNumber:6ES7 211-1AE31-0XB0
OrderNumber:6ES7 241-1CH32-0XB0 V7.0
OrderNumber:6ES7 211-1HD30-0XB0
OrderNumber:6ES7 241-1AH30-0XB0 V3.0
OrderNumber:6ES7 212-1AE31-0XB0 V2.2
OrderNumber:6ES7 221-1BF32-0XB0 V2.2
OrderNumber:6ES7 232-4HD30-0XB0 V1.0
OrderNumber:6ES7 510-1DJ01-0AB0 V3.0
OrderNumber:6ES7 512-1DK01-0AB0 V2.0
Whitelist
OrderNumber:6ES7 157-1AB00-0AB0 V1.0
OrderNumber:6ES7 512-1CK00-0AB0 V1.8
OrderNumber:6AG1 155-6AU00-7BN0 V1.8
OrderNumber:6AG1 193-6PA00-7AA0 V1.0
OrderNumber:6AG1 155-6AU00-7BN0 V1.8
OrderNumber:6ES7 313-6CF03-0AB0 V1.0
OrderNumber:6ES7 318-3EL00-0AB0 V1.0
OrderNumber:6ES7 151-3BA23-0AB0 V3.1
OrderNumber:3RK1 903-0BA00 V2.6
OrderNumber:3RK1 301-0BB13-1AA4 V2.7
OrderNumber:6ES7 518-4AP00-0AB0 V7.0
OrderNumber:6ES7 154-8AB00-0AB0
OrderNumber:6ES7 144-4PF00-0AB0
OrderNumber:6ES7 151-1BA02-0AB0 V1.6
OrderNumber:6ES7 131-4BB01-0AB0 V2.5
OrderNumber:6ES7 132-4BB01-0AA0
OrderNumber:6ES7 131-4BB01-0AA0
OrderNumber:6ES7 132-4BD00-0AB0
OrderNumber:6ES7 407-0KA02-0AA0
OrderNumber:6ES7 401-1DA01-0AA0
OrderNumber:6ES7 416-3ES06-0AB0
OrderNumber:6ES7 318-3EL01-0AB0
OrderNumber:6ES7 138-4DA04-0AB0
OrderNumber:6ES7 518-4FP00-3AB0 V6.0
OrderNumber:6ES7 317-2AJ10-0AB0 V3.2
OrderNumber:6ES7 132-4HB50-0AB0 V1.0
OrderNumber:6ES7 132-4BB31-0AA0 V2.0
OrderNumber:6ES7 416-3ER05-0AB0 V2.6
OrderNumber:6ES7 151-1AA04-0AB0
GSD:SIEM818A.GSD/M/70000
GSD:SIEM818A.GSD/M/13 V5.3
OrderNumber:6ES7 155-6AU00-0CN0
OrderNumber:6ES7 412-2XJ05-0AB0
OrderNumber:6ES7 431-7QH00-0AB0
OrderNumber:6ES7 432-1HF00-0AB0 V3.3
OrderNumber:6ES7 460-1BA01-0AB0 V5.3
OrderNumber:6ES7 416-2XN05-0AB0
GSD:SIEM818A.GSD/M/18
OrderNumber:7MH4 138-6AA00-0BA0
OrderNumber:6ES7 155-6AU00-0BN0 V5.3
OrderNumber:6ES7 513-1AL00-0AB0
OrderNumber:6ES7 521-1BL00-0AB0
OrderNumber:6ES7 522-1BL00-0AB0 V3.3
OrderNumber:6ES7 522-1BH00-0AB0 V1.8
Whitelist
OrderNumber:6ES7 540-1AB00-0AA0 V2.1
OrderNumber:6ES7 541-1AB00-0AB0 V2.0
OrderNumber:6GK7 542-5DX00-0XE0 V2.0
OrderNumber:6ES7 317-2EK14-0AB0 V1.0
OrderNumber:6ES7 516-3AN00-0AB0 V1.0
OrderNumber:6GK7 542-5FX00-0XE0 V2.0
OrderNumber:6GK7 543-1AX00-0XE0 V3.2
OrderNumber:6GK7 543-1AX00-0XE0 V1.1
OrderNumber:6ES7 516-3AN00-0AB0 V1.0
OrderNumber:6GK7 242-7KX30-0XE0 V1.0
OrderNumber:6ES7 211-1BE31-0XB0 V1.1
OrderNumber:6GK7 243-1JX30-0XE0 V1.5
OrderNumber:6GK7 243-5DX30-0XE0 V1.3
OrderNumber:6ES7 132-4BB01-0AB0 V3.0
OrderNumber:6ES7 152-1AA00-0AB0 V1.0
OrderNumber:6ES7 132-7GD00-0AB0 V1.0
OrderNumber:6ES7 334-0KE00-0AB0
OrderNumber:6ES7 151-3BA23-0AB0 V2.0
OrderNumber:OPC Server
OrderNumber:Application
OrderNumber:6ES7 214-1BG40-0XB0 V6.0
OrderNumber:6ES7 221-1BH32-0XB0 SW V14 ...
OrderNumber:6ES7 222-1XF30-0XB0 SW V8.1 SP2 ...
OrderNumber:6ES7 223-1QH30-0XB0 V4.2
OrderNumber:6ES7 231-4HF30-0XB0 V2.0
OrderNumber:6ES7 234-4HE30-0XB0 V1.0
OrderNumber:7MH4960-2AA01 V1.0
OrderNumber:6ES7 214-1AG40-0XB0 V1.0
OrderNumber:6ES7 228-1RC52-0AA0 V1.0
OrderNumber:6ES7 278-4BD32-0XB0
OrderNumber:6ES7 214-1HG31-0XB0 V4.2
OrderNumber:7MH4960-6AA01 V2.2
OrderNumber:7MH4960-4AA01 V2.0
OrderNumber:6ES7 223-1PL30-0XB0 V3.0
OrderNumber:6ES7 215-1BG40-0XB0
OrderNumber:6ES7 231-4HD30-0XB0
OrderNumber:6ES7 231-5PD32-0XB0 V1.0
OrderNumber:6ES7 231-5QF30-0XB0 V4.2
OrderNumber:6ES7 232-4HB32-0XB0 OrderNum‐ V1.0
ber:3RK1 301-0CB10-1AB4 V2.0
OrderNumber:3RK1 903-0CK00 V1.0
OrderNumber:6ES7 215-1HF40-0XB0 V2.0
OrderNumber:6ES7 212-1AF40-0XB0 V10.0
OrderNumber:6ES7 214-1HF40-0XB0
Whitelist
OrderNumber:6ES7 214-1AF40-0XB0 V4.2
OrderNumber:6ES7 515-2FM00-0AB0 V4.2
OrderNumber:6ES7 511-1UK01-0AB0 V4.2
OrderNumber:6ES7 215-1AG31-0XB0 V4.2
OrderNumber:6ES7 221-1BF30-0XB0 V1.8
OrderNumber:6ES7 222-1XF32-0XB0 V2.1
OrderNumber:6ES7 222-1HF30-0XB0 V3.0
OrderNumber:6ES7 223-1BL30-0XB0 V1.0
OrderNumber:6ES7 215-1HG40-0XB0 V2.0
OrderNumber:6ES7 241-1CH31-0XB0 V1.0
OrderNumber:6ES7 212-1HF40-0XB0 V1.0
OrderNumber:6AG1 214-1AG40-4XB0 V4.2
OrderNumber:6AG1 221-1BF32-2XB0 V1.0
OrderNumber:6AG1 221-1BF32-4XB0 V4.2
OrderNumber:6AG1 222-1BH32-2XB0 V4.2
OrderNumber:6AG1 222-1BF32-4XB0 V2.0
OrderNumber:6AG1 223-1BL32-2XB0 V2.0
OrderNumber:6AG1 214-1HG40-2XB0 V2.0
OrderNumber:6AG1 223-1PH32-2XB0 V2.0
OrderNumber:6AG1 223-1PL32-4XB0 V2.0
OrderNumber:6AG1 223-1QH32-4XB0 V4.2
OrderNumber:6AG1 222-1XF32-2XB0 V2.0
OrderNumber:6AG1 222-1HF32-4XB0 V2.0
OrderNumber:6AG1 222-1HH32-2XB0 V2.0
OrderNumber:6AG1 215-1BG40-5XB0 V2.0
OrderNumber:6AG1 231-5QF32-4XB0 V2.0
OrderNumber:6AG1 231-4HD32-4XB0 V2.0
OrderNumber:6AG1 222-1BF32-2XB0 V4.2
OrderNumber:6AG1 234-4HE32-2XB0 V2.0
OrderNumber:6AG1 278-4BD32-4XB0 V2.0
OrderNumber:6AG1 215-1AG40-4XB0 V2.0
OrderNumber:6AG1 221-1BH32-2XB0 V2.0
OrderNumber:6AG1 241-1CH32-2XB0 V2.0
OrderNumber:6AG1 215-1HG40-2XB0 V4.2
OrderNumber:6ES7 223-1PL32-0XB0 V2.0
OrderNumber:6ES7 228-1RC51-0AA0 V2.1
OrderNumber:6ES7 238-5XA32-0XB0 V4.2
OrderNumber:6ES7 215-1AF40-0XB0 V2.0
OrderNumber:6ES7 223-1BL32-0XB0 V2.2
OrderNumber:6AG1 212-1BE40-2XB0 V2.0
OrderNumber:6AG1 243-5DX30-2XE0 V4.2
OrderNumber:6AG1 212-1HE40-2XB0 V2.0
OrderNumber:6AG1 223-1QH32-2XB0 V4.2
OrderNumber:6EP3436-8SB00-2AY0 V1.3
Whitelist
OrderNumber:6EP3437-8MB00-2CY0 V4.2
OrderNumber:6EP4137-3AB00-2AY0 V2.0
OrderNumber:6EP4136-3AB00-2AY0 V1.1
OrderNumber:6EP4133-0GB00-0AY0 V1.1
OrderNumber:6ES7 138-4DC01-0AB0 V2.1
System:Port.Scalance/Comboport_MAU V2.1
OrderNumber:6GK1 160-4AT01 V1.0
OrderNumber:6GK1 160-4AA00
OrderNumber:6GK1 161-6AA02
OrderNumber:6GK1 551-2AA00 V2.7
OrderNumber:6GK1 571-1AA00 V2.6
OrderNumber:6GK1 562-3AA00 V2.7
OrderNumber:6GK1 561-3AA02 SW V6.1 ...
OrderNumber:6GK7 343-1GX31-0XE0 SW V7.1 SP1 ...
OrderNumber:6GK7 443-5DX05-0XE0 SW V7.1 SP2 ...
OrderNumber:6ES7 214-1BE30-0XB0 SW V12 ...
OrderNumber:6ES7 241-1AH32-0XB0 V3.0
OrderNumber:6ES7 211-1AD30-0XB0 V7.0
OrderNumber:6ES7 231-4HA30-0XB0 V2.2
OrderNumber:6ES7 214-1HG40-0XB0 V2.2
OrderNumber:6GK7 242-7KX30-0XE0 V2.2
OrderNumber:6ES7 212-1AD30-0XB0 V2.0
OrderNumber:6ES7 138-4GA50-0AB0 V4.0
OrderNumber:6ES7 132-4BF00-0AB0 V1.4
OrderNumber:6ES7 154-4AB10-0AB0 V2.0
OrderNumber:6ES7 154-8FB01-0AB0
OrderNumber:6ES7 155-6AU01-0BN0
OrderNumber:6ES7 155-6AU00-0DN0 V7.1/Cu
OrderNumber:6ES7 155-5AA00-0AB0 V3.2
OrderNumber:6ES7 155-5AA01-0AB0 V4.1
OrderNumber:6AG1 155-5AA00-2AC0 V4.0
OrderNumber:6ES7 155-5BA00-0AB0 V3.0
OrderNumber:6AG1 155-5BA00-2AB0 V4.1
OrderNumber:6ES7 518-4AP00-0AB0 V3.0
OrderNumber:6ES7 132-6BF00-0AA0 V3.0
OrderNumber:6ES7 132-6HD00-0BB0 V3.0
OrderNumber:6ES7 132-6BD20-0CA0 V2.5
OrderNumber:6ES7 134-6PA01-0BD0 V1.0
OrderNumber:6ES7 132-6HD00-0BB1 V1.1
OrderNumber:6ES7 531-7NF00-0AB0 V2.0
OrderNumber:6ES7 223-0BD30-0XB0 V3.0
OrderNumber:6ES7 212-1AE40-0XB0 V1.1
OrderNumber:6ES7 221-3AD30-0XB0 V1.1
OrderNumber:6ES7 214-1AE30-0XB0 V1.0
Whitelist
OrderNumber:6ES7 222-1BD30-0XB0 V4.2
OrderNumber:6ES7 222-1AD30-0XB0 V1.0
OrderNumber:6ES7 232-4HA30-0XB0 V2.2
OrderNumber:6ES7 416-3FR05-0AB0 V'.0
OrderNumber:6ES7 964-2AA04-0AB0 V1.0
OrderNumber:6ES7 414-3FM07-0AB0 V1.0
OrderNumber:6ES7 416-2FP07-0AB0 V5.3
OrderNumber:6ES7 151-8FB01-0AB0
OrderNumber:6ES7 151-7FA20-0AB0 V7.0
OrderNumber:6ES7 132-7RD22-0AB0 V7.0
OrderNumber:6ES7 132-7GD21-0AB0 V3.2
OrderNumber:6ES7 315-2EH13-0AB0 V2.6
OrderNumber:6ES7 322-8BH10-0AB0
OrderNumber:7MH4 900-2AA01
OrderNumber:7MH4 900-3AA01 V2.6
OrderNumber:7MH4 950-1AA01
OrderNumber:7MH4 950-2AA01
OrderNumber:7MH4920-0AA01
OrderNumber:7MH4910-0AA01
OrderNumber:6AG1 155-5AA00-7AB0
OrderNumber:6AG1 505-0RA00-7AB0
OrderNumber:6AG1 522-1BL00-7AB0
OrderNumber:3SU1 401-1MC*0-1CA1 V3.0
OrderNumber:3SU1 401-1ME*0-1DA1 V1.0
OrderNumber:6BK1900-0AA00-0AA* V1.0
OrderNumber:6BK1900-0BA00-0AA* V1.0
OrderNumber:6BK1900-0CA00-0AA* V1.0
OrderNumber:6BK1942-2AA00-0AA* /HCS4200
OrderNumber:6ES7 412-2EK06-0AB0 /HCS4200
OrderNumber:6GK7 343-2AH11-0XA0 /HCS4200
OrderNumber:6ES7 313-6CG04-0AB0
OrderNumber:6GK5 991-2AB00-8AA0 V6.0
OrderNumber:6GK5 992-2VA00-8AA0 V3.1
OrderNumber:6GK5 992-2AS00-8AA0 V3.3
OrderNumber:6GK5 400-8AS00-8AP2
OrderNumber:6GK5 905-0PA00
OrderNumber:6GK5 991-1AD00-8AA0 /legacy
OrderNumber:6GK5 992-1AQ00-8AA0
OrderNumber:6GK5 907-4PA00
OrderNumber:6ES7 143-2BH50-0AB0
OrderNumber:6ES7 405-0KA02-0AA0
OrderNumber:6ES7 513-1FL01-0AB0
OrderNumber:6ES7 134-7TD00-0AB0
OrderNumber:6ES7 516-3FN00-0AB0
Whitelist
OrderNumber:6ES7 151-8AB01-0AB0 V2.1
OrderNumber:3RK1 301-0BB10-1AA4
OrderNumber:6ES7 151-1CA00-3BL0 V1.8
OrderNumber:3RK1 301-0CB13-0AA4 V3.2
OrderNumber:6ES7 315-2EH14-0AB0
OrderNumber:6ES7 321-1BH02-0AA0
OrderNumber:6ES7 421-7BH01-0AB0
OrderNumber:6ES7 138-4HA00-0AB0 V3.2
OrderNumber:6SL3 244-0SA00-1AA1
OrderNumber:6SL3 244-0SA01-1AA1
OrderNumber:6GT2 002-0ED00 V1.0
OrderNumber:6ES7 135-7TD00-0AB0 ES9 3.0
OrderNumber:6ES7 340-1CH02-0AE0 3.0
OrderNumber:6ES7 352-1AH02-0AE0 V5.0/GENERIC
OrderNumber:6ES7 400-1TA11-0AA0
OrderNumber:6ES7 416-3XR05-0AB0 V1.0
OrderNumber:3RK1 301-0AB10-1AA3
OrderNumber:6ES7 672-7AC01-0YA0
OrderNumber:6ES7 307-1BA01-0AA0 V5.3
OrderNumber:6ES7 351-1AH01-0AE0
OrderNumber:6ES7 334-0CE01-0AA0 V2.1
OrderNumber:6ES7 312-5BF04-0AB0
OrderNumber:6ES7 313-5BG04-0AB0
OrderNumber:6ES7 338-7XF00-0AB0 IDENT
OrderNumber:6ES7 314-6CH04-0AB0
OrderNumber:6ES7 315-2AH14-0AB0 V3.3
OrderNumber:7ME4 120-2DH21-0EA0 V3.3
OrderNumber:6ES7 322-1CF00-0AA0
OrderNumber:6ES7 335-7HG02-0AB0 V3.3
OrderNumber:6ES7 338-4BC01-0AB0 V3.3
OrderNumber:6ES7 355-2CH00-0AE0
OrderNumber:7ME4 120-2DH20-0EA0
OrderNumber:6ES7 321-1CH20-0AA0
OrderNumber:6ES7 321-1CH00-0AA0 V3.0
OrderNumber:6ES7 322-8BF00-0AB0
OrderNumber:6ES7 322-1BL00-0AA0
OrderNumber:6ES7 322-1FF01-0AA0
OrderNumber:6ES7 305-1BA80-0AA0
OrderNumber:6ES7 341-1BH01-0AE0
OrderNumber:6ES7 331-7KB02-0AB0
OrderNumber:6ES7 331-7KF02-0AB0
OrderNumber:6ES7 331-1KF01-0AB0
OrderNumber:6ES7 332-5HB01-0AB0 V1.0
OrderNumber:6ES7 332-5HD01-0AB0
Whitelist
OrderNumber:6ES7 332-5HF00-0AB0
OrderNumber:6ES7 321-7RD00-0AB0
OrderNumber:6ES7 321-1FH00-0AA0
OrderNumber:6ES7 322-1HH01-0AA0
OrderNumber:6ES7 322-5HF00-0AB0
OrderNumber:6ES7 322-1HF10-0AA0
OrderNumber:6ES7 327-1BH00-0AB0
OrderNumber:6ES7 351-1AH02-0AE0
OrderNumber:6ES7 321-7BH01-0AB0
OrderNumber:6ES7 322-1BH01-0AA0
OrderNumber:6ES7 322-5GH00-0AB0
OrderNumber:6ES7 321-1FF01-0AA0
OrderNumber:6GK7 443-1EX41-0XE0
OrderNumber:6ES7 414-2XK05-0AB0
OrderNumber:6ES7 431-1KF00-0AB0
OrderNumber:6ES7 414-3XM05-0AB0
OrderNumber:6ES7 421-1EL00-0AA0 V1.0
OrderNumber:6ES7 414-3EM07-0AB0 V5.3
OrderNumber:6ES7 416-3XS07-0AB0
OrderNumber:6ES7 414-3FM06-0AB0 V5.3
OrderNumber:6ES7 421-1FH20-0AA0
OrderNumber:6ES7 416-3FS07-0AB0 V7.0
OrderNumber:6ES7 431-0HH00-0AB0 V7.0
OrderNumber:6ES7 416-2FN05-0AB0 V6.0
OrderNumber:6ES7 455-0VS00-0AE0
OrderNumber:6ES7 417-4XT07-0AB0 V7.0
OrderNumber:6ES7 421-1BL01-0AA0
OrderNumber:6ES7 422-1BL00-0AA0 V5.3
OrderNumber:6ES7 452-1AH01-0AE0
OrderNumber:6ES7 422-1BH11-0AA0 V7.0
OrderNumber:6ES7 421-7DH00-0AB0
OrderNumber:6ES7 422-1FH00-0AA0
OrderNumber:6ES7 422-1HH00-0AA0
OrderNumber:6ES7 452-1AH00-0AE0
OrderNumber:6ES7 455-1VS00-0AE0
OrderNumber:6ES7 450-1AP01-0AE0
OrderNumber:6GK7 443-5FX02-0XE0
OrderNumber:6ES7 517-3FP00-0AB0
OrderNumber:6ES7 515-2UM01-0AB0
OrderNumber:6ES7 531-7KF00-0AB0
OrderNumber:6ES7 211-1BE40-0XB0 V4.0
OrderNumber:6AG4114-2yxxx-xxxx//Device V2.1
OrderNumber:6AG4112-2yxxx-xxxx//Device V2.1
OrderNumber:6AG4114-2zxxx-xxxx//Device V2.1
Whitelist
OrderNumber:6AG4132-2yxxx-xxxx//DeviceOrder‐ V4.2
Number:6AV7884-0xyxx-xxxx//
Device.12inch.Touch
OrderNumber:6ES7647-7Byxx-xxxx//Device Order‐
Number:6AV7884-5xyxx-xxxx//
Device.19inch.Touch
OrderNumber:6AV7884-2xyxx-xxxx//
Device.15inch.Touch
OrderNumber:6ES7647-7Byxx-xxxx//Device
OrderNumber:6ES7647-7Bzxx-xxxx//Device Order‐
Number:6AV7853-0xzxx-xxxx//
Device.15inch.Touch OrderNum‐
ber:6AV7854-0xzxx-xxxx//Device.15inch.Key Or‐
derNumber:6AV7854-0xxxx-xxxx//
Device.15inch.Key OrderNumber:6ES7647-7Ayxx-
xxxx//Device OrderNumber:6AV7856-0xyxx-xxxx//
Device.19inch.Touch OrderNum‐
ber:6ES7647-7Ayxx-xxxx//Device OrderNum‐
ber:6AV7873-xxxxx-xBxx//Device.15inch.Key Or‐
derNumber:6ES7643-8yxxx-xxxx//Device Order‐
Number:6ES7647-6Byxx-xxxx//Device OrderNum‐
ber:6AV7870-xxxxx-xAxx//Device.12inch.Touch
OrderNumber:6AV7872-xxxxx-xAxx//
Device.15inch.Touch OrderNumber:6AV7874-
xxxxx-xBxx//Device.17inch.Touch
OrderNumber:6AV7875-xxxxx
-xAxx//Device.19inch.Touch
OrderNumber:6AG4112-0yxxx-xxxx//Device
ET200eco - HeadModules
ET200eco PN - HeadModules
SIMATIC RF600 - HeadModules
OrderNumber:3RK1 304-5KS40-2AA3
OrderNumber:3RK1 304-5LS40-2AA3
OrderNumber:3RK1 304-0HS00-8AA0
OrderNumber:3RK1 304-0HS00-6AA0
OrderNumber:6ES7 516-2PN00-0AB0
OrderNumber:6ES7 151-3BB23-0AB0 V3.0
OrderNumber:6ES7 154-6AB00-0AB0 V3.0
OrderNumber:6ES7 141-5AH00-0BA0 V1.0
V1.0
OrderNumber:6ES7 142-5AF00-0BA0
V2.1
OrderNumber:6ES7 143-5AH00-0BA0 V7.0
OrderNumber:6GK7 243-8RX30-0XE0 V1.0
OrderNumber:6ES7 212-1HE40-0XB0 V1.0
V1.0
OrderNumber:6ES7 518-4FP00-0AB0
V1.0
OrderNumber:6AG1 215-1HG40-4XB0 V3.0
OrderNumber:6ES7 138-4FD00-0AA0 V4.2
OrderNumber:6ES7 134-4NB51-0AB0 V2.1
V4.2
OrderNumber:6ES7 135-4GB52-0AB0
Whitelist
OrderNumber:6ES7 138-7AA00-0AA0
OrderNumber:6ES7 138-7BB00-0AB0
OrderNumber:6ES7 145-4GF00-0AB0
OrderNumber:6ES7 143-4BF50-0AA0
OrderNumber:6GK5 980-3CB00-0AA1
OrderNumber:6GK5 980-3CB00-0AA7
OrderNumber:6GK5 991-4AB00-8AA0
OrderNumber:6GK5 992-4AL00-8AA0
OrderNumber:6GK5 992-4SA00-8AA0
OrderNumber:6GK5 992-4RA00-8AA0
OrderNumber:6GK5 992-4GA00-8AA0
OrderNumber:6GK5 991-1AE00-8AA0
OrderNumber:6GK5 991-1AF00-8AA0
OrderNumber:6GK5 992-1AL00-8AA0
OrderNumber:6GK5 992-1AN00-8AA0
OrderNumber:6ES7 174-0AA10-0AA0
OrderNumber:6GK5 204-0BA00-2BF2
OrderNumber:6NH9 741-1AA00
OrderNumber:6ES7 133-1BL01-0XB0
OrderNumber:6ES7 132-1BL00-0XB0
OrderNumber:6ES7 132-1BH00-0XB0
OrderNumber:6ES7 131-1BL01-0XB0
OrderNumber:6ES7 131-1BH01-0XB0
OrderNumber:3RK1 207-2BQ44-0AA3 ET200eco -
HeadModules
ET200eco PN - HeadModules
SIMATIC RF600 - HeadModules
OrderNumber:3RK1 304-5KS40-2AA3
OrderNumber:3RK1 304-5LS40-2AA3
OrderNumber:3RK1 304-0HS00-8AA0
OrderNumber:3RK1 304-0HS00-6AA0
OrderNumber:6ES7 516-2PN00-0AB0
OrderNumber:6ES7 151-3BB23-0AB0
OrderNumber:6ES7 154-6AB00-0AB0
OrderNumber:6ES7 141-5AH00-0BA0
OrderNumber:6ES7 142-5AF00-0BA0
OrderNumber:6ES7 143-5AH00-0BA0
OrderNumber:6GK7 243-8RX30-0XE0
OrderNumber:6ES7 212-1HE40-0XB0
OrderNumber:6ES7 518-4FP00-0AB0
OrderNumber:6AG1 215-1HG40-4XB0
OrderNumber:6ES7 138-4FD00-0AA0
OrderNumber:6ES7 134-4NB51-0AB0
OrderNumber:6ES7 135-4GB52-0AB0
Whitelist
OrderNumber:6ES7 138-7AA00-0AA0
OrderNumber:6ES7 138-7BB00-0AB0
OrderNumber:6ES7 145-4GF00-0AB0
OrderNumber:6ES7 143-4BF50-0AA0
OrderNumber:6GK5 980-3CB00-0AA1
OrderNumber:6GK5 980-3CB00-0AA7
OrderNumber:6GK5 991-4AB00-8AA0
OrderNumber:6GK5 992-4AL00-8AA0
OrderNumber:6GK5 992-4SA00-8AA0
OrderNumber:6GK5 992-4RA00-8AA0
OrderNumber:6GK5 992-4GA00-8AA0
OrderNumber:6GK5 991-1AE00-8AA0
OrderNumber:6GK5 991-1AF00-8AA0
OrderNumber:6GK5 992-1AL00-8AA0
OrderNumber:6GK5 992-1AN00-8AA0
OrderNumber:6ES7 174-0AA10-0AA0
OrderNumber:6GK5 204-0BA00-2BF2
OrderNumber:6NH9 741-1AA00
OrderNumber:6ES7 133-1BL01-0XB0
OrderNumber:6ES7 132-1BL00-0XB0 V1.1
OrderNumber:6ES7 132-1BH00-0XB0 V5.3
OrderNumber:6ES7 131-1BL01-0XB0 V1.1
OrderNumber:6ES7 131-1BH01-0XB0
OrderNumber:3RK1 207-2BQ44-0AA3
Below table shows list of device/deviceitems that does not support import using library
references.
Blacklist
TypeIdentifier FirmwareVersion
OrderNumber:6AG1 193-6AR00-7AA0 V0.0
OrderNumber:6ES7 193-6AR00-0AA0 V0.0
OrderNumber:6GK5 991-2VA00-8AA2 V0.0
OrderNumber:6ES7 193-6AM00-0AA0 V0.0
OrderNumber:6ES7 193-6AF00-0AA0 V0.0
OrderNumber:6ES7 193-6AP00-0AA0 V0.0
OrderNumber:6ES7 193-6AP20-0AA0 V0.0
OrderNumber:6ES7 193-6AP40-0AA0 V0.0
OrderNumber:6ES7 193-6AG00-0AA0 V0.0
OrderNumber:6ES7 193-6AG20-0AA0 V0.0
OrderNumber:6ES7 193-6AG40-0AA0 V0.0
OrderNumber:6ES7 193-6AP40-0AA0 V0.0
OrderNumber:6DL1 193-6AG00-0AA0 V0.0
OrderNumber:6DL1 193-6AF00-0AA0 V0.0
OrderNumber:6DL1 193-6AR00-0AA0 V0.0
OrderNumber:6DL1 193-6AG20-0AA0 V0.0
OrderNumber:6DL1 193-6AG40-0AA0 V0.0
OrderNumber:6ES7 655-5PX11-0XX0 V1.2
SIMATIC COMMUNICATION MODULES - HeadMod‐
ules
SIMATIC optical identification systems - HeadMod‐
ules
OrderNumber:6AV6 646-1AC22-0AX0
V2.0
OrderNumber:6GK5 826-2AB00-2AB2
V5.0
OrderNumber:6GK5 991-1AD00-8FA0
SCALANCE XC208 - HeadModules
SCALANCE XB208- HeadModules
SENTRON - HeadModules
OrderNumber:6GK5 992-4AS00-8AA0
Additional Ethernet devices
Industrial PCs
PCU 50.5
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The PLC is offline.
Application
The Device object is a container object for a central or distributed configuration. It is the parent
object for DeviceItem objects and the top level internal element of the instance hierarchy of
the TIA Portal project in between an AML file's structure.
The CAx data export supports the following types of devices specified via the AML type identifier:
• Physical modules
• GSD/GSDML based devices
• Systems
Devices can be grouped in a DeviceUserFolder object.
Note
Export of a single device also exports all subnets in the project.
Attributes
The following table shows the related attributes of the device object for CAx import and export
files:
But CAx import shall handle these as well to create proper devices.
The following devices support generic device or no type identifier substitution:
• GSD and GSDML devices
• Devices based on MDD (Non-GSD/GSDML devices)
For Generic device or device having no type identifier and Generic Rack, type identifier
replacement , it is mandatory that the head module (in case of decentral devices) or PLC (in case
of central devices) has to be present in the rack described in the AML file, otherwise the device
with no type identifiers or generic device and generic rack type identifier substitution shall fail.
The following XML structure shows a device configuration with non generic type identifier:
The following XML structure shows a device configuraton with generic type identifier:
The following XML structure shows a device configuration with type identifier available for
device.
The following XML structure shows a device configuration with No Type Identifier available for
device.
See also
Structure of the CAx data for importing/exporting (Page 1076)
AML type identifiers (Page 1080)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The PLC is offline.
Application
The Device object is a container object for a central or distributed configuration. It is the parent
object for DeviceItem objects and the top level internal element of the instance hierarchy of
the TIA Portal project in between an AML file's structure.
The CAx data import supports the following types of devices specified via the AML type identifier:
• Physical modules
• GSD/GSDML based devices
• Systems
• Generic devices
If a DeviceUserFolder object exists in the TIA Portal project, the devices will be grouped in
the respective folder.
If you only know the identification (TypeIdentifier) of a head module or a PLC and not of the
respective rack and device, you can import a generic rack.
Example: TypeIdentifier = System:<Prefix>.Generic
For generic device replacement, the following elements have to be present in the rack described
in the AML file:
• Central devices: PLC
• Decentral devices: Head module
If devices are generic, the attribute BuiltIn defines the kind of rack or module:
• physical: BuiltIn = True
• generic: BuiltIn = False
See also
Structure of the CAx data for importing/exporting (Page 1076)
AML type identifiers (Page 1080)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
In TIA Portal, you can export the address objects of IO device items to an AML file. While
importing to an empty TIA Portal project, the imported device items retains the address objects
in its respective IO device items.
The Address attribute in the AML file contains RefSemantic mandatorily set to the specified value
named OrderedListType.
Up to TIA Portal V16, It is expected that addresses should be in same order to support export and
import of device item. For example, if a device item supports two addresses (Input and Output)
in TIA Portal and same device item in AML file comes with addresses (Output and Input),
addresses are not processed due to mismatch in order.
From TIA Portal V17, CAx import operation, for a particular address from AML file shall find the
matching TIA address based on I/O type, and shall try to set the same. The order in the AML file
shall not matter any more.
Note
• The feature supports any type of device item with an address object of Input/Output type
• Input and Output addresses of length 0 shall be excluded from export and ignored at import
• Export of address attribute shall be skipped for the addresses having startaddress as -1.
However during import, warning message shall be shown for the addresses having
startaddress as -1
AML Structure
The following figures shows a partial element structure of the exported AML file. It contains the
Address elments and its attributes.
<Attribute Name="Address">
<RefSemantic CorrespondingAttributePath="OrderedListType" />
<Attribute Name="1">
<Attribute Name="StartAddress" AttributeDataType="xs:int">
<Value>0</Value>
</Attribute>
<Attribute Name="Length" AttributeDataType="xs:int">
<Value>16</Value>
</Attribute>
<Attribute Name="IoType" AttributeDataType="xs:string">
<Value>Input</Value>
</Attribute>
</Attribute>
</Attribute>
Pruned XML
Pruning is the act of optimizing the content by removing certain things which are not necessarily
to be provided in the XML. In this reduced xml, the auto created sub module information are not
be provided, and its corresponding address object are provided under the immediate parent.
The following figure shows a partial element structure of the exported AML file before pruning.
In the pruned AML file, the sub module information like <InternalElement> element is removed
and its corresponding address objects are retained.
<Attribute Name="Address">
<RefSemantic CorrespondingAttributePath="OrderedListType"/>
<Attribute Name="1">
<Attribute Name="StartAddress" AttributeDataType="xs:int">
<Value>20</Value>
</Attribute>
<Attribute Name="Length" AttributeDataType="xs:int">
<Value>256</Value>
</Attribute>
<Attribute Name="IoType" AttributeDataType="xs:string">
<Value>Input</Value>
</Attribute>
</Attribute>
</Attribute>
See also
Pruned AML (Page 1072)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
In TIA Portal, you can export the channel objects of IO device items to an AML file. While
importing to an empty TIA Portal project, the imported device items retains the channel objects
in its respective IO device items.
<ExternalInterface> element represents in node and subnet internal elements, and indicates
that nodes and subnets are connected.
Channel numbering
Digital Input,Digitial Output, Analog Input, Analog Ouput, and Technology channels are
numbered as DI_0, DO_0, AI_0, AO_0,TO_0 respectively. Channels on the device items itself are
numbered first, and channels on sub-device items are numbered subsequently(depth first).
Every additional device item has its own channel numbers starting from 0.
AML structure
The following figures shows a partial element structure of the exported AML file.
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The PLC is offline.
Application
The export of device item objets is only applicable for PLC devices.
DeviceItem objects are nested children of a Device object. An object of the type
DeviceItem can be a rack or an inserted module.
• The first child item of a device is of type "rack". The PositionNumber of a rack starts with
0. If there are multiple racks, they are consecutively numbered (1, 2, 3, …).
There are no restrictions about the ordering in the AML file within one hierarchy level.
• All further children of the type "rack" are modules.
The CAx data export supports the following types of device items specified via the AML type
identifier:
• Physical modules
• GSD/GSDML modules
Attributes
The following table shows the related attributes of the object for CAx import and export files:
The following table shows the nested attributes of the "Address" attribute of the object
"DeviceItem":
See also
Export/Import of GSD/GSDML based devices and device items (Page 1184)
Structure of the CAx data for importing/exporting (Page 1076)
AML type identifiers (Page 1080)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• The PLC is offline.
Application
The import of device item objets is only applicable for PLC devices.
DeviceItem objects are nested children of a Device object. An object of the type
DeviceItem can be a rack or an inserted module.
• The first child item of a device has to be of type rack. The PositionNumber of a rack starts
with 0. If there are multiple racks, they are consecutively numbered (1, 2, 3, …).
There are no restrictions about the ordering in the AML file within one hierarchy level.
• All further children of the type rack are modules.
The CAx data imporet supports the following types of device items specified via the AML type
identifier:
• Physical modules
• GSD/GSDML modules
• Generic modules
If you only know the identification (TypeIdentifier) of a head module or a PLC and not of the
respective rack and device, you can import a generic rack.
Example: TypeIdentifier = System:Rack.Generic
For generic rack replacement, the following elements have to be present in the rack described
in the AML file:
• Central devices: PLC
• Decentral devices: Head module
A generic rack type derives from the Device type. Therefore, an AML file that is imported to TIA
Portal can use this rack's type identifier:
In this case the TIA Portal determines the type identifier for the rack.
If racks and modules are generic, the attribute BuiltIn defines the kind of rack or module:
• physical: BuiltIn = True
• generic: BuiltIn = False
Restrictions
While importing, the attribute DeviceItemType has no relevance and hence it is optional.
Note
Attribute "FirmwareVersion"
If no FirmwareVersion is specified in the import file CAx import uses the latest firmware
version which is available in the TIA Portal
If the FirmwareVersion attribute exists in the import file with an empty value, the device item
import fails and an error message will be logged.
Imported Configuration
The following figure shows the imported configuration in the TIA Portal user interface:
See also
Structure of the CAx data for importing/exporting (Page 1076)
AML type identifiers (Page 1080)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
The CAx Import/Export of GSD/GSDML based devices and device items is similar to the import/
export of standard devices.
For GSD/GSDML based devices and device items the exportable attributes differ, e. g. for GSD/
GSDML the attribute Label exists.
Generic import of devices and racks are possible. For the import, you use the same identifier as
for standard devices:
• Import of a generic device: TypeIdentifier = System:Device.Generic
• Import of a generic rack: TypeIdentifier = System:Rack.Generic
If devices are generic, the attribute BuiltIn defines the kind:
• physical: BuiltIn = True
• generic: BuiltIn = False
The following XML structure shows a GSDML device configuration with device (no type
identifier) and rack (generic type identifier):
The following XML structure shows a GSDML device configuration with device (generic type
identifier) and rack (generic type identifier):
See also
AML type identifiers (Page 1080)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
In TIA Portal, ports are used for inter-device communication and found under interfaces. But
there are certain kind of devices where the ports are found directly under the device items which
are not interfaces. This is not in accordance with the AML standards where ports are always
looked for under interfaces.
CAx shall use an imaginary interface referred to Virtual interface to export and import device
configuration in case ports are found directly under non-interface device items.
The virtual interface shall be exported with the following attributes till before TIA Portal v16 :
• Name as ScalanceInterface_1
• Label as Switch
From TIA Portal v16 the virtual interface shall be exported with the below attributes
• Name as VirtualInterface_1
• Label as X1
• Type as Ethernet
Import
CAx shall support import of virtual interfaces. In this case, it is expected to process the ports
under the Virtual interface in the AML file under the right parent in the TIA Portal. Here any
interface with Label as switch is to be considered as virtual interface. But with TIA Portal v16,
Label is nor more identifier as it is changed to X1, which is just like a real interface.
Type attribute although is set to "Ethernet" for virtual interface and it is optional. So with TIA
Portal v16 all interface elements in AML file not labelled to "Switch" shall be treated in a general
way, and whenever encountered in AML file CAx shall try to fetch from TIA Portal.
In case of Virtual interface, CAx shall fail to find it but process the ports inside it. But in case of
real interface if CAx doesn't find it, the ports inside it shall not be processed
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
AML structure
Subnets describe a physical network especially which devices are connected to the same
network of type PROFIBUS, PROFINET, MPI or ASI.
The link between a network and the device items are modeled as a reference to the network
object. There is no reference from the network object to the attached device items. The network
parameters are stored in the network object. The parameters concerning a network interface of
a given device item, attached to a network, are stored in a net node object in that device item.
The communication is often regulated using “channels”, “ports” and “interfaces”.
Subnets are exported as internal elements of the role class "Subnet" in the instance hierarchy in
the AML file.
A subnet has the following related elements in the AML structure:
• Internal element of the role class "Node"
Defines the interface on a device item.
• <InternalLink>
Defines the connected partners of the subnet. <InternalLink> tags name is unique and
is always added under the project's internal element in the AML file.
• <ExternalInterface>
Represents in node and subnet internal elements that nodes and subnets are connected. If
the nodes or subnets are not connected then the <ExternalInterface> element for
node and subnet do not exist.
Application
In TIA Portal V16,CAx import supports Ethernet and Profinet and export will always be Ethernet
for Subnet Type and Node attributes.
The CAx Import/Export supports the following types of subnets:
• Ethernet
• PROFIBUS
• MPI
• ASi
For Profinet node, the availability of attributes which will differ again based on certain pre
conditions. For ex:
• If in TIA Portal UI Ip protocol selected is "Set IP address in the project", then "NetworkAddress"
and "SubnetMask" will be available.
• The attribute "RouterAddress" shall be available for export/import if Ip protocol selected is
"Set IP address in the project" and "Use router" is selected in UI.
• The attribute "DhcpClientId" shall be available for export/import only if the attribute
'IpProtocolSelection' is 'Dhcp'.
CAx Import special case where 'Type' attribute necessary - Profibus subnet connection is done by
changing interface type MPI to PROFIBUS in UI.
• In TIA portal for some device items, by default interface type is Mpi. But it is required to be
changed to Profibus to make Profibus subnet connection. In this case, Type should be
specified with 'Profibus' value in AML file to indicate Type conversion while importing.
Note
• CAx import will support Ethernet and Profinet for Subnet Type and Node Type attribute.
• CAx import of an AML file with 'case invariant' string values for the attributes (For ex:
Profinet, PROFINET, pROFINET, ProFINET etc.,) should be supported.
• CAx export will always be Ethernet.
AML structure
The following figures show the structure of the exported AML file:
Below XML snippet depicts the AML file with Node "Ethernet" with extended role.
See also
Structure of the CAx data for importing/exporting (Page 1076)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
AML structure
IO-system are represented in the AML structure as <InternalElement>.
IO-system of as master or IO controller are added under the element
<CommunicationInterface> of an interface device item.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
The CAx data exchange exports and imports comments and multilingual comments of the
following hardware objects:
• Devices (Device)
• Modules (DeviceItems)
• Tags (Tag)
The import/export of multilingual comments comprises all TIA Portal languages.
Restrictions
• Export
– Only if a comment exists, a "Comment" attribute is exported to the AML file.
• Import
– The "Comment" attribute is optional.
– For virtual device items, no comments can be imported.
AML structure
After the export of this configurations, the multilingual comments are generated as nested
attributes of the device, device item or tag.
• The parent attribute "Comment" shall have the value used in default language.
• A child attribute exists for every foreign-language comment.
See also
Structure of the CAx data for importing/exporting (Page 1076)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is opening
See Opening a Project (Page 113)
Application
It shall be possible to have a device with multiple racks having extension rack connections
exported in to AML file and import it to get same device with extension rack connections created
back in TIA Portal project.
In TIA Portal, extension rack connections between multiple racks are modeled under DeviceItem
objects (ET-Con_1, ET-Con_2 and ET-Connection Receiver) directly. However as per AR APC
recommendation, these connections to be modeled as Port-to-Port connection under a
CommunicationPort.
So, to make it in line with the recommendation, a dummy CommunicationInterface having
dummy CommunicationPort objects shall be added under respective DeviceItem objects.
AML Export
The AML file that shall be generated during export for the above configuration is depicted below.
<Value>ET-Con</Value>
</Attribute>
...
<InternalElement ID="ad638a2a-538e-4840-9d99-7712522431ba" Name="Port_1">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>X30</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>2</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<ExternalInterface ID="6a517987-ae22-4446-b361-91aea2c768be"
Name="CommunicationPortInterface"
RefBaseClassPath="AutomationProjectConfigurationInterfaceClassLib/
CommunicationPortInterface" />
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
...
<InternalLink Name="Link To Port_1"
RefPartnerSideA="32758129-15db-43c7-9deb-53613852b208:CommunicationPortInterface"
RefPartnerSideB="ad638a2a-538e-4840-9d99-7712522431ba:CommunicationPortInterface" />
<InternalLink Name="Link To Port_2"
RefPartnerSideA="6bb61ad0-13ac-455b-9a90-6cbaddeaabd4:CommunicationPortInterface"
RefPartnerSideB="cac8af19-67bc-41aa-a3f0-7149af8f67d4:CommunicationPortInterface" />
Note
The extension rack interface shall be exported only when extension rack connections are
present. Also, the number of dummy ports added under extension ET-Con dummy interface is
based on the ports participating in extension rack connection at module level.
Internal link- Extension racks connections are represented using <InternalLink> tags.
<InternalLink> tags shall be added under common parent of multiple racks (i.e., Device).
Internal link name shall be unique across the common parent.
Import AML
It shall be possible to import extension rack connections details from an AML file which is
generated out of above-mentioned export. However, it shall also be possible to import AML files
which are created in previous versions of TIA Portal.
Note
1. The export hierarchy change behavior shall be applicable only in version V16 onwards. Older
version TIA portal shall have same behavior as previous.
2. The hierarchy in AML file shall not influence/affect the TIA Portal internal hierarchy after
import.
3. This hierarchy change/transformation behavior is applicable for ET200 AL and ET200 SP with
extension rack connections.
4. The AML file with “case invariant” string values for the Type attribute (For ex: ET-Con, et-con,
ET-con etc.,.) shall also be imported without any failure.
The AML file that shall be generated during export for the above configuration is depicted below.
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<ExternalInterface ID="33caac7c-2944-4b1d-9fb8-8a451e4c1c25"
Name="CommunicationPortInterface"
RefBaseClassPath="AutomationProjectConfigurationInterfaceClassLib/
CommunicationPortInterface" />
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
<InternalElement ID="d1aa8afe-e20a-4b82-996a-9fca151b2c51" Name="RackExtension">
<Attribute Name="Type" AttributeDataType="xs:string">
<Value>ET-Con</Value>
</Attribute>
...
<InternalElement ID="e713beda-1d1c-48d7-8674-8640080c87f7" Name="Port_1">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>X30</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>2</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<ExternalInterface ID="046e2a6a-dca9-4a63-8f4f-53cabac1a65c"
Name="CommunicationPortInterface"
RefBaseClassPath="AutomationProjectConfigurationInterfaceClassLib/
CommunicationPortInterface" />
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<InternalElement ID="81999cc0-694f-4f7b-ba12-72ee9010cb11" Name="Port_2">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>X31</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>3</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<ExternalInterface ID="e611d310-9ff7-45bb-b379-36e9cbea5080"
Name="CommunicationPortInterface"
RefBaseClassPath="AutomationProjectConfigurationInterfaceClassLib/
CommunicationPortInterface" />
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationInterface" />
</InternalElement>
...
Note
For side by side connections extension rack interface shall be exported only when modules were
plugged next to each other. Also, the number of dummy ports added under extension ET-Con
dummy interface is based on the ports participating in extension rack connection at module
level. In above example, “DI_02” module is plugged in between modules “DI_01” and “DI_03”
modules, so in exported AML file corresponding ET-Con dummy interface has two dummy ports.
But incase of “AI_01” module which does not have any side by side modules. So, in this case
“AI_01” module which is not having any ET-Con dummy interface details. Importing the AML file
back to an empty TIA Portal project shall create the same device having multiple racks with
extension rack connections.
• For ET200 AL and ET200SP modules, TIA Portal support default connection between primary
rack and extension racks when relevant modules are plugged. In such case, connection
information from AML file has no relevance during Import.
• Side by Side connection descriptions in the AML file has no relevance during the import since
the side by side connections are automatically established when there are two adjacent
modules imported into the same rack.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
Application
You can use TIA Portal V17 to perform CAx export/import of AML files with ARE APC Drive
recommendation document of version V1.2.0.
It shall be possible to export/import ARE APC Drive recommendation document identifier as part
of additional information in the AML file, but the drive configuration if present in the project shall
still be exported with respect to AR APC V1.2.0.
AML file
Below XML snippet depicts the AML file with ARE APC Drive document identifier along with AR
APC 1.2.0.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open.
See Opening a project (Page 113)
• PLC is offline.
Application
Exported and imported symbols and tags are assigned to a device item. CAx import/export
concerns hardware oriented symbols and tags. The symbols and tags are exported only with the
controller target device item, e. g. the CPU and not with other device items they might refer to,
e. g. an I/O module. Like devices, the tags are often grouped in tag tables and in a hierarchical
folder structure.
Note
TIA Portal V16 supports export and import of IoType attribute in AML file with AR APC V1.1.0
See also
Structure of the CAx data for importing/exporting (Page 1076)
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness is connected to theTIA Portal
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is offline
Application
You can use TIA Portal to export and import AML file following AR APC V1.1 with R/H PLC having
same IP Address configuration.
Attribute
TIA Portal supports only one attribute in AML file for R/H PLC, if available in TIA Portal user
interface:
Restriction
• Export
- Only if the "Enable the system IP address for switched connection" in TIA Portal is selected.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is offline
Application
You can use TIA Portal to export and import AML file following AR APC V1.1 with 'Customized'
sub-attribute of tag and deviceitem.
Attribute
The following table shows the related attribute available for a tag during CAx import and export
files:
The following table shows the related attribute available for a deviceitem during CAx import and
export files:
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is offline
Application
You can use TIA Portal to export and import an AML file following AR APC V1.1 with FailSafe PLC
having failsafe attributes.
Attributes
The following table shows the list of failsafe attributes for CAx import and export AML files:
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement> <InternalElement ID="0f746d71-035e-4e64-b0d7-51d0449cfd88" Name="OPC
UA_1">
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>254</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value> </Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
DeviceItem" />
</InternalElement>
<InternalElement ID="a0633104-a2ac-4680-bb99-81df50f5ec40" Name="PROFINET interface_1">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>X1</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>32768</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<InternalElement ID="e3497176-dbba-4fec-9d3a-772ae13987c4" Name="E1">
<Attribute Name="Type" AttributeDataType="xs:string">
<Value>Ethernet</Value> </Attribute>
<Attribute Name="NetworkAddress" AttributeDataType="xs:string">
<Value>192.168.0.1</Value>
</Attribute>
<Attribute Name="SubnetMask" AttributeDataType="xs:string">
<Value>255.255.255.0</Value>
</Attribute>
<Attribute Name="IpProtocolSelection" AttributeDataType="xs:string">
<Value>Project</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/Node" />
</InternalElement>
<InternalElement ID="3208384f-d5ba-4ccb-b8da-f08ec38ec681" Name="Port_1">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>P1 R</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>32769</Value>
</Attribute>
<Attribute Name="BuiltIn" AttributeDataType="xs:boolean">
<Value>true</Value>
</Attribute>
<SupportedRoleClass RefRoleClassPath="AutomationProjectConfigurationRoleClassLib/
CommunicationPort" />
</InternalElement>
<InternalElement ID="4a47c05e-9656-4e02-9b51-23b065b6fe47" Name="Port_2">
<Attribute Name="Label" AttributeDataType="xs:string">
<Value>P2 R</Value>
</Attribute>
<Attribute Name="PositionNumber" AttributeDataType="xs:int">
<Value>32770</Value>
</Attribute>
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a project (Page 113)
• PLC is offline
Application
You can use TIA Portal to export and import an AML file following AR APC V1.1 with FailSafe IO
having failsafe attributes.
Attributes
The following table shows the related attributes available on Failsafe IO module/submodule for
CAx import and export files :
Note
• For most of the Failsafe IO's, FSourceAddress is a ReadOnly it is not writable and is a
reflection of FCentralFSourceAddress attribute of failsafe PLC. The same value shall get
exported and ignored during import.
• If the FSourceAddress and FDestinationAddress are Readonly, then value shall be exported.
However, during import warning message should be displayed in info tab of TIA Portal.
• FSourceAddress and FDestinationAddress should be supported for IO module and sub
module level.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Requirement
• The TIA Portal Openness application is connected to the TIA Portal.
See Connecting to the TIA Portal (Page 81)
• A project is open
See Opening a Project (Page 113)
Application
In TIA Portal, you can export and import an AML file for device and deviceitems having
"Manufacturer" attribute so that you can exchange vendor specific information in round trip
scenarios.
The attribute "Manufacturer" is not supported by Openness. It shall be consumed through
"Transformation Plugin" during Export/Import. AML file with AR Drive recommendation
document of version 1.0 is supported.
Note
AML files shall be generated(exported) by TIA Portal V16 following AR APC V1.1.
Export
You can export the "Manufacturer" attribute into AML file, if it is available in AmiModel, which
shall be filled by "Transformation Plugin" users.
Import
You can import "Manufacturer" attribute to TIA Portal, wherein vendor specific attribute is
available in AmiModel which shall be consumed by "Transformation Plugin" users.
Currently this attribute shall be supported only for 'Drive' devices and device items since only
they do have official "Transformation PlugIn" written for CAx.
See also
Connecting to the TIA Portal (Page 81)
Opening a project (Page 113)
Attributes list
The following table provides an overview to both kinds of attributes:
Changes
If you have considered the hints concerning programming across versions and you do not
upgrade your project to V16 your applications will run without any restrictions on any computer
even if only a TIA Portal V16 is installed.
If you upgrade your project to V16 it is necessary to recompile your application using the
SiemensEngineering.dll of V16. In some cases it might be necessary to adapt the code of your
application
I&M and Profisafe address attributes of pushbutton panel and key panel
As of TIA Portal Openness V16 I&M and Profisafe address attributes of pushbutton panel and key
panel will be accessible at module level.
Changes
If you have considered the hints concerning programming across versions and you do not
upgrade your project to V15.1 your applications will run without any restrictions on any
computer even if only a TIA Portal V15.1 is installed.
If you upgrade your project to V15.1 it is necessary to recompile your application using the
SiemensEngineering.dll of V15.1. In some cases it might be necessary to adapt the code of your
application
Type identifiers
The type identifier for racks and devices of "PC with ports" and "Ethernet devices with ports" have
been renamed.
Cross-thread operations
Access to Openness objects is not inherently thread-safe.
If you use multi-threading to improve the performance of your Openness application, it is
recommended to create your TIA Portal instance with an MTA.
If TIA Portal is created or attached within an STA thread, all Openness objects associated with
that Portal instance must be accessed from the same STA thread; otherwise, an exception will
be thrown.
Attribute TransmissionRateAndDuplex
Some faulty enum values for attribute TransmissionRateAndDuplex have been corrected, for
example the enum value "POFPCF100MbpsFullDuplexLD" has been removed and
"POFPCF100MbpsFullDuplex" has been added. For detail information, please see Configurable
attributes of a port-to-port connection (Page 143)
R/H systems
Download or access for R/H devices is available at device.
Online and Download Provider are not available for individual R/H PLC (DeviceItems).
For PLC2 of an R/H system, SoftwareContainer will not be available.
Changes
If you have considered the hints concerning programming across versions and you do not
upgrade your project to V15 your applications will run without any restrictions on any computer
even if only a TIA Portal V15 is installed.
If you upgrade your project to V15 it is necessary to recompile your application using the
SiemensEngineering.dll of V15.
In some cases it is necessary to adapt the code of your application
• Behaviour changes for compositions in DeviceItemComposition
• BitOffset of ASi addresses
• Exception class
• System folders of system UDTs
• Submodules do not have attributes Author and TypeName
• Timestamp for last modification
• Export XML for GRAPH blocks
• Importing tag tables
• Modifying not failsafe relevant attributes of a PLC
• Modifying F-parameters while safety password is set
• Accessing TO objects in a S7 1200 CPU
Exception class
ServiceID and MessageID have been removed from exception class
Introduction
The following changes were made in TIA Portal Openness API object modell V14 SP1, which may
impact your existing applications:
Behaviour changes
Note
The object model described on the diagram is obsolete, for information about the object model
of TIA Portal Openness V14 SP1 refer to TIA Portal Openness object model (Page 51)
'HYLFHVQ
'HYLFH*URXS
'HYLFHVQ 'HYLFH 'HYLFH,WHPVQ 'HYLFH,WHP
$EVWUDFW!!
*OREDO/LEUDU\ 3URMHFW/LEUDU\
The following diagramm describes the objects which are located under ProjectLibrary.
0DVWHU&RS\6\VWHP)ROGHU 0DVWHU&RS\8VHU)ROGHU
3URMHFW/LEUDU\
/LEUDU\7\SH)ROGHU 7\SHVQ /LEUDU\7\SH 9HUVLRQVQ /LEUDU\7\SH9HUVLRQ
7\SH)ROGHU $EVWUDFW!! )ROGHUVQ
/LEUDU\7\SH6\VWHP)ROGHU /LEUDU\7\SH8VHU)ROGHU
The following diagramm describes the objects which are located under HmiTarget.
6FUHHQ*OREDO(OHPHQWV 6FUHHQ*OREDO(OHPHQWV
+PL7DUJHW
6FUHHQ2YHUYLHZ 6FUHHQ2YHUYLHZ
6FUHHQ7HPSODWH)ROGHU )ROGHUVQ 6FUHHQ7HPSODWH8VHU)ROGHU
$EVWUDFW!! 6FUHHQ7HPSODWHVQ 6FUHHQ7HPSODWH
6FUHHQ7HPSODWH)ROGHU 6FUHHQ7HPSODWH6\VWHP)ROGHU
The following diagramm describes the objects which are located under PlcSoftware.
2%
3OF%ORFN*URXS %ORFNVQ 3OF%ORFN
$EVWUDFW!! *URXSVQ $EVWUDFW!!
,QVWDQFH'%
$UUD\'%
3OF6RIWZDUH
7DJVQ
3OF7DJ7DEOH*URXS *URXSVQ
$EVWUDFW!! 7DJ7DEOHVQ 3OF7DJ7DEOH
&RQVWDQWVQ
3OF&RQVWDQW
7HFKQRORJLFDO,QVWDQFH'
7HFKQRORJLFDO2EMHFW*URXS 7HFKQRORJLFDO,QVWDQFH'%*URXS 7HFKQRORJLFDO2EMHFWV 7HFKQRORJLFDO,QVWDQFH'%&RPSRVLWLRQ %ORFNVQ
'DWD%ORFN
Relationship between TIA Portal and TIA Portal Openness object model
The figure below shows the relationship between the object model and a project in the TIA
Portal:
Project DeviceItem
PlcSoftware
HmiTarget
Introduction
The following changes were made in API object modell V14 SP1 are only relevant for users,
which have used the pilot functionality of HW Config in V14.
TIA Portal Openness API type new TIA Portal Openness API type
Siemens.Engineering.HW.IAddress Siemens.Engineering.HW.Address
Siemens.Engineering.HW.IAddressController Siemens.Engineering.HW.Features.AddressController
Siemens.Engineering.HW.IChannel Siemens.Engineering.HW.Channel
Siemens.Engineering.HW.IDevice Siemens.Engineering.HW.Device
Siemens.Engineering.HW.IDeviceItem Siemens.Engineering.HW.DeviceItem
Siemens.Engineering.HW.IExtension Siemens.Engineering.HW.Extensions
Siemens.Engineering.HW.IGsd Siemens.Engineering.HW.Features.GsdObject
Siemens.Engineering.HW.IGsdDevice Siemens.Engineering.HW.Features.GsdDevice
Siemens.Engineering.HW.IGsdDeviceItem Siemens.Engineering.HW.Features.GsdDeviceItem
Siemens.Engineering.HW.IHardwareObject Siemens.Engineering.HW.HardwareObject
Siemens.Engineering.HW.IHwIdentifier Siemens.Engineering.HW.HwIdentifier
Siemens.Engineering.HW.IHwIdentifierController Siemens.Engineering.HW.Features.HwIdentifierController
Siemens.Engineering.HW.IIoConnector Siemens.Engineering.HW.IoConnector
Siemens.Engineering.HW.IIoController Siemens.Engineering.HW.IoController
Siemens.Engineering.HW.IIoSystem Siemens.Engineering.HW.IoSystem
Siemens.Engineering.HW.IInterface Siemens.Engineering.HW.Features.NetworkInterface
Siemens.Engineering.HW.Extensions.ModuleInformationPro‐ Siemens.Engineering.HW.Utilities.ModuleInformationProvid‐
vider er
Siemens.Engineering.HW.INode Siemens.Engineering.HW.Node
Siemens.Engineering.HW.OPCUAExportProvider Siemens.Engineering.HW.Utilities.OpcUaExportProvider
Siemens.Engineering.HW.IPort Siemens.Engineering.HW.Features.NetworkPort
Siemens.Engineering.HW.IRole Siemens.Engineering.HW.Features.HardwareFeature
Siemens.Engineering.HW.Features.DeviceFeature
Siemens.Engineering.HW.Utilities.ModuleInformationProvid‐
er
Siemens.Engineering.HW.SoftwareBase Siemens.Engineering.HW.Software
Siemens.Engineering.HW.ISubnet Siemens.Engineering.HW.Subnet
Siemens.Engineering.HW.ISoftwareContainer Siemens.Engineering.HW.Features.SoftwareContainer
Siemens.Engineering.HW.ISubnetOwner Siemens.Engineering.HW.Features.SubnetOwner
TIA Portal Openness API type Data new TIA Portal Openness API type Data
type type
Siemens.Engineering.HW.Enums.AddressContext Siemens.Engineering.HW.AddressContext
Siemens.Engineering.HW.Enums.AddressIoType Siemens.Engineering.HW.AddressIoType
Siemens.Engineering.HW.Enums.AttachmentType Siemens.Engineering.HW.MediumAttachmentType
Siemens.Engineering.HW.Enums.BaudRate Siemens.Engineering.HW.BaudRate
Siemens.Engineering.HW.Enums.BusLoad Siemens.Engineering.HW.CommunicationLoad
Siemens.Engineering.HW.Enums.BusProfile Siemens.Engineering.HW.BusProfile
Siemens.Engineering.HW.Enums.CableLength Siemens.Engineering.HW.CableLength
Siemens.Engineering.HW.Enums.CableName ulong Siemens.Engineering.HW.CableName long
Siemens.Engineering.HW.Enums.ChannelIoType byte Siemens.Engineering.HW.ChannelIoType int
Siemens.Engineering.HW.Enums.ChannelType byte Siemens.Engineering.HW.ChannelType int
Siemens.Engineering.HW.Enums.DeviceItemClassi‐ Siemens.Engineering.HW.DeviceItemClassifica‐
fications tions
Siemens.Engineering.HW.Enums.InterfaceOpera‐ Siemens.Engineering.HW.InterfaceOperatingMo‐
tingModes des
Siemens.Engineering.HW.Enums.IpProtocolSelec‐ Siemens.Engineering.HW.IpProtocolSelection
tion
Siemens.Engineering.HW.Enums.MediaRedundan‐ Siemens.Engineering.HW.MediaRedundancyRole
cyRole
Siemens.Engineering.HW.Enums.NetType Siemens.Engineering.HW.NetType
Siemens.Engineering.HW.Enums.ProfinetUpdateTi‐ removed
meMode
Siemens.Engineering.HW.Enums.RtClass byte Siemens.Engineering.HW.RtClass int
Siemens.Engineering.HW.Enums.SignalDelaySelec‐ byte Siemens.Engineering.HW.SignalDelaySelection int
tion
Siemens.Engineering.HW.Enums.SyncRole byte Siemens.Engineering.HW.SyncRole int
Siemens.Engineering.HW.Enums.TransmissionRa‐ uint Siemens.Engineering.HW.TransmissionRateAndDu‐ int
teAndDuplex plex
Introduction
The export and import via TIA Portal Openness API was extended in V14 SP1 in order to handle
comments at array elements. This required a new schema. Block interface import and export will
handle from now on two schema versions:
• For import: The decision about used schema version is made based on namespace: <Sections
xmlns=http://www.siemens.com/automation/Openness/SW/Interface/v2>
• For export: The decision about used schema version is made based on the project version.
Projects V14 SP1 lead to version 2, projects V14 lead to version v1
Generate source
The following methods have been removed from ProgramBlocks:
• GenerateSourceFromBlocks
• GenerateSourceFromTypes
The following methodes have been added:
• GenerateSource to PlcExternalSourceSystemGroup
Example
Examples:
Storage of comments and start values in simple arrays:
Type attribute of Constant has been replaced with new ConstantType subnode.
The value of the Scope attribute in Access has been renamed to TypedConstant if the
ConstantValue contains type qualified value(e.g.: int#10).
Constant does not have Type attribute if ConstantValue contains type qualified value (e.g.:
int#10).
Local variables do not have Address node if Scope is LocalVariable.
If an Access is nested within another Access at any level, only the outer Access must have an UId.
• Address
• Statusword
• Expression
• Call
• CallWithType
Absolute Access
In V14 the import of absolute access has been aborted for most combinations. As of V14 SP1 the
import of absolute access works for the following areas:
• Input
• Outpt
• Memory
• Timer, if supported on the PLC
• Counter, if supported on the PLC
• DB
• DI
If a symbol access and an absolute access is used at the same time and is not rejected by schema
or node kind validation the import will only succeed when box access informations are
successfully resolved. When the symbol access leads to different information in comparison to
the absolute access the import is rejected.
Indirect DB Access
As of V14 SP1 indirect DB Access can only be imported, when the 'offset', 'type' and 'symbol' are
provided.
will result in
CALL "Block_2"
Input_1 :="Tag_1"
Input_2 :="Tag_2"
Output_1 :="Tag_3"
Output_2 :="Tag_4"
In the following example the import will be aborted, because two parameters have the same
name ""Input1".
Before V14 SP1 the import tried to map the parameters between the user block call and the
instruction block call. Sometimes the import aborted, sometimes the import deleted all not
matching parameters.
As of V14 SP1 the user block call will still find the library block, but the call will not become valid.
Disabled ENO
The "disabled ENO" feature is used on 1200 and 1500 PLC to deactivate runtime consuming ENO
connection state calculation.
As of V14 SP1 the DisabledENO flag can only be imported on PLC's supporting the feature.
Alarm Constants
With V14 SP1 the compile checks for valid alarm constants have been extended. It might occur
that projects are not compilable in V14 SP1 due to an xml imported in V14 with broken alarm
constants. In this case open the relevant network in LAD/FDB editor and delete the alarm actual
operand. The editor will automatically recreate a valid alarm constant.
EnEno visible
In V14 the EN and ENO connections of 'InstructionRef' have been usable or not depending on the
ENENO flag.
As of V14SP1 the OPNS during the import based on the element and the wiring either the EN and
ENO connections are used. Because of this automatic detection a different EN and ENO
connection usage can be noticed. Most probably only the IEC timer and IEC counter boxes may
show some issues.
UId assignment
The assignment of UIds to parts, access and wires changes with V14 SP1. The UIds for
statements, CallInfo and operands have to be unique within a compile unit. From TIA Portal point
of view the UIds in the XML are keys, without any additional meaning besides identifying an
element.
More strict checks concerning surrogate characters and control characters ( tab and new line
allowed) are performed during the import of
• Comments of blocks and networks
• String attributes
• Nodes defining multilanguage texts, e.g. Alarmtext, Comments
• Token texts
Importing statuswords
As of V14 SP1 the statusword can only be imported at statements where they are supported.
• L - Supported statusword: STW
• T - Supported statusword: STW
• A - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
• AN - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
• O - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
• ON - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
• X - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
• XN - Supported statusword: BR, OV, OS, EQ, NE, GT, Lt, GE, LE, U0, NU
Note
Most statuswords are only useful on 300 and 400 plcs.
Empty statements
The import is aborted if a statement does not have a node <StlStatement/>. In case of an empty
statement, add the <StlToken Text="Empty_Line" /> node.
The import is aborted if an empty statement has comments. For a statement with only
comments use the <StlToken Text="COMMENT" />.
ILibraryTypeInstance.ConnectedVersion, ILibraryTypeInstance.Dependencies,
ILibraryTypeInstance.Dependents are eliminated from the table of general attributes because
they are neither exported in XML nor accessible via API.
MemoryLayout gets new default: Standard in classic PLCs and Optimized on plus PLCs
Number is applied for user defined data types and it is represented in XML and accessible via API
as well
Changes in enums
The enum values for ProgrammingLanguage are changed as follows:
• a new enum value F_CALL is introduced
• a new enum value Motion_DB is introduced for Motion technological object
• GRAPH_SEQUENCE, GRAPH_ACTIONS, GRAPH_ADDINFOS are deleted from the enum. They
are replaced with GRAPH.
The enum values for BlockType are changed as follows:
• the values OB, FC, DB, SFC are deleted because this enum is only used at InstanceOfType
attribute
Note
The object model described on the diagram is obsolete, for information about the object model
of TIA Portal Openness V14 SP1 refer to TIA Portal Openness object model (Page 51)
Application
Before updating an application to TIA Portal Openness V14 change the following settings:
1. Adapt thr references to the V14 API by adding the following TIA Portal Openness APIs:
– Siemens.Engineering
– Siemens.Engfineering.Hmi
2. Change the .Net framework of your Visual Studio to version 4.6.1
3. Update the assembly resolve method by adapting the new installation path of the TIA Portal.
– If you have evaluated from the registry, adapt the new key, according to the following
example:
"HKEY_LOCAL_MACHINE\SOFTWARE\Siemens\Automation\_InstalledSW
\TIAP14\TIA_Opns\..."
– If you are using the application configuration file, adapt the paths to the new installation
path.
Introduction
The following changes were made in TIA Portal Openness V14, which may impact your existing
applications:
See also
Handling exceptions (Page 862)
Connecting to the TIA Portal (Page 81)
7.5.4 Import of files generated with TIA Portal Openness V13 SP1 and previous
Application
When you try to import files which were generated with TIA Portal Openness V13 SP1 or previous
an exeption will be thrown because of incompatibility. This is caused by changes on HMI tags
and HMI screen items. The following tables are showing the main attribute changes, for more
detailed information refer to the chapter "Creating screens Working with objects and object
groups > Working with objects > Configuring ranges" of the TIA Portal online help:
Projects, 113, 119, 127, 132, 137, 141, 142, 205, Exportable screen objects, 916
273, 276, 289, 643, 644, 646, 647, 650 Exporting a screen from a screen folder, 921
Public API application example, 76 Exporting a screen with a faceplate instance, 936
Querying information from a PLC tag table, 647 Exporting a selected tag, 904
Querying PLC and HMI targets, 205 Exporting a tag from a tag table, 904
Querying system folders for PLC tags, 643 Exporting all graphics of a project, 888
Querying the "Program blocks" folder, 566 Exporting all screen templates, 927
Querying the block author, 571 Exporting blocks with know-how protection, 956
Querying the block family, 571 Exporting blocks without know-how
Querying the block name, 571 protection, 998
Querying the block number, 571 Exporting configuration data, 884
Querying the block title, 571 Exporting connections, 914
Querying the block type, 571 Exporting cycles, 898
Querying the block version, 571 Exporting graphic lists, 913
Querying the consistency attribute of a block, 571 Exporting HMI tag tables, 900
Querying the time stamp of a block, 571 Exporting multilingual comments, 1184, 1193,
Reading the time of the last changes to a PLC tag 1201, 1203
table, 649 Exporting only modified values, 884
Saving a project, 141 Exporting permanent areas, 925
Exporting PLC tag table, 1067
Exporting pop-up screens, 931
G Exporting screen templates, 928
Exporting screens of an HMI device, 920
General TIA portal settings, 119
Exporting slide-in screen, 934
Generate
Exporting system blocks, 994
source from block, 586
Exporting tags, 1219
source from user data type, 586
Exporting text lists, 910
Global library
Exporting VB scripts, 907, 908
Accessing, 147, 151
Field of application, 881
Accessing language settings, 149
Graphics, 887
HMI, 898, 899, 900, 903, 904, 905, 906, 907, 908,
909, 910, 911, 913, 915, 916, 920, 921, 923, 925,
H 926, 927, 928, 930, 931, 932, 934, 935, 936, 938,
Hardware 1067
Compiling, 137 Importable objects, 879
Hierarchy of hardware objects of the object Importing a graphic list, 913
model, 65 Importing a screen including a faceplate
HMI tags of the "UDT" data type, 906 instance, 938
Importing an HMI tag into a tag table, 905
Importing configuration data, 885
I Importing connections, 915
Importing cycles, 899
Import/Export
Importing graphics to a project, 889
Advanced XML formats for export/import of text
Importing multilingual comments, 1184, 1193,
lists, 911
1201, 1203
Also export default values, 884
Importing permanent areas, 926
Basics, 879
Importing pop-up screen, 932
Data structure, 895, 1077
Importing screen templates, 930
Editing an XML file, 883
Importing screens to an HMI device, 923
Export format, 881
Importing slide-in screen, 935
Export scope, 884
Importing tag table to a tag folder, 903
Export settings, 884
Importing tags, 1219
Exportable objects, 879
T
Technology object, 599, 1046
X
Compiling, 604 XML file
Creating, 603 Edit, 883
Data types, 601 Export, 884
Deleting, 604
Enumerating, 606
Finding, 606
Querying, 602