s71500 Communication Function Manual en-US en-US
s71500 Communication Function Manual en-US en-US
Security information
2
PG communication
6
HMI communication
7
S7 communication
9
Point-to-point link
10
OPC UA communication
11
Routing
13
Connection resources
14
Function Manual
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 Aktiengesellschaft. 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 Introduction........................................................................................................................................ 10
1.1 Function Manuals documentation guide........................................................................... 17
1.1.1 Information classes Function Manuals............................................................................... 17
1.1.2 Basic tools........................................................................................................................ 19
1.1.3 S7 Port Configuration Tool (S7-PCT).................................................................................. 21
1.1.4 S7 Failsafe Configuration Tool (S7-FCT)............................................................................. 21
1.1.5 MultiFieldbus Configuration Tool (MFCT).......................................................................... 21
1.1.6 SIMATIC Technical Documentation.................................................................................... 23
2 Security information........................................................................................................................... 25
2.1 General security information............................................................................................. 25
3 Industrial cybersecurity...................................................................................................................... 26
3.1 Cybersecurity information................................................................................................. 26
3.2 Security-relevant information in this manual..................................................................... 27
4 Product overview................................................................................................................................ 28
5 Communications services................................................................................................................... 33
5.1 Overview of communication options................................................................................. 33
5.2 Communications protocols and port numbers used for Ethernet communication............... 36
5.3 Overview of connection resources..................................................................................... 44
5.4 Setting up a connection.................................................................................................... 45
5.5 Data consistency............................................................................................................... 49
5.6 Secure Communication..................................................................................................... 52
5.6.1 Basics of Secure Communication....................................................................................... 52
5.6.1.1 Useful information on Secure Communication................................................................... 52
5.6.1.2 Device-dependent security features................................................................................... 55
5.6.1.3 Confidentiality through encryption.................................................................................... 57
5.6.1.4 Authenticity and integrity through signatures.................................................................... 60
5.6.2 Managing certificates........................................................................................................ 64
5.6.2.1 What you should know about the certificate management................................................. 64
5.6.2.2 Certificate management with TIA Portal............................................................................ 65
5.6.2.3 Examples for the management of certificates.................................................................... 68
5.6.2.4 How communication with certificates works: HTTP over TLS.............................................. 73
5.6.2.5 Tip: Updating loaded certificates in RUN............................................................................ 76
5.6.3 Requirements for secure communication.......................................................................... 77
5.6.3.1 Protection of confidential configuration data..................................................................... 77
5.6.3.2 Useful information for the protection of confidential PLC configuration data...................... 80
5.6.3.3 Changing your password................................................................................................... 81
5.6.3.4 Resetting the password..................................................................................................... 83
5.6.3.5 Assign password via SIMATIC Memory Card....................................................................... 85
Communication
4 Function Manual, 11/2024, A5E03735815-AM
Table of contents
6 PG communication.............................................................................................................................. 127
9 S7 communication.............................................................................................................................. 155
Communication
Function Manual, 11/2024, A5E03735815-AM 5
Table of contents
Communication
6 Function Manual, 11/2024, A5E03735815-AM
Table of contents
Communication
Function Manual, 11/2024, A5E03735815-AM 7
Table of contents
13 Routing............................................................................................................................................... 400
13.1 Overview of the routing mechanisms of S7-1500 CPUs...................................................... 400
13.2 S7 routing........................................................................................................................ 401
13.3 IP forwarding.................................................................................................................... 405
13.4 Data record routing........................................................................................................... 412
13.5 Virtual interface for IP-based applications.......................................................................... 414
Communication
8 Function Manual, 11/2024, A5E03735815-AM
Table of contents
16.8.1 Setting up the connection of the Open User Communication with the redundant .... 451
S7-1500R/H system
16.8.2 Open User Communication with CP 1543-1 communications processors............................ 456
16.9 Using an OPC UA server in an S7-1500R/H system.............................................................. 457
16.9.1 Information worth knowing on the OPC UA server in the S7-1500R/H system..................... 457
16.9.2 Transparent Mode (transparent Redundancy).................................................................... 460
16.9.3 Non-transparent Mode (non-transparent Redundancy)...................................................... 462
16.9.4 Information model in detail............................................................................................... 466
16.9.5 Updated instructions for server methods........................................................................... 469
Glossary.............................................................................................................................................. 477
Index................................................................................................................................................... 489
Communication
Function Manual, 11/2024, A5E03735815-AM 9
Introduction 1
Purpose of the documentation
This Function Manual provides you with an overview of the communication options, the
CPUs, communications modules and processors and PC systems of the systems SIMATIC
S7‑1500, ET 200MP, ET 200SP, ET 200AL, ET 200pro and SIMATIC Drive Controller. This
Function Manual describes connection-oriented, asynchronous communication.
The documentation covers the following:
• Overview of communications services
• Properties of communications services
• Overview of user activities for setting up communications services
Communication
10 Function Manual, 11/2024, A5E03735815-AM
Introduction
What's new in the Communication Function Manual, Edition 11/2024 as compared to Edition
11/2023
What's new? What are the customer benefits? Where can I find the information?
Table for communication proto Information on protocols and ports used by inter Section Communications protocols
cols and port numbers used in Eth face modules. You can see at first glance which and port numbers used for Ethernet
ernet communication interface default settings apply. This allows you to specific communication (Page 36)
modules ally adjust only those settings that are relevant to
your application.
OPC UA: Increased configuration The S7‑1500 CPUs 151x(F)‑3 PN and Equipment Manual of the respective
limits for the following 151xT(F)‑3 PN from FW version V4.0 allow the cre CPU
S7‑1500 CPUs as of FW version ation of a larger number of nodes for server inter
V4.0 faces and a larger number of server methods.
• CPU 151x(F)‑3 PN In addition, the performance for read, write and
• CPU 151xT(F)‑3 PN subscriptions has been improved.
OPC UA: Simultaneous receipt of For S7-1500 CPUs, OPC UA clients as of firmware Section Simultaneous receipt of
messages in multiple languages V4.0 can, for example, select one of the available alarms in multiple languages (Page
languages for messages. 326)
In addition, an OPC UA client can request the mes
sage texts in all three active project languages sim
ultaneously. For example, the messages are collec
ted on a central server so that the messages can be
evaluated by people in different languages.
OPC UA: Role-based security for With the implementation of the role-based Section Role-based security in OPC
S7-1500 CPUs as of FW version concept for the S7‑1500 CPUs as of FW version UA (Page 217)
V4.0 V4.0, the OPC UA server can manage in detail the
access of specific OPC UA clients to the address
space.
OPC UA: Support of the "Transfer The "Transfer Subscription" function is available for Section Using the
Subscription" function for S7-1500 S7‑1500 CPUs as of version V3.1.4 to support TransferSubscription service (Page
applications for load distribution on different OPC 254)
UA clients. With this, a
subscription can be transferred to another OPC UA
client. It is not necessary to configure the function.
What's new in the Communication Function Manual, Edition 11/2023 as compared to Edition
11/2022?
What's new? What are the customer benefits? Where can I find the information?
"Industrial cybersecurity" section Due to the digitalization and increasing network Industrial cybersecurity (Page 26)
ing of machines and industrial plants, the risk of
cyber attacks is also growing. Appropriate protect
ive measures are therefore mandatory, particularly
in the case of critical infrastructure facilities.
The section contains the following information:
• Basic information on the subject of industrial
cybersecurity
• Measures to protect individual components
and the entire system against manipulation
and unwanted access.
Communication
Function Manual, 11/2024, A5E03735815-AM 11
Introduction
What's new? What are the customer benefits? Where can I find the information?
Revision of the tables for commu Updated information on protocols and ports used. Communications protocols and port
nication protocols and port num You can see at first glance which default settings numbers used for Ethernet commu
bers used in Ethernet communica apply. This allows you to specifically adjust only nication (Page 36)
tion those settings that are relevant to your application.
Updated information about the Updated information on the following connection Connection resources (Page 418)
connection resources of the CPU resources:
and HMI. • Maximum number of connection resources
supported for some CPU types
• Maximum occupied connection resources for
different HMI devices
Expanding the redundant system As of STEP 7 V19, you can expand an S7‑1500R/H System IP addresses for communica
with communications processors redundant system as of FW version V3.1 with the tions processors (Page 440).
CP 1543-1 communications processors.
Secure Open User Communication As of STEP 7 V19, an S7‑1500R/H redundant sys Open User Communication with the
with the redundant system tem FW version V3.1 and higher also supports redundant system S7-1500R/H (Page
Secure Open User Communication. 450)
What's new in the Communication Function Manual, Edition 11/2022 as compared to Edition
05/2021?
What's new? What are the customer benefits? Where can I find the information?
Revision of the tables for commu Updated information on protocols and ports used. Communications protocols and port
nication protocols and port num You can see at first glance which default settings numbers used for Ethernet commu
bers used in Ethernet communica apply. This allows you to specifically adjust only nication (Page 36)
tion those settings that are relevant to your application.
Activate / Deactivate the SNMP Depending on the FW version of the S7-1500 SNMP (Page 119)
CPUs, the SNMP is activated or deactivated in the
default settings. You can change the default set
tings as required.
Revision of the virtual interface for With a CP 1543-1 with firmware version V3.0 or Virtual interface for IP-based applica
IP-based applications higher, the internal CP firewall is available. This is tions (Page 414)
used to secure data traffic via the virtual interface.
OPC UA server: Reading the dia By using the OPC UA instruction for reading Running diagnostics for OPC UA serv
gnostics status of the own address ("OPC_UA_ReadList"), the own namespace of the ers in the program (Page 337)
space OPC UA Server can be accessed. This makes it pos
sible to read out the status of the own OPC UA
server as well as the connections of OPC UA cli
ents, the session as well as the subscriptions and
to react to them in the user program. This allows
connection problems to be quickly detected, for
example, and plant availability to be increased.
OPC UA server: Time stamping of By using the OPC UA instruction for writing Client accesses and local accesses to
the source time of nodes ("OPC_UA_WriteList"), it is possible to change the the OPC UA server (Page 230)
"SourceTimestamp" as well as the status code of an
OPC UA variable (node). This makes it possible to
distinguish between the "Source" and "Server" time
as of V18.
Communication
12 Function Manual, 11/2024, A5E03735815-AM
Introduction
What's new? What are the customer benefits? Where can I find the information?
OPC UA GDS mechanism: Now The Web server certificate for HTTPS communica What you should know about the cer
also usable for Web server certific tion can now also be managed via the OPC UA GDS tificate management (Page 64)
ates mechanism, without separate download of the Automated certificate management
hardware configuration. with GDS (Page 199)
What's new in the Communication Function Manual, Edition 05/2021 as compared to Edition
11/2019?
What's new? What are the customer benefits? Where can I find the information?
Improved security for SIMATIC • Allows unique identification of each PLC based Secure PG/HMI communication (Page
PG/HMI communication on individual certificates 107)
• Provides additional confidentiality protection
through encrypted communication
• Protection of the configuration data through
individual passwords
Security wizard for new PLC secur • Quick and easy configuration of the new secur Protection of confidential configura
ity mechanisms ity mechanisms of the PLC in one operation tion data (Page 77)
• Supporting information to select suitable set
tings for own application
Certificate management via OPC • Certificate update during runtime Certificate management via Global
UA • Support of CRLs Discovery Server (GDS) (Page 199)
Global Discovery Server (GDS) • Access protection for certificate management
Transferring CPU alarms to OPC UA • Subscriptions allow clients to subscribe to CPU Providing alarms on the OPC UA serv
clients alarms as "Alarms and Conditions" from the er (Page 312)
OPC UA server of the CPU.
• Program messages including associated values
are made available by the OPC UA server
• Alarms requiring acknowledgement can be
acknowledged by the OPC UA client (can be
disabled)
• An alarm burst is displayed as "overload" and
clients can be reloaded with the refresh meth
od
Dynamic assignment of the net Deployment of the CPU in IT managed networks Addressing via DHCP (Page 387)
work configuration with DHCP using the following functions:
• Connection of the CPU to an existing network
without additional manual configuration of the
network interface
• Request for network parameters for the CPU
according to RFC 2131 from a DHCPv4 server
(IP address and subnet mask, default IP router
address and further optional network paramet
ers such as DNS and NTP server addresses)
Communication
Function Manual, 11/2024, A5E03735815-AM 13
Introduction
What's new? What are the customer benefits? Where can I find the information?
Name-based addressing with DNS • DNS server addresses can be obtained from the DHCP with DNS (Page 391)
CPU via DHCP
• The CPU can obtain host and domain names
from a DHCP server for applications that are
implemented with OPC UA or (Secure) OUC.
• The CPU may transfer configured host or
domain names to DHCP servers coupled with
DNS servers for dynamic matching (Dynamic
DNS).
• The NTP client of the CPU can address NTP serv
ers with names
• Network parameters can be written with the
new "CommConfig" instruction, for example, IP
address parameters, DNS server, host and
domain name
What's new in the Communication Function Manual, Edition 11/2019 as compared to Edition
10/2018?
What's new? What are the customer benefits? Where can I find the information?
IP forwarding Simple access from the control level to the field IP forwarding (Page 405)
level for configuration and parameter assignment
of devices, e.g. via PDM or Web browser.
OPC UA server expansion For S7-1500 CPUs as of firmware V2.8 and TIA Section OPC UA communication
Portal version 16, with a corresponding Runtime (Page 168)
license, you can benefit from the following expan
sions of the integrated OPC UA server:
• Improved diagnostics: The OPC UA user
receives information on the status of the OPC
UA server via alarms in the diagnostics buffer,
an OPC UA category in the Online & Dia
gnostics area of TIA Portal as well as an
improved connection resources display.
• Download behavior: In RUN mode, the OPC UA
server only performs a restart during download
from the TIA Portal when the newly down
loaded data has an effect on the data manage
ment of the OPC UA server.
• Server interface modeling: It is now possible in
the TIA Portal to model server interfaces or
import OPC UA Companion Specifications and
map them to the PLC data management.
Communication
14 Function Manual, 11/2024, A5E03735815-AM
Introduction
What's new in the Communication Function Manual, Edition 10/2018 as compared to Edition
12/2017?
What's new? What are the customer benefits? Where can I find the information?
Description of communication You receive information on the particularities of Section Communication with the
with the S7‑1500R/H redundant communication with the S7-1500R/H redundant redundant system S7-1500R/H (Page
system system 433)
Scope of the Function Manual Functions with which you are familiar from the S7-1500R/H redundant system Sys
expanded to include the SIMATIC S7‑1500 automation system are imple tem Manual
S7‑1500R/H redundant system mented for the S7‑1500R/H redundant system. (https://support.industry.siemens.
com/cs/ww/en/view/109754833)
What's new in the Communication Function Manual, Edition 12/2017 compared to Edition
09/2016
What's new? What are the customer benefits? Where can I find the information?
OPC UA Companion Specification Through OPC UA Companion Specification, meth Section OPC UA server interface con
ods can be specified in a uniform and manufac figuration (Page 269)
turer-neutral way. Using these specified methods,
you can easily integrate devices from various man
ufacturers into the plant and the production pro
cesses.
Setting up a secure connection to You can set up a secure connection to a mail serv Section Secure OUC via e-mail (Page
a mail server over the CPU inter er without additional hardware. 104)
face
Secure communication over Mod You can establish secure TCP connections between Section Secure OUC with Modbus
bus TCP a Modbus TCP client and a Modbus TCP server. TCP (Page 102)
What's new in the Communication Function Manual, Edition 09/2016 compared to Edition
12/2014
What's new? What are the customer benefits? Where can I find the information?
OPC UA server OPC UA is a uniform standard for data communica Section OPC UA communication
tion and is independent of any particular operating (Page 168)
system platforms.
OPC UA uses integrated safety mechanisms on
various automation systems, for example with
data exchange, at application level, for the legitim
ation of the user.
The OPC UA server provides a large amount of
data:
• Values of PLC tags that clients can access
• Data types of these PLC tags
• Information about the OPC UA server itself and
the CPU
In this way, clients can gain an overview of the tag
management and can read and write values.
Communication
Function Manual, 11/2024, A5E03735815-AM 15
Introduction
What's new? What are the customer benefits? Where can I find the information?
Secure Open User Communication Secure data exchange with other devices. Section Secure Open User Communic
ation (Page 90)
Certificate handling in STEP 7 You can manage certificates for the following Section Certificate management with
applications in STEP 7: TIA Portal (Page 65)
• OPC UA server
• Secure Open User Communication
• Web server of the CPU
Deactivating SNMP for the CPU You can deactivate SNMP for the CPU. This can Section SNMP (Page 119)
make sense under certain conditions, for example
if the security guidelines in your network do not
permit SNMP.
Conventions
STEP 7: We refer to "STEP 7" in this documentation as a synonym for the configuration and
programming software "STEP 7 as of V12 (TIA Portal)".
Due to continuous controller functions, the term "S7-1500 CPUs" also usually refer to the CPU
variants S7‑1500F, S7‑1500T, S7‑1500TF, S7‑1500C, S7‑1500R/H, S7‑1500pro, ET200SP,
S7‑1500 Software Controller, as well as SIMATIC Drive Controller. Variations arise due to
different designs and applications between Advanced Controllers, Distributed Controllers, and
Software Controllers.
This documentation contains pictures of the devices described. The figures may differ slightly
from the device supplied.
You should also pay particular attention to notes such as the one shown below:
NOTE
A note contains important information on the product, on handling of the product and on the
section of the documentation to which you should pay particular attention.
Industry Mall
The Industry Mall is the catalog and order system of Siemens AG for automation and drive
solutions on the basis of Totally Integrated Automation (TIA) and Totally Integrated Power
(TIP).
You can find catalogs for all automation and drive products on the Internet
(https://mall.industry.siemens.com).
Communication
16 Function Manual, 11/2024, A5E03735815-AM
Introduction
1.1 Function Manuals documentation guide
Basic information
The system manuals and Getting Started describe in detail the configuration, installation,
wiring and commissioning of the SIMATIC S7‑1500, SIMATIC Drive Controller, ET 200MP,
ET 200SP, ET 200AL and ET 200eco PN systems. Use the corresponding operating instructions
for 1513/1516pro-2 PN CPUs.
The STEP 7 online help supports you in the configuration and programming.
Examples:
• Getting Started S7-1500
• System manuals
• Operating instructions ET 200pro and 1516pro-2 PN CPU
• Online help TIA Portal
Device information
Equipment manuals contain a compact description of the module-specific information, such
as properties, wiring diagrams, characteristics and technical specifications.
Examples:
• Equipment manuals for CPUs
• Equipment manuals for interface modules
• Equipment manuals for digital modules
• Equipment manuals for analog modules
• Equipment manuals for communication modules
• Equipment manuals for technology modules
• Equipment manuals for power supply modules
• Equipment manuals for BaseUnits
Communication
Function Manual, 11/2024, A5E03735815-AM 17
Introduction
1.1 Function Manuals documentation guide
General information
The function manuals contain detailed descriptions on general topics relating to the
SIMATIC Drive Controller and the S7-1500 automation system.
Examples:
• Function Manual Diagnostics
• Function Manual Communication
• Function Manuals Motion Control
• Function Manual Web Server
• Function Manual Cycle and Response Times
• PROFINET Function Manual
• PROFIBUS Function Manual
Product Information
Changes and supplements to the manuals are documented in a Product Information. The
Product Information takes precedence over the device and system manuals.
You will find the latest Product Information on the Internet:
• S7-1500/ET 200MP (https://support.industry.siemens.com/cs/de/en/view/68052815)
• SIMATIC Drive Controller
(https://support.industry.siemens.com/cs/de/en/view/109772684/en)
• Motion Control (https://support.industry.siemens.com/cs/de/en/view/109794046/en)
• ET 200SP (https://support.industry.siemens.com/cs/de/en/view/73021864)
• ET 200eco PN (https://support.industry.siemens.com/cs/ww/en/view/109765611)
Manual Collections
The Manual Collections contain the complete documentation of the systems put together in
one file.
You will find the Manual Collections on the Internet:
• S7-1500/ET 200MP/SIMATIC Drive Controller
(https://support.industry.siemens.com/cs/ww/en/view/86140384)
• ET 200SP (https://support.industry.siemens.com/cs/ww/en/view/84133942)
• ET 200AL (https://support.industry.siemens.com/cs/ww/en/view/95242965)
• ET 200eco PN (https://support.industry.siemens.com/cs/ww/en/view/109781058)
Communication
18 Function Manual, 11/2024, A5E03735815-AM
Introduction
1.1 Function Manuals documentation guide
Tools
The tools described below support you in all steps: from planning, over commissioning, all
the way to analysis of your system.
Communication
Function Manual, 11/2024, A5E03735815-AM 19
Introduction
1.1 Function Manuals documentation guide
PRONETA
SIEMENS PRONETA (PROFINET network analysis) is a commissioning and diagnostic tool for
PROFINET networks. PRONETA Basic has two core functions:
• In the network analysis, you get an overview of the PROFINET topology. Compare a real
configuration with a reference installation or make simple parameter changes, e.g. to the
names and IP addresses of the devices.
• The "IO test" is a simple and rapid test of the wiring and the module configuration of a
plant, including documentation of the test results.
You can find SIEMENS PRONETA Basic on the Internet:
(https://support.industry.siemens.com/cs/ww/en/view/67460624)
SIEMENS PRONETA Professional is a licensed product that offers you additional functions. It
offers you simple asset management in PROFINET networks and supports operators of
automation systems in automatic data collection/acquisition of the components used through
various functions:
• The user interface (API) offers an access point to the automation cell to automate the scan
functions using MQTT or a command line.
• With PROFIenergy diagnostics, you can quickly detect the current pause mode or the
readiness for operation of devices that support PROFIenergy and change these as needed.
• The data record wizard supports PROFINET developers in reading and writing acyclic
PROFINET data records quickly and easily without PLC and engineering.
You can find SIEMENS PRONETA Professional on the Internet.
(https://www.siemens.com/proneta-professional)
SINETPLAN
SINETPLAN, the Siemens Network Planner, supports you in planning automation systems and
networks based on PROFINET. The tool facilitates professional and predictive dimensioning of
your PROFINET installation as early as in the planning stage. In addition, SINETPLAN supports
you during network optimization and helps you to exploit network resources optimally and to
plan reserves. This helps to prevent problems in commissioning or failures during productive
operation even in advance of a planned operation. This increases the availability of the
production plant and helps improve operational safety.
The advantages at a glance
• Network optimization thanks to port-specific calculation of the network load
• Increased production availability thanks to online scan and verification of existing systems
• Transparency before commissioning through importing and simulation of existing STEP 7
projects
• Efficiency through securing existing investments in the long term and the optimal use of
resources
You can find SINETPLAN on the Internet
(https://new.siemens.com/global/en/products/automation/industrial-
communication/profinet/sinetplan.html).
Communication
20 Function Manual, 11/2024, A5E03735815-AM
Introduction
1.1 Function Manuals documentation guide
SIMATIC S7-PCT
The Port Configuration Tool (PCT) is a PC-based software for the parameter assignment of
Siemens IO-Link Master modules and IO-Link devices from any manufacturer.
You integrate IO-Link-devices using the standardized device description "IODD", which you
get from the respective device manufacturer. S7-PCT supports version 1.0 and V1.1 of the
IODD.
S7-PCT is called via the hardware configuration of the IO-Link Master from STEP 7. When STEP
7 is not used or the IO-Link Master is not operated on a SIMATIC controller, "standalone"-
operation is also possible.
You can find additional information on IO-Link on the Internet
(https://new.siemens.com/global/en/products/automation/industrial-communication/io-
link.html).
SIMATIC S7-FCT
Failsafe Configuration Tool (FCT) enables you to GSD configure the following devices in third-
party engineering systems:
• Selected, functionally fail-safe SIMATIC I/O devices
• Functionally fail-safe SIRIUS ACT PROFINET interfaces
The engineering system must meet the following requirements for this:
• Support of the CPD system integration acc. to "PROFIsafe - Profile for Safety Technology on
PROFIBUS DP and PROFINET IO"
• TCI implementation to Conformance Class C3
Additional information on S7-FCT can be found on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/109762827).
Communication
Function Manual, 11/2024, A5E03735815-AM 21
Introduction
1.1 Function Manuals documentation guide
• TM FAST:
Generation and download of FPGA-UPD- and FPGA-DB-files.
• Maintenance:
Topology scan of a Ethernet network, reading of service data, parameter assignment and
firmware update.
• Settings:
Language switching German / English, network scanner speed, setting of the network
adapter, installation of GSDML-and EDS-files.
System/installation requirements for MFCT
The MFCT runs under Microsoft Windows and does not require installation or administrator
rights.
For MFCT you must also install the following software:
• Microsoft .NET Framework 4.8 (You can find an Offline Installer on the Internet.
(https://support.microsoft.com/en-us/topic/microsoft-net-framework-4-8-offline-installer-
for-windows-9d23f658-3b97-68ab-d013-aa3c3e7495e0))
• NPcap from directory "Misc"
• PG/PC interface from directory "Misc"
• Microsoft C++ Redistributable for x86-systems (you can find the installation data for
download on the Internet. (https://aka.ms/vs/15/release/vc_redist.x86.exe))
The download of the tool and further information as well as documentation on the individual
functions of the MFCT can be found on the Internet.
(https://support.industry.siemens.com/cs/de/en/view/109773881)
Communication
22 Function Manual, 11/2024, A5E03735815-AM
Introduction
1.1 Function Manuals documentation guide
Watch this short video to find out where you can find the overview directly in Siemens
Industry Online Support and how to use Siemens Industry Online Support on your mobile
device:
Quick introduction to the technical documentation of automation products per
video (https://support.industry.siemens.com/cs/us/en/view/109780491)
Communication
Function Manual, 11/2024, A5E03735815-AM 23
Introduction
1.1 Function Manuals documentation guide
mySupport
With "mySupport" you can get the most out of your Industry Online Support.
Registration You must register once to use the full functionality of "mySupport". After registra
tion, you can create filters, favorites and tabs in your personal workspace.
Support requests Your data is already filled out in support requests, and you can get an overview of
your current requests at any time.
Documentation In the Documentation area you can build your personal library.
Favorites You can use the "Add to mySupport favorites" to flag especially interesting or fre
quently needed content. Under "Favorites", you will find a list of your flagged
entries.
Recently viewed The most recently viewed pages in mySupport are available under "Recently viewed
articles articles".
CAx data The CAx data area gives you access to the latest product data for your CAx or CAe
system. You configure your own download package with a few clicks:
• Product images, 2D dimension drawings, 3D models, internal circuit diagrams,
EPLAN macro files
• Manuals, characteristics, operating manuals, certificates
• Product master data
You can find "mySupport" on the Internet. (https://support.industry.siemens.com/My/ww/en)
Application examples
The application examples support you with various tools and examples for solving your
automation tasks. Solutions are shown in interplay with multiple components in the system -
separated from the focus on individual products.
You can find the application examples on the Internet.
(https://support.industry.siemens.com/cs/ww/en/ps/ae)
Communication
24 Function Manual, 11/2024, A5E03735815-AM
Security information 2
2.1 General security information
Note the security-relevant information provided in the corresponding system manual.
You can find information relevant to cybersecurity in the section Industrial cybersecurity
(Page 26).
Communication
Function Manual, 11/2024, A5E03735815-AM 25
Industrial cybersecurity 3
Due to the digitalization and increasing networking of machines and industrial plants, the risk
of cyber attacks is also growing. Appropriate protective measures are therefore mandatory,
particularly in the case of critical infrastructure facilities.
Refer to the System Manual and the Security guidelines for SIMATIC HMI devices
(https://support.industry.siemens.com/cs/us/en/view/109481300) for general information and
measures regarding industrial cybersecurity.
This section provides an overview of security-related information pertaining to the
communication of your SIMATIC system.
NOTE
Security-relevant changes to software or devices are documented in the section Introduction
(Page 10).
Communication
26 Function Manual, 11/2024, A5E03735815-AM
Industrial cybersecurity
3.2 Security-relevant information in this manual
Communication
Function Manual, 11/2024, A5E03735815-AM 27
Product overview 4
CPUs, communications modules and processors, and PC systems of the S7‑1500, ET 200MP,
ET 200SP, ET 200pro and ET 200AL systems provide you with interfaces for communication
via PROFINET, PROFIBUS and point-to-point connections.
$161/%1 $16411/
Communication
28 Function Manual, 11/2024, A5E03735815-AM
Product overview
① PROFIBUS DP interface
Figure 4-2 PROFIBUS DP interface of the CM 1542‑5 and CM DP (to an ET 200SP CPU)
Communication
Function Manual, 11/2024, A5E03735815-AM 29
Product overview
Communication
30 Function Manual, 11/2024, A5E03735815-AM
Product overview
Communication
Function Manual, 11/2024, A5E03735815-AM 31
Product overview
Communications services
The communications services described below use the interfaces and communication
mechanisms provided by the system via CPUs, communication modules and processors.
Communication
32 Function Manual, 11/2024, A5E03735815-AM
Communications services 5
5.1 Overview of communication options
Communication
Function Manual, 11/2024, A5E03735815-AM 33
Communications services
5.1 Overview of communication options
Communication
34 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.1 Overview of communication options
Information on S7-1500R/H
You can find information on the communication possibilities with the S7‑1500R/H redundant
system in the section Communication with the redundant system S7-1500R/H (Page 433).
More information
• An application example for the configuration of the TLS-based PG/HMI communication and
protection of confidential configuration data of the CPU can be found in this Application
example (https://support.industry.siemens.com/cs/ww/en/view/109798583).
• A general application example for CPU-CPU communication with SIMATIC controllers
(compendium) can be found in this application example
(https://support.industry.siemens.com/cs/ww/en/view/20982954).
• A TIA library "LOpcUa", which provides you with function blocks for the implementation of
OPC UA PubSub for SIMATIC S7-1500, can be found in this Application example
(https://support.industry.siemens.com/cs/ww/en/view/109782455).
• You can find more information on the PtP connection in the function manual CM PtP -
Configurations for Point-to-Point Connections
(https://support.industry.siemens.com/cs/us/en/view/59057093).
• You will find the description of the web server functionality in the function manual Web
server (https://support.industry.siemens.com/cs/us/en/view/59193560).
• You can find general information about the standard protocol SNMP on the Service &
Support pages on the Internet
(https://support.industry.siemens.com/cs/us/en/view/15166742). Answers to the question
of which SNMP requests support S7-1500 CPUs and S7-1200 CPUs can be found in this
FAQ (https://support.industry.siemens.com/cs/at/en/view/79993228).
• You will find information about time-of-day synchronization in this FAQ
(https://support.industry.siemens.com/cs/ww/en/view/86535497).
Communication
Function Manual, 11/2024, A5E03735815-AM 35
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
NOTE
Port numbers used
The specified port numbers are the standard port numbers used by S7‑1500 CPUs,
communications modules and ET 200 interface modules. Many communication protocols and
implementations enable you to use other port numbers.
The following tables show the different layers and protocols used in S7‑1500 CPUs,
S7‑1500 communications modules and ET 200 interface modules.
Layers and protocols of the S7-1500 CPUs and Software Controllers (via PROFINET interface of
the CPU)
The following table shows the protocols supported by S7‑1500 CPUs, ET 200SP CPUs, and the
1513/1516pro‑2 PN CPUs. The S7‑1500 Software Controllers also support the protocols listed
in the following table for the Ethernet interfaces that are assigned to the Software Controller.
Table 5-2 Layers and protocols of the S7‑1500 CPUs and Software Controllers (via PROFINET interface of the CPU)
Protocol / Role Port num (2) Link layer Description / function Default setting / notes
ber (4) Transport lay
er
PROFINET protocols
DCP Not relev (2) Ethertype PROFINET Discovery and Basic Config Default: Up to FW version V3.0
ant 0x8892 uration Protocol. enabled, as of FW version V3.1 write
(PROFINET) DCP determines PROFINET devices protection enabled.
and enables the basic settings. DCP does not allow DCP Set com
mands from the outside in write-pro
tected mode during an active com
munication relationship.
Function can be deactivated in the
CPU properties by Boundary "End of
detection of accessible nodes" of the
interface.
DHCP 68 (4) UDP Dynamic Host Configuration Protocol. Default: Deactivated.
Client The IP address suite is obtained from Can be changed in the CPU properties
a DHCP server during the startup of (as of FW version 2.9).
the PROFINET interface.
1 Note: OUC (open communication) provides direct access to the UDP and TCP protocols. You must take into consideration
the IANA (Internet Assigned Numbers Authority) port restrictions and definitions.
2 Do not use ports for OUC, which are already used by other protocols.
Communication
36 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Protocol / Role Port num (2) Link layer Description / function Default setting / notes
ber (4) Transport lay
er
LLDP Not relev (2) Ethertype PROFINET Link Layer Discovery Pro Default: Activated.
ant 0x88CC (LLDP) tocol. Send function can be deactivated by
LLDP determines and manages neigh Boundary "End of topology discovery"
borhood relations between PROFINET in the CPU properties; readiness to
devices. receive remains active.
LLDP uses the special multicast MAC
address 01-80-C2-00-00-0E.
MRP Not relev (2) Ethertype Media Redundancy Protocol. Default: "Manager (Auto)".
ant 0x88E3 (IEC MRP enables control of redundant Can be changed in the CPU proper
62493-2-2010) transmission paths in a ring topology. ties. If you configure the CPU and
connect the PN interface with a sub
net, the default setting in the TIA
Portal is "Not device in the ring".
MRP uses standard-compliant multic
ast MAC addresses.
PROFINET IO Not relev (2) Ethertype PROFINET Cyclic IO Data Transfer. Default: Deactivated.
data ant 0x8892 With PROFINET IO telegrams, IO data The protocol is only activated for
(PROFINET) is transferred cyclically between the PROFINET IO data traffic.
PROFINET IO controller and IO devices
via Ethernet.
PROFINET 34964 (4) UDP PROFINET communication. Default: Activated (UDP port open).
Context Man Management of application and com This function cannot be deactivated.
ager munication relationships between IO
controller and IO devices.
PTCP Not relev (2) Ethertype PROFINET Precision Transparent Clock Default: Deactivated.
ant 0x8892 Protocol, based on IEEE 1588. Can be activated by the following
(PROFINET) PTCP provides a time delay measure configurations:
ment between RJ45 ports and thus • IRT with a sync domain.
the send clock and time synchroniza • Port interconnection with a spe
tion. cified cable length.
Function can be deactivated in the
CPU properties by "End of sync
domain" Boundary of the interface.
PTCP uses standard-compliant multic
ast MAC addresses.
Connection-oriented communication protocols
HTTP 80 (4) TCP Hypertext Transfer Protocol. Default: Deactivated.
Server HTTP is used for communication with Can be enabled in the CPU properties.
the CPU-internal web server.
Requirement: Web server in the CPU
properties is enabled.
HTTPS 443 (4) TCP Hypertext Transfer Protocol Secure. Default: Deactivated.
Server HTTPS is used for communication Can be enabled in the CPU properties.
with the CPU-internal Web server via
Secure Socket Layer (SSL). Requirement: Web server in the CPU
properties is enabled.
1 Note: OUC (open communication) provides direct access to the UDP and TCP protocols. You must take into consideration
the IANA (Internet Assigned Numbers Authority) port restrictions and definitions.
2 Do not use ports for OUC, which are already used by other protocols.
Communication
Function Manual, 11/2024, A5E03735815-AM 37
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Protocol / Role Port num (2) Link layer Description / function Default setting / notes
ber (4) Transport lay
er
IGMPv2 Not relev (3) Network layer Internet Group Management Pro IGMPv2 is a functionality of the IP
ant tocol. stack. This system function is activ
IGMPv2 is a network protocol for the ated by the multicast function.
organization of multicast groups (UDP
multicast only).
ISO-on-TCP 102 (4) TCP ISO-on-TCP protocol (according to Default: Activated.
Server RFC 1006). This function cannot be deactivated.
The S7 protocol uses ISO-on-TCP
according to RFC 1006 for PG/HMI
communication with the engineering
system (TIA Portal).
MODBUS 502 (4) TCP MODBUS Transmission Control Pro Default: Deactivated.
TCP tocol. Can be activated via Modbus instruc
Server / Client MODBUS/TCP is used by tions in the user program.
MB_CLIENT/MB_SERVER instructions
in the user program.
NTP 123 (4) UDP Network Time Protocol. Default: Deactivated.
Client NTP is used for synchronization of the Can be enabled in the CPU properties.
CPU system time with the time of an
NTP server.
OPC UA 4840 (4) TCP Open Platform Communications Uni Default: Deactivated.
Server / Client fied Architecture (based on TCP/IP Server and client function can be
protocol). enabled in the CPU properties.
A communication standard ranging Client access can be configured in the
from the enterprise level to the field user program.
level.
OUC1 1 ... 1999 (4) TCP Open User Communication Default: Deactivated.
can be used (4) UDP (TCP/UDP). You activate the respective protocol
Secure OUC to limited (4) ISO-on-TCP Secure Open User Communication with the corresponding Open User
Server / Client extent2 (Port: 102) (TLS). Communication instruction in the
OUC instructions enable connection user program or with the configura
2000 ...
establishment, connection termina tion of connections in the network
5000
tion and data transfer via the user view.
Recommen
program.
ded
1 Note: OUC (open communication) provides direct access to the UDP and TCP protocols. You must take into consideration
the IANA (Internet Assigned Numbers Authority) port restrictions and definitions.
2 Do not use ports for OUC, which are already used by other protocols.
Communication
38 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Protocol / Role Port num (2) Link layer Description / function Default setting / notes
ber (4) Transport lay
er
OUC1 As of FW (4) TCP Open User Communication The following applies to FW versions
version (4) UDP (TCP/UDP). lower than V3.0:
Secure OUC V3.0, the (4) ISO-on-TCP Secure Open User Communication • Programmed connections: 5001
Server / Client following (Port: 102) (TLS). ... 49152
applies to OUC instructions enable connection • Configured connections: 5001 ...
pro establishment, connection termina 65535
grammed tion and data transfer via the user
and con program.
figured
connec
tions:
5001 ...
65535
can be used
to limited
extent2
SMTP 25 (4) TCP Simple Mail Transfer Protocol. Default: Deactivated.
Client SMTP is used for sending emails. Can be enabled via TMAIL_C instruc
tion in the user program.
SMTPS (SMTP 465 (4) TCP Simple Mail Transfer Protocol Secure. Default: Deactivated.
over TLS) SMTP is used for sending emails over Can be enabled via TMAIL_C instruc
Client secure connections. tion in the user program.
SMTP with 25 (4) TCP Simple Mail Transfer Protocol with the Default: Deactivated.
STARTTLS 587 SMTP command "STARTTLS". Can be enabled via TMAIL_C instruc
Client SMTP is used for sending emails. tion in the user program.
SNMP 161 (4) UDP Simple Network Management Pro Default: Activated up to FW version
Agent 162 (trap) tocol. V2.9, deactivated as of FW version
SNMP is used for reading and setting V3.0.
of network management data Can be enabled via data record in the
(SNMP-managed objects) by the user program.
SNMP manager Can be enabled in the CPU properties
as of FW version V3.0.
As of FW version V3.1, can addition
ally be enabled as write-protected in
the CPU properties.
Syslog (system 6514 (4) TCP Syslog is an IETF standard protocol Default: Deactivated.
logging) 514 (4) UDP (RFC 5424) for the transmission of Can be enabled in the CPU properties.
events that a CPU detects. You can configure the forwarding of
syslog messages to a syslog server in
the CPU properties. The collection of
system logging events within a CPU
cannot be disabled as of
FW version V3.1.
Reserved 49152 ... (4) TCP If an application does not address a -
65535 (4) UDP local port, then the CPU uses this port
range for the active connection point.
1 Note: OUC (open communication) provides direct access to the UDP and TCP protocols. You must take into consideration
the IANA (Internet Assigned Numbers Authority) port restrictions and definitions.
2 Do not use ports for OUC, which are already used by other protocols.
Communication
Function Manual, 11/2024, A5E03735815-AM 39
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Layers and logs of the S7-1500 Software Controller (via Ethernet interface on the Windows side)
The following table shows the protocols that are supported by the S7-1500 Software
Controller via the Ethernet interfaces assigned by Windows.
Table 5-3 Layers and logs of the S7-1500 Software Controller (via Ethernet interface on the Windows side)
Protocol / Role Port num (2) Link layer Description / function Notes / default setting
ber (4) Transport lay
er
PROFINET protocols
DCP Not relev (2) Ethertype PROFINET Discovery and Basic Config Default: Enabled up to version V30.0.
ant 0x8892 uration Protocol. Write-protection enabled as of version
(PROFINET) DCP determines PROFINET devices V30.1 .
and enables the basic settings. DCP does not allow DCP Set com
mands from the outside in write-pro
tected mode during an active com
munication relationship.
Function can be disabled with Bound
ary "End of detection of accessible
nodes" in the CPU properties.
DHCP 68 (4) UDP Dynamic Host Configuration Protocol. Default: Deactivated.
Client The IP address suite is obtained from Can be changed in the CPU properties
a DHCP server during the startup of (as of FW version 2.9).
the PROFINET interface.
Connection-oriented communication protocols
HTTP Adjustable 1 (4) TCP Hypertext Transfer Protocol. Default: Deactivated.
Server HTTP is used for communication with Can be changed in the CPU proper
the CPU-internal web server. ties.
Communication
40 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Protocol / Role Port num (2) Link layer Description / function Notes / default setting
ber (4) Transport lay
er
OUC2 1 ... 1999 (4) TCP Open User Communication Default: Deactivated.
and can be used (4) UDP (TCP/UDP). Can be enabled via data record in the
Secure OUC to limited (4) ISO-on-TCP Secure Open User Communication user program.
extent3, 4 (Port: 102) (TLS).
OUC instructions enable connection If you want to use OUC, you must
2000 ...
establishment, connection termina activate the ports in the Windows
5000
tion and data transfer based on the Firewall.
recommen
socket layer.
ded4
5001 ...
49151
can be used
to limited
extent3, 4
SMTP 25 (4) TCP Simple Mail Transfer Protocol. Default: Deactivated.
Client SMTP is used for sending emails. Can be activated by calling the block
in the user program or as of version
V3.0 via CPU settings.
Syslog (system 6514 (4) TCP Syslog is an IETF standard protocol Default: Deactivated.
logging) 514 (4) UDP (RFC 5424) for the transmission of Can be enabled in the CPU properties.
events that a CPU detects. You can configure the forwarding of
syslog messages to a syslog server in
the CPU properties. The collection of
system logging events within a CPU
cannot be disabled as of
FW version V3.1.
Reserved 49152 ... (4) TCP If the application does not specify the If you want to use this communica
65535 (4) UDP local port number, this dynamic port tion, you must activate the ports in
range is used for the active connec the Windows Firewall.
tion end point.
1 Default setting for Windows assigned interfaces: 81
2 Note: OUC (open communication) provides direct access to the UDP and TCP protocols. You must take into consideration
the IANA (Internet Assigned Numbers Authority) port restrictions and definitions.
3 Do not use ports for OUC, which are already used by other protocols.
4 Do not use ports for OUC, which are already used by other Windows applications.
Communication
Function Manual, 11/2024, A5E03735815-AM 41
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Communication
42 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
Protocol / Role Port num (2) Link layer Description / function Default setting / notes
ber (4) Transport lay
er
IO controller according to the config
uration.
PTCP uses standard-compliant multic
ast MAC addresses.
Connection-oriented communication protocols
IGMPv2 Not relev (3) Network layer Internet Group Management Pro IGMPv2 is a functionality of the IP
ant tocol. stack. This system function is activ
IGMPv2 is a network protocol for the ated by the multicast function.
organization of multicast groups (UDP
multicast only).
MODBUS 502 (4) TCP MODBUS Transmission Control Pro Default: Deactivated.
TCP tocol. Can be activated via MultiFieldbus
Slave Configuration Tool (MFCT).
SNMP 161 (4) UDP Simple Network Management Pro Default setting for supporting inter
Agent 162 (trap) tocol. face modules:
SNMP is used for reading and setting • Synchronize default values from
of network management data IO controller
(SNMP-managed objects) by the • Deactivated
SNMP manager
EtherNet/IP 44818 (4) TCP The EtherNet/IP protocol and Com Default: Deactivated.
(TCP) (4) UDP mon Industrial Protocol (CIP) proto Can be activated via MultiFieldbus
CIP
2222 (UDP) cols enable communication between Configuration Tool (MFCT).
interface modules and CPUs.
EtherNet/IP use MultiFieldbus devices
for data exchange.
CIP Implicit Messaging is used for the
continuous transmission of real-time
data in time-critical applications.
CIP Explicit Messaging is used for the
targeted retrieval or transmission of
configuration and diagnostic data.
TCP/IP Not relev (4) TCP Transmission Control Protocol. Default: Activated.
ant TCP ensures a reliable connection This function cannot be deactivated.
between 2 communication partners.
UDP Not relev (4) UDP User Datagram Protocol. Default: Activated.
ant UDP works without a connection and This function cannot be deactivated.
is based on the unsecured Internet
Protocol (IP).
ARP Not relev (2) Ethertype Adress Resolution Protocol. Default: Activated.
ant 0x0806 Assignment of the IP addresses to the This function cannot be deactivated.
MAC addresses.
IPv4 Not relev (3) Network layer Internet Protocol Version 4. Default: Activated.
ant Identification of devices by IP This function cannot be deactivated.
addresses. IPv4 is used to send data
packets from their origin to their des
tination.
Reserved 49152 ... (4) TCP If an application does not address a -
65535 (4) UDP local port, then the CPU uses this port
range for the active connection point.
Communication
Function Manual, 11/2024, A5E03735815-AM 43
Communications services
5.3 Overview of connection resources
Connection resources
Some communications services require connections. Connections allocate resources on the
CPUs, CPs and CMs involved (for example memory areas in the CPU operating system). In
most cases one resource per CPU/CP/CM is allocated for a connection. In HMI communication,
up to 3 connection resources are required per HMI connection.
The connection resources available depend on the CPU being used, the CPs and CMs and
must not exceed a defined high limit for the automation system.
Additional information
You will find more detailed information on the allocation of connection resources and the
display of connection resources in STEP 7 in the section Connection resources (Page 418).
Communication
44 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.4 Setting up a connection
Automatic connection
STEP 7 sets up a connection automatically (for example PG or HMI connection) if you have
connected the PG/PC interface to an interface of the CPU physically and have made the
interface assignment in STEP 7 in the "Go online" dialog.
Communication
Function Manual, 11/2024, A5E03735815-AM 45
Communications services
5.4 Setting up a connection
Communication
46 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.4 Setting up a connection
Communication
Function Manual, 11/2024, A5E03735815-AM 47
Communications services
5.4 Setting up a connection
Additional information
You will find further information on the allocation of connection resources and the display of
connection resources in STEP 7 in the section Connection resources (Page 418).
Communication
48 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.5 Data consistency
Definition
Data consistency is important for data transfer and you need to take this into account when
configuring the communication task. Otherwise, malfunctions may occur.
A data area which cannot be modified by concurrent processes is called a consistent data
area. This means that a data area which belongs together and which is larger than the
maximum size of the consistent data area can consist in part of new and of old data at the
same time.
An inconsistency can occur when an instruction for communication is interrupted, for
example by a hardware interrupt OB with higher priority. This interrupts the transfer of the
data area. If the user program in this OB now changes the data that has not yet been
processed by the communication instruction, the transferred data originates from different
times:
The following figure shows a data area that is smaller than the maximum size of the
consistent data area. In this case, when transferring the data area, it is ensured that there is
no interruption by the user program during data access so that the data is not changed.
5(&25'
6RXUFHGDWDDUHD 7DUJHWGDWDDUHD
① The source data area is smaller than the maximum size of the consistent data area (②). The
instruction transfers the data together to the destination data area.
② Maximum size of the consistent data area
Figure 5-3 Consistent transfer of data
Communication
Function Manual, 11/2024, A5E03735815-AM 49
Communications services
5.5 Data consistency
The following figure shows a data area that is larger than the maximum size of the consistent
data area. In this case, the data can be changed during an interruption of the data transfer.
An interruption also occurs if, for example, the data area needs to be transferred in several
parts. If the data is changed during the interruption, the transferred data originates from
different times.
6RXUFHGDWDDUHDDWWLPH7 7DUJHWGDWDDUHD
6RXUFHGDWDDUHDDWWLPH7
7DUJHWGDWDDUHD
① The source data area is larger than the maximum size of the consistent data area (③). At time
T1, the instruction only transfers as much data from the source data area into the destination
data area as fits in the consistent data area.
② At time T2, the instruction transfers the rest of the source data area to the destination data
area. After the transfer, data from different points in time exist in the destination data area. If
the data in the source data area has changed in the meantime, an inconsistency may result.
③ Maximum size of the consistent data area
Figure 5-4 Transfer of data larger than the maximum consistency area
Example of an inconsistency
The figure below shows an example of changing data during the transfer. The destination
data area contains data from different points in time.
Communication
50 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.5 Data consistency
NOTE
Measures in the user program
To achieve data consistency, you can copy transferred data to a separate data area (for
example, global data block). While the user program continues to work with the original data,
you can transfer the data saved in the separate data area consistently with the
communication instruction.
For the copying, use uninterruptible instructions such as UMOVE_BLK or UFILL_BLK. These
instructions ensure data consistency up to 16 KB.
Additional information
• You will also find the maximum amount of consistent data in the device manuals of the
communications modules in the Technical Specifications.
• You will find further information on data consistency in the description of the instructions
in the STEP 7 online help.
Communication
Function Manual, 11/2024, A5E03735815-AM 51
Communications services
5.6 Secure Communication
For STEP 7 (TIA Portal) as of V14 and for S7-1500 CPUs as of firmware V2.0, the options for
secure communication have been broadened considerably.
"S7-1500 CPUs" also refers to CPU versions S7-1500F, S7-1500T, S7-1500C as well as
S7-1500pro CPUs and ET200SP CPUs.
In subsequent versions, additional components will support Secure Communication (e.g.
secure OUC), see next section.
As of firmware version V4.4, S7-1200 CPUs also support Secure Communication.
Requirement
• CPUs that support connection description DBs with the structure of the SDT
TCON_IP_V4_SEC or SDT TCON_QDN_SEC. These are the following CPUs:
– S7-1200 as of firmware V4.4
– S7-1500 as of firmware V2.0
• Also optional via the following CPs:
– CP 1243-1 as of firmware V3.2
– CP 1243-8 IRC as of firmware V3.2
– CP 1543‑1 as of firmware V2.0
– CP 1545‑1
– CP 1543SP-1
Secure Communication via CP 1242-7 GPRS V2 is not possible.
Communication
52 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Communication
Function Manual, 11/2024, A5E03735815-AM 53
Communications services
5.6 Secure Communication
3/&SURJUDP
2SHQXVHUFRPPXQLFDWLRQ
:HEVHUYHU
$SSOLFDWLRQ/D\HU
6HFXUH28&
+7736
28&
+773
6HVVLRQ/D\HU 7/6
7UDQVSRUW/D\HU 7&38'3
1HWZRUN/D\HU ,3Y
'DWD/LQN/D\HU (WKHUQHW
3K\VLFDO/D\HU
Communication
54 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
More information
You can find more information on OPC UA in the section Using the S7-1500 as an OPC UA
server (Page 221).
For more information on secure programming device/HMI communication, refer to the
section Secure PG/HMI communication (Page 107).
Transport Layer Security (TLS) is a widespread security protocol that improves the data
security for communications. For the S7-1500 automation system, TLS is used for secure
communication for the following certificate-based applications:
• Web server (HTTPS protocol variant)
• Secure Open User Communication (OUC) including secure email (TMAIL_C instruction)
• Secure PG/HMI communication
TLS takes care of the authenticity, confidentiality and integrity of the communication
between client and server for the listed applications, for example, between the web server of
CPU and web browsers, which, for example, have to display a diagnostics web page of the
CPU.
The OPC UA server and OPC UA client applications do not actually directly use TLS, but the
cryptographical processes used are comparable.
TLS is continuously being further developed, resulting in various TLS versions, which are
distinct with regard to the cipher suites (standardized collection of cryptographic methods)
supported and the performance.
The Internet Engineering Task Force (IETF) is responsible for the description of the TLS
protocol. The following correlation applies:
• TLS 1.3 corresponds to RFC 8446
• TLS 1.2 corresponds to RFC 5246
In addition, not every device supports all the cryptographic methods defined in the RFCs.
Therefore, after establishing the connection, the client and server negotiate a method that
both support (Handshake) as well as the parameters to be used.
Communication
Function Manual, 11/2024, A5E03735815-AM 55
Communications services
5.6 Secure Communication
Communication
56 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Message encryption is an important element of data security. When encrypted messages are
intercepted by third parties during communication, these potential eavesdroppers cannot
access the information they contain.
There is a wide range of mathematical processes (algorithms) for encrypting messages.
All algorithms process a "key" parameter to encrypt and decrypt messages.
• Algorithm + key + message => encrypted message
• Encrypted message + key + algorithm => (decrypted) message
Symmetric encryption
The central aspect of symmetric encryption is that both communication partners use the
same key for message encryption and decryption, as shown in the figure below. Bob uses the
same key for encryption as Alice uses for decryption. In general, we also say that the two
sides share the secret key with which they encrypt or decrypt a message as a secret.
%RE $OLFH
Communication
Function Manual, 11/2024, A5E03735815-AM 57
Communications services
5.6 Secure Communication
Asymmetric encryption
Asymmetric encryption works with a pair of keys consisting of one public key and one private
key. Used with a PKI, it is also known as Public Key cryptography or simply PKI cryptography.
A communication partner, Alice in the figure below, has a private key and a public key. The
public key is provided to the public, in other words any potential communication partner.
Anyone with the public key can encrypt messages for Alice. In the figure below, this is Bob.
Alice's private key, which she must not disclose, is used by Alice to decrypt an encrypted
message addressed to her.
3XEOLFNH\
3ULYDWHNH\
%RE $OLFH
① Alice provides Bob with her public key. No precautionary measures are required to this pur
pose: Anyone can use the public key for messages to Alice if they are sure that it is actually
Alice's public key.
② Bob encrypts his message with Alice's public key.
③ Alice decrypts the encrypted message from Bob with her private key. As only Alice has the
private key and never discloses it, only she can decrypt the message. With her private key, she
can decrypt any message encrypted with her public key - not only messages from Bob.
Figure 5-8 Asymmetric encryption
The system can be compared to a mailbox into which anyone can put a message, but from
which only the person with the key can remove messages.
• Advantages: A message encrypted with a public key can only be decrypted by the owner
of the private key. As another (private) key is required for decryption, it is also much
harder to work out the decryption key on the basis of large numbers of encrypted
messages. This means that the public key does not have to be kept strictly confidential,
unlike with symmetric keys.
Another advantage is easier distribution of public keys. No specially secured channel is
required in asymmetric cryptography to transfer the public key from the recipient to the
sender encrypting the messages. Less work is thus required in managing the keys than
would be the case in symmetric encryption procedures.
• Disadvantages: Complex algorithm (e.g. RSA, named after the three mathematicians
Rivest, Shamir and Adleman), and therefore poorer performance than with symmetric
encryption.
Communication
58 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Abuse of encryption
You cannot tell what identity is assigned to a public key from the bit string. A fraud could
provide their public key and claim to be someone else. If a third party then uses this key
thinking that they are addressing their required communication partner, confidential
information could end up with the fraud. The fraud then uses their private key to decrypt the
message that was not intended for them, and sensitive information falls into the wrong
hands.
To prevent this type of abuse, the communication partners must be confident that they are
dealing with the right communication partner. This trust is established by using digital
certificates in a PKI.
Communication
Function Manual, 11/2024, A5E03735815-AM 59
Communications services
5.6 Secure Communication
Attacks from programs that intercept communication between the server and client and act
as if they themselves were client or server, are called man-in-the-middle attacks. If the false
identity of these programs is not detected, they can obtain important information about the
S7 program, for example, or set values in the CPU and attack a machine or plants. Digital
certificates are used to avoid such attacks.
Secure communication uses digital certificates that meet the X.509 standard of the
International Telecommunication Union (ITU). This allows the identity of a program, a
computer or an organization to be checked (authenticated).
$OLFHWUXVWV7ZHQW
7ZHQW &$ $OLFH
WKHFHUWLILFDWHDXWKRULW\&$
Communication
60 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Self-signed certificates
Self-signed certificates are certificates whose signature comes from the certificate subject and
not from an independent certificate authority.
Examples:
• You can create and sign a certificate yourself, for example, to encrypt messages to a
communication partner. In the example above, Bob (instead of Twent) could himself sign
his certificate with his private key. Using Bob's public key, Alice can check that the
signature and public key from Bob match. This procedure is sufficient for simple internal
plant communication that is to be encrypted.
• A root certificate is, for example, a self-signed certificate, signed by the certificate
authority (CA), that contains the public key of the certificate authority.
Certificate content
A certificate to the X.509 V3 standard, the standard that is also used by STEP 7 and the
S7-1500 CPUs, consists primarily of the following elements:
• Public key
• Details of the certificate subject (i.e. the holder of the key), for example, the Common
Name (CN) of Subject .
• Attributes such as serial number and validity period
• Digital signature from the certificate authority (CA) confirming that the information is
correct.
There are also extensions, for example:
• Specification of what the public key may be used for (Key Usage), for example, signing or
key encryption.
When you create a new certificate with STEP 7, for example in the context of Secure Open
User Communication, select the correct entry from the list of possible usages, e.g. "TLS".
• Specification of a Subject Alternative Name (SAN), which is used in secure communication
with Web servers (HTTP over TLS), for example, to ensure that the certificate in the
address bar of the Web browser also belongs to the Web server specified in the URL.
Communication
Function Manual, 11/2024, A5E03735815-AM 61
Communications services
5.6 Secure Communication
7ZHQW
&$
$OLFHYHULILHV%RE V
VLJQDWXUHZLWKWKHSXEOLF
NH\IURP7ZHQW &$ %RE
&$
Figure 5-10 Verification of a certificate with the public key of the certificate of a certificate authority
Communication
62 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Signing messages
The method described above for signing and verifying certificates also uses the TLS session
for signing and verifying messages:
If a hash value is generated by a message and this hash value is encrypted with the private
key of the sender and attached to the original message, the receiver of the message is able to
check the integrity of the message. The recipient decrypts the hash value with the public key
of the sender, puts together the hash value from the message received and compares the two
values. If the values are not the same, the message or the encrypted hash value has been
tampered with on the way.
Communication
Function Manual, 11/2024, A5E03735815-AM 63
Communications services
5.6 Secure Communication
This section shows the available certificate management options of an S7-1500 CPU
depending on the service (CPU application) used and on the versions of the TIA Portal / the
CPU firmware.
Service Certificate management with TIA Portal Certificate management with OPC UA GDS push
(TIA Portal version / S7-1500 CPU-FW methods
version) (TIA Portal version / S7-1500 CPU-FW version)
Web server as of V14 / as of V2.0 as of V18 / as of V3.0
Secure OUC communica as of V14 / as of V2.0 -
tion
OPC UA server as of V14 / as of V2.0 as of V17 / as of V2.9
OPC UA client as of V15.1 / as of V2.6 -
Secure PG/HMI Communic as of V17 / as of V2.9 -
ation
More information
Click here for a description of the certificate management with GDS push methods: Certificate
management via Global Discovery Server (GDS) (Page 199).
If you do not need to load new certificates, but need to renew a certificate, e.g. because the
validity period has expired, this is also possible in RUN while adhering to the conditions: See
Tip: Updating loaded certificates in RUN (Page 76).
Communication
64 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
STEP 7 as of version V14 together with the S7‑1500 CPUs as of firmware version 2.0 support
the Internet PKI (RFC 5280) in as far as an S7‑1500 CPU is able to communicate with devices
that also support the Internet PKI.
The usage of X.509 certificates for verifying certificates as described in the preceding
sections, for example, is a result of this.
STEP 7 as of V14 uses a PKI similar to Internet PKI. Certificate Revocation Lists (CRLs), for
example, are not supported.
Communication
Function Manual, 11/2024, A5E03735815-AM 65
Communications services
5.6 Secure Communication
Special features of the section "Protection & Security > Certificate manager"
Only in this section of the Inspector window do you switch between the global, i.e. project-
wide, and the local, i.e. device-specific, certificate manager (option "Use global security
settings for certificate manager"). The option decides whether you have access to all the
certificates in the project or not.
• If you do not use the certificate manager in the global security settings, you only have
access to the local certificate memory of the CPU. You do not have access, for example, to
imported certificates or root certificates. Without these certificates only a restricted
functionality is available. You can, for example, only generate self-signed certificates.
• If you use the certificate manager in the global security settings and you are logged on as
an administrator, you have access to the global, project-wide certificate memory. You can,
for example, assign imported certificates to the CPU, or create certificates that are issued
and signed by the project CA (certificate authority of the project).
Communication
66 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
The figure below shows how the "Global security settings" are shown in the project tree after
the "Use global security settings for certificate manager" option has been activated in the
Inspector window of the CPU.
When you double-click "User login" in the project tree below the global security settings and
log in, a line called "Certificate manager" is displayed, among other data.
When you double-click the "Certificate manager" line, you obtain access to all the certificates
in the project, divided into the tabs "CA" (certificate authorities), "Device certificates" and
"Trusted certificates and root certificate authorities".
Private keys
STEP 7 generates private keys while generating device certificates and server certificates
(end-entity certificates). The location where the private key is stored encrypted depends on
the use of the global security settings for the certificate manager:
• If you use global security settings, the private key is stored encrypted in the global
(project-wide) certificate memory.
• If you do not use global security settings, the private key is stored encrypted in the local
(CPU-specific) certificate memory.
The existence of the private key, which is required to decrypt data, for example, is displayed
in the "Private key" column of the "Device certificates" tab of the certificate manager in the
global security settings.
Communication
Function Manual, 11/2024, A5E03735815-AM 67
Communications services
5.6 Secure Communication
When the hardware configuration is loaded, the device certificate, the public key as well as
the private key are loaded into the CPU.
NOTICE
Enabling the "Use global security settings for certificate manager" option -
Consequences
The "Use global security settings for certificate manager" option influences the previously
used private key: If you have already created certificates without using the certificate
manager in the global security settings and then change the option for using the certificate
manager, the private keys are lost and the certificate ID can change. A warning draws your
attention to this fact. Therefore specify at the beginning of the project configuration which
option is required for the certificate manager.
As explained in the preceding sections, certificates are required for every type of secure
communication. The following section shows as an example how you handle the certificates
with STEP 7 so that the requirements for Secure Open User Communication are fulfilled.
The devices which are involved at the respective communication partners are differentiated
below. The respective steps for supplying the required certificates to the communications
participants are described. An S7‑1500 CPU or an S7‑1500 Software Controller as of firmware
version 2.0 is always required.
The general rule is:
While a secure connection is being established (handshake"), the communication partners as
a rule only communicate their end-entity certificates (device certificates).
Therefore the CA certificates required to verify the transmitted device certificate must be
located in the certificate memory of the respective communication partner.
NOTE
The current date/time must be set in the CPU.
When using secure communication (for example, HTTPS, secure OUC, OPC UA), make sure
that the corresponding modules have the current time of day and the current date.
Otherwise, the modules will evaluate the certificates used as invalid and secure
communication will not work.
Communication
68 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Procedure
STEP 7 automatically loads the required CA certificates together with the hardware
configuration to the participating CPUs so that the requirements for certificate verification
exist for both CPUs. You therefore only have to generate the device certificates for the
respective CPU; STEP 7 does the rest for you.
1. Mark PLC_1 and activate the "Use global security settings for certificate manager" option in
the "Protection & Security" section.
2. Log in as a user in the project tree in the "Global security settings" section. For a new
project, the "Administrator" role is planned for the first login.
3. Return to the PLC‑1 in the "Protection & Security" section. Click in an empty line in the
"Certificate subject" column in the "Device certificates" table to add a new certificate.
4. In the drop-down list for selecting a certificate click the "Add" button.
The "Create Certificate" dialog opens.
5. Leave the default settings in this dialog. They are tailored to the usage of Secure Open
User Communication (usage: TLS).
Tip: Supplement the default name of the certificate subject, in this case the CPU name. In
order to differentiate you better leave the default CPU name in case you have to manage a
large number of device certificates.
Example: PLC_1/TLS becomes PLC_1-SecOUC-Chassis17FactoryState.
6. Compile the configuration.
The device certificate and the CA certificate are part of the configuration.
7. Repeat the steps described above for PLC_2.
In the next step you have to create the user programs for the data exchange and load the
configurations together with the program.
Communication
Function Manual, 11/2024, A5E03735815-AM 69
Communications services
5.6 Secure Communication
Secure Open User Communication between S7-1500 CPU as a TLS client and an external device
as a TLS server
Two devices are to exchange data with each other via TLS connection or TLS session, for
example, exchanging recipes, production data or quality data:
• An S7‑1500‑CPU (PLC_1) as TLS client; the CPU uses Secure Open User Communication
• An external device (for example a Manufacturing Execution System (MES)) as TLS server
The S7-1500 CPU establishes the TLS connection / session to the MES system as TLS client.
① TLS client
② TLS server
The S7-1500 CPU requires the CA certificates of the MES system to authenticate the TLS
server: The root certificate and, if appropriate, the intermediate certificates for verifying the
certificate path.
You have to import these certificates into the global certificate memory of the S7-1500 CPU.
Communication
70 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Secure Open User Communication between an S7-1500 CPU as TLS server and an external device
as TLS client
If the S7-1500 CPU acts as TLS server and the external device, for example an ERP system
(Enterprise Resource Planning System) establishes the TLS connection / session, you require
the following certificates:
• For the S7-1500 CPU, you generate a device certificate (server certificate) with a private
key and download it with the hardware configuration into the S7-1500 CPU. You use the
"Signed by certificate authority" option when generating the server certificate.
The private key is required for the key exchange as explained in the figure for the example
"HTTP over TLS".
• You have to export the CA certificate of the STEP 7 project for the ERP system and import /
load it into the ERP system. With the CA certificate the ERP system verifies the server
certificate of the S7-1500 that was transferred from the CPU to the ERP system during the
establishment of the TLS connection / session.
Communication
Function Manual, 11/2024, A5E03735815-AM 71
Communications services
5.6 Secure Communication
① TLS server
② TLS client
Figure 5-12 Secure OUC between an S7‑1500 CPU and ERP system
The required steps are described in the preceding sections.
Figure 5-13 Secure OUC between a S7-1500 CPU and a mail server
Requirement for secure email connection is the importing of the root certificate and the
intermediate certificates of the mail server (provider) into the global certificate memory of
the S7-1500 CPU. By means of these certificates the CPU can check the server certificate that
is sent by the mail server during the establishment of the TLS connection / session.
Proceed as follows to import certificates of the mail server:
1. Open the certificate manager in the global security settings in the project tree.
2. Select the appropriate table (trusted certificates and root certificate authorities) for the
certificate to be imported.
3. Right-click in the table to open the shortcut menu. Click "Import" and import the required
certificate or the required CA certificates.
As a result of the import, the certificate has a certificate ID assigned to it and can be
assigned to a module in the next step.
4. Mark PLC_1 and navigate to the "Certificates of partner devices" table in the "Protection &
Security" section.
Communication
72 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
5. Click in an empty line in the "Certificate subject" column to add the imported certificates.
6. Select the required CA certificates of the communication partner from the drop-down list
and confirm the selection.
In the next step you have to create the user programs for the email client function of the CPU
and load the configurations together with the program.
The following paragraphs show how the mechanisms described are used to establish a secure
communication between a Web browser and the Web server of an S7-1500 CPU.
Initially the changes for the "Permit access only with HTTPS" option in STEP 7 are described.
As of STEP 7 V14 you have the possibility to influence the server certificate of the Web server
of an S7-1500 CPU as of firmware V2.0: The server certificate is generated as of these
versions with STEP 7.
In addition it illustrates the processes that are executed when a website of the CPU Web
server is called with a Web browser of a PC through an encrypted HTTPS connection.
NOTE
The current date/time must be set in the CPU.
When using secure communication (for example, HTTPS, secure OUC, OPC UA), make sure
that the corresponding modules have the current time of day and the current date.
Otherwise, the modules will evaluate the certificates used as invalid and secure
communication will not work.
Communication
Function Manual, 11/2024, A5E03735815-AM 73
Communications services
5.6 Secure Communication
Communication
74 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
$OLFHDFFHVVHVZHEVLWHZLWK
KWWSV
$OLFH
:HEVHUYHUDFFHSWVWKHFRQQHFWLRQ &$
DQGVHQGVLWVFHUWLILFDWHZLWKSXEOLF
NH\
6LJQHGSXEOLFNH\DQG
SULYDWHNH\RIWKH:HE
$OLFHVHOHFWV &$ VHUYHU
UDQGRPV\PP
NH\
:HEVHUYHUGHFU\SWVWKH
V\PPHWULFNH\ZLWKLWV
$OLFHVHQGVWKHV\PPHWULF SULYDWHNH\
NH\HQFU\SWHGZLWKWKHSXEOLFNH\RI
WKHVHUYHU
$OLFHDQGWKH:HEVHUYHUQRZ
XVHV\PPHWULFHQFU\SWLRQDQG
GHFU\SWLRQ
Communication
Function Manual, 11/2024, A5E03735815-AM 75
Communications services
5.6 Secure Communication
You have the following options for obtaining the intermediate certificates:
– The server itself sends the required intermediate certificates to Alice along with its end-
entity certificate – in the form of a signed message so that Alice can verify the integrity
of the certificate chain.
– The certificates often contain the URLs of the certificate issuer. Alice can load the
required intermediate certificates from these URLs.
When you work with certificates in STEP 7 it is always assumed that you have imported
the intermediate certificates and the root certificate into the project and assigned them to
the module.
2. Alice validates the signatures in the certificate chain with the public keys of the
certificates.
3. The symmetric key must be generated and transferred to the Web server.
4. If the Web server is addressed by its domain name, Alice also verifies the identity of the
Web server in accordance with the Internet PKI rules defined in RFC 2818. She is able to do
this because the URL of the Web server, in this case the "Fully Qualified Domain Name"
(FQDN), is saved in the end-entity certificate of the Web server. If the certificate entry in
the "Subject Alternative Name" field corresponds to the entry in the address bar of the
browser, everything is fine.
The process continues with the exchange of data with the symmetric key, as shown in the
figure above.
As of TIA Portal V19 and firmware version V3.1 of the S7-1500 CPUs (incl. R/H-CPUs) you have
the possibility to update certificates during runtime, i.e. in RUN mode of the CPU.
These are certificates that were configured through the TIA Portal and downloaded.
This allows this you, for example, to renew or replace certificates without interrupting the
running process.
Requirements
• Project protection is activated.
• The project administrator (Engineering-Administrator) is logged on with the
corresponding security rights.
• No further changes to the hardware configuration are present. These changes would
require a STOP of the CPU to be loaded.
Rule
The existing ID of the certificate to be updated must not change.
Communication
76 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Procedure
1. In TIA Portal (project navigation), navigate to the certificate manager (Security settings >
Security functions).
2. Select the "Certificate authority (CA)" tab or the "Device certificates" tab - depending on
which certificate you want to update.
3. Select the certificate to be updated.
4. In the context menu, select the "Renew" or "Replace" command, depending on whether
you want to replace the existing certificate with a certificate from the file system or only
update the validity data of the existing certificate, for example.
For CA certificates, all derived device certificates are automatically digitally signed with the
renewed CA certificate.
5. Load the changes to the CPU (Load to device > Hardware configuration).
1BTTXPSE 1BTTXPSECBTFELFZJOGPSNBUJPO
4&$63*5:
4FDVSF$PNNVOJDBUJPO
/PQBTTXPSEFNQUZQBTTXPSE %FGBVMULFZJOGPSNBUJPO
4&$63*5:
Communication
Function Manual, 11/2024, A5E03735815-AM 77
Communications services
5.6 Secure Communication
Requirement
• TIA Portal as of version V17
• CPU supports secure PG/HMI communication (for S7-1500 CPUs as of firmware version
2.9)
• The CPU is not yet loaded or the CPU is reset to factory settings with the option "Delete
password for protection of confidential PLC configuration data"
Procedure
1. Open the CPU properties in the network view or in the device view.
2. Navigate to the area "Protection & Security > Protection of the PLC configuration data".
Result: The "Protect confidential PLC configuration data" option is enabled first and the
empty field for password entry is highlighted in red.
3. Configure the password (recommended) via the "Set" button or disable the "Protect
confidential PLC configuration data" option.
4. Complete the configuration and create the user program.
5. Load the CPU.
When loading the hardware configuration, you will be asked once to re-enter the
password.
Background: The configured password is used in the TIA Portal to generate the key
information to protect confidential configuration data and thus to protect this data. For
security reasons, however, neither the password nor the key information is saved in the
project. In order for the key information to reach the CPU, it is re-generated when the
hardware configuration is loaded, so that the password must be entered once at this
point.
Communication
78 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Communication
Function Manual, 11/2024, A5E03735815-AM 79
Communications services
5.6 Secure Communication
5.6.3.2 Useful information for the protection of confidential PLC configuration data
The concept for Secure Communication protected by security standards comprises the
following components:
• A password-based key information that is used for protecting confidential configuration
data (e.g. private keys for certificates, passwords).
• A standardized log (TLS) that ensures communication between the participants (e.g.
programming device and CPU).
Communication
80 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
It makes a difference whether the CPU has already been loaded or not. If the CPU has already
been loaded, it has the key information with which the password-protected PLC configuration
data can be used.
Requirement
• The CPU is not yet loaded
Procedure
1. Open the CPU properties in the network view or in the device view.
2. Navigate to the area "Protection & Security > Protection of the PLC configuration data".
3. Click the "Change" button or deactivate the option "Protect confidential PLC configuration
data".
4. Enter the previously valid password in the dialog. In case of a password change, also enter
the new password and confirm the new password.
As long as you have not yet loaded a configuration into the CPU, the CPU is in a provisioning
phase (see CPU behavior from loading to operational readiness (Page 112)) and you can load
any valid configuration with your configured password.
Communication
Function Manual, 11/2024, A5E03735815-AM 81
Communications services
5.6 Secure Communication
Requirements
• You have write access to the CPU
• The CPU must be in STOP mode.
Procedure
1. Select the CPU in the network view.
2. Select the "Online & Diagnostics" command from the shortcut menu.
3. If you also change the project on the memory card, i.e. then want to reload the
configuration:
– Select the "Reset to factory settings" area in the opened online and diagnostics view.
– Activate the option "Delete password to protect confidential PLC configuration data".
To avoid a repeated start-up of the CPU, also select the "Format memory card" option.
– Then load the project with the changed configuration and the desired password.
4. If you do not have to change the project on the memory card, i.e. only the wrong
password is set:
– In the Online and diagnostics view, you specify the area "Password for the protection of
confidential PLC configuration data".
– Click the "Delete" button. If the "Delete" button is not available, no password has been
set in the CPU yet.
– Enter the required password and click the "Set" button.
If the correct password has been entered, the CPU can use the protected PLC configuration
data.
NOTE
Reset to factory settings via the mode switch/mode selector keys of the CPU
Restoring the factory settings of the CPU via the mode switch/mode selector keys also deletes
the IP address of the CPU, but not the password for protecting confidential PLC configuration
data.
Communication
82 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
NOTE
Reset to factory settings via the display of the CPU
Resetting the CPU to factory settings via the display deletes the password for the protection
of confidential PLC configuration data.
More information
Information on how to proceed in case of a spare part can be found in section Rules for the
replacement parts scenario (Page 89).
The protection of the confidential PLC configuration data can be reset. This may be necessary,
for example, if you want to change the password but no longer know the current password.
Requirement
• The CPU is not yet loaded
Procedure
1. Open the CPU properties in the network view or in the device view.
2. Navigate to the area "Protection & Security > Protection of the PLC configuration data".
3. Click "Reset".
Please note that the certificates of the CPU (e.g. certificates for web server, for OPC UA
server, for PG/PC communication and HMI communication) may no longer be used after
the reset and may have to be created again and reassigned.
– If you use the global security settings for the certificate manager, you must reassign
the certificates from the certificate manager.
– If you do not use the global security settings for the certificate manager, you must
recreate and reassign the certificates.
4. Confirm the reset of the password.
The option for the protection of confidential PLC configuration data is still activated.
Communication
Function Manual, 11/2024, A5E03735815-AM 83
Communications services
5.6 Secure Communication
Requirements
• You have write access to the CPU
• The CPU must be in STOP mode.
Procedure
1. Select the CPU in the network view.
2. Select the "Online & Diagnostics" command from the shortcut menu.
3. In the area "Password to protect confidential PLC configuration data", click the "delete"
button.
If the "Delete" button is not available, no password has been set in the CPU yet.
NOTICE
Deleting the password for confidential configuration data
If the password is deleted and a loaded project requires a corresponding password, this
project may no longer work without password.
NOTE
Password for protecting confidential configuration data after resetting the CPU to
factory settings
• Via the mode switch / mode selector keys (SIMATIC Memory Card is not inserted): The
password for protection of confidential configuration data is retained.
• Using the display: The password for protection of confidential configuration data is
deleted.
• Using STEP 7: The password for protection of confidential configuration data is retained.
The password is only deleted when the "Delete password for protection of confidential PLC
configuration data" option is set.
More information
Information on changing the password can be found in section Changing your password
(Page 81).
Communication
84 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
If you want to transfer the password to protect confidential PLC configuration data to a CPU
without using TIA Portal, you can also use a SIMATIC memory card for this function.
The use of a SIMATIC memory card is suitable for the following purposes:
• Preparing a new CPU
If a CPU is set up again, it should be configured with a password to protect the confidential
PLC configuration data. After this configuration is completed, it is possible to use another
SIMATIC memory card with the desired project.
(S7-1200 CPU: A "transfer" card with transfer job can also be used to install the program
on the CPU).
• CPU has a password to protect confidential PLC configuration data, but the password does
not match the project
If the passwords are not identical, you can set the correct password with the memory card
in the CPU.
(S7-1200 CPU: equipped either with SIMATIC "transfer" card or with SIMATIC "Program"
card).
• reset the password for the protection of confidential PLC configuration data in the CPU
As preparation for a disposal of the CPU or as preparation for a new project for the CPU.
Requirement
• TIA Portal as of version V17
Basic procedure
1. Creating a SIMATIC memory card with "SET PASSWORD" job
This action creates a folder and file structure following a special pattern and writes a
password for the protection of the confidential PLC configuration data as plain text to a
special file on the SIMATIC memory card. See description below.
2. Insertion of a prepared SIMATIC memory card in the CPU and switch on the CPU.
The PLC reads the password, processes it and stores the result in the internal memory. Any
existing entry is overwritten.
3. Remove the SIMATIC memory card and restart the CPU.
Results (S7-1500): While the CPU is reading the SIMATIC memory card, the LED shows the
same behavior as with a firmware update. The RUN/STOP LED flashes while the CPU is
setting the password. After the process has been completed successfully, the RUN/STOP
LED lights up yellow and the MAINT LED flashes yellow.
The result of the operation is displayed in the diagnostics buffer as success or error message.
If the password could not be set, the error LED flashes together with the other LEDs.
Communication
Function Manual, 11/2024, A5E03735815-AM 85
Communications services
5.6 Secure Communication
NOTE
Safe storage of the SIMATIC memory card
Store the SIMATIC memory card in a safe location to which only authorized persons have
access.
Communication
86 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
You can back up a functional configuration of a CPU in the TIA Portal and access it at a later
time; this means you can then restore the originally backed-up configuration. This allows you
to load a modified configuration, for example, to test product enhancements, to change
programs for troubleshooting in the system or you can replace components on a test basis.
You can then restore the originally backed-up configuration of the CPU.
Remedy
If the above error occurs, that is, the password for protecting confidential PLC configuration
data does not match the backup, you must delete the password to protect confidential PLC
configuration data in the CPU and then set the correct password. After a restart the CPU, the
backup is functional.
Communication
Function Manual, 11/2024, A5E03735815-AM 87
Communications services
5.6 Secure Communication
The following description lists some use cases that may result in CPU error messages.
Typical "pitfalls"
You should pay attention to the following circumstances in order to avoid or correct errors:
• Configuration loaded?
Regardless of whether you protect your confidential configuration data with a password or
not: without a loaded configuration, the CPU does not leave the provisioning phase.
• You are trying to load the CPU with a configured password and the CPU has already
received another password.
Example: CPU is exchanged for another CPU from the stock. The replacement CPU was not
completely reset (reset to factory settings with option "Delete password for protection of
confidential PLC configuration data").
Remedy:
– Always prepare replacement CPUs with the appropriate option (password deleted).
– For the configuration to be loaded, use the same password that was already used for
the configuration already loaded.
– It is also possible that the wrong project / CPU configuration was loaded. Check
whether the correct CPU configuration is available.
– Use the online function "Set password to protect confidential PLC configuration data"
to delete the password or to set the same password as in the CPU configuration. Then,
restart the device.
• The same error occurs if your CPU configuration does not use a password and the already
loaded configuration requires a user-defined password.
Remedy:
– Use the online function "Set password to protect confidential PLC configuration data"
to delete the password or to set the same password as in the CPU configuration. Then,
restart the device.
Communication
88 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
The assignment of passwords to protect confidential PLC configuration data also has an
impact on the replacement parts scenario.
More information
In section Assign password via SIMATIC Memory Card (Page 85) you can read how to use the
SIMATIC Memory Card to assign the password to protect confidential PLC configuration data.
Communication
Function Manual, 11/2024, A5E03735815-AM 89
Communications services
5.6 Secure Communication
5.6.4.1 Secure OUC of an S7-1500 CPU as TLS client to an external PLC (TLS server)
The following section describes how you can set up Open User Communication via TCP from
an S7-1500 CPU as TLS client to a TLS server.
Setting up a secure TCP connection from an S7-1500 CPU as TLS client to a TLS server
S7‑1500 CPUs as of firmware version V2.0 support secure communication with addressing via
a Domain Name System (DNS).
For secure TCP communication over the domain name you need to create a data block with
the TCON_QDN_SEC system data type yourself, assign parameters and call it directly at one of
the instructions TSEND_C, TRCV_C or TCON.
Requirements:
• Current date and time are set in the CPU.
• Your network includes at least one DNS server.
• You have configured at least one DNS server for the S7-1500 CPU.
• TLS client and TLS server have all the required certificates.
To set up a secure TCP connection to a TLS server, follow these steps:
1. Create a global data block in the project tree.
2. Define a tag of the data type TCON_QDN_SEC in the global data block.
The example below shows the global data block "Data_block_1" in which the tag
"DNS ConnectionSEC" of the data type TCON_QDN_SEC is defined.
3. Set the connection parameters of the TCP connection in the "Start value" column. Enter
the fully qualified domain name (FQDN) of the TLS server, for example, for "RemoteQDN".
Communication
90 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "ExtTLSCapabilities": If you enter the value 1, the client validates the
subjectAlternateName in the X.509-V3 certificate of the server to verify the identity of
the server. This validation is executed in the context of the instruction.
– "TLSServerCertRef": ID of the X.509-V3 certificate (usually a CA certificate) that is used
by the TLS client to validate the TLS server authentication. If this parameter is 0, the
TLS client uses all (CA) certificates currently loaded in the client certificate store to
validate the server authentication.
7BMJEBUJPO
%FWJDFDFSUJDBUF
GSPN5-4TFSWFS
Figure 5-19 Certificate handling from the perspective of the S7-1500 as a TLS client
Communication
Function Manual, 11/2024, A5E03735815-AM 91
Communications services
5.6 Secure Communication
Additional information
You can find more information on the TCON_QDN_SEC system data type in the STEP 7 online
help.
For additional information on secure communication, refer to the section Secure
Communication (Page 52).
5.6.4.2 Secure OUC of an S7-1500 CPU as TLS server to an external PLC (TLS client)
The following section describes how you can set up Open User Communication via TCP from
an S7-1500 CPU as TLS server to a TLS client.
Setting up a secure TCP connection via the domain name of the communication partner
S7‑1500 CPUs as of firmware version V2.0 support secure communication with addressing via
a Domain Name System (DNS).
For secure TCP communication over the domain name you need to create a data block with
the TCON_QDN_SEC system data type yourself, assign parameters and call it directly at one of
the instructions TSEND_C, TRCV_C or TCON.
Requirements:
• Current date and time are set in the CPU.
• Your network includes at least one DNS server.
• You have configured at least one DNS server for the S7-1500 CPU.
• TLS client and TLS server have all the required certificates.
To set up a secure TCP connection to a TLS client, follow these steps:
1. Create a global data block in the project tree.
2. Define a tag of the data type TCON_QDN_SEC in the global data block.
The example below shows the global data block "Data_block_1" in which the tag
"DNS ConnectionSEC" of the data type TCON_QDN_SEC is defined.
Communication
92 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. Enter,
for example, the local ID of the TCP connection for "ID".
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerReqClientCert": Request for an X.509-V3 certificate from the TLS client.
– "TLSServerCertRef": ID of the own X.509-V3 certificate.
7BMJEBUJPO
%FWJDFDFSUJDBUF
GSPN5-4TFSWFS
Figure 5-22 Certificate handling from the perspective of the S7-1500 as TLS server
Communication
Function Manual, 11/2024, A5E03735815-AM 93
Communications services
5.6 Secure Communication
More information
You can find more information about the system data types TCON_QDN_SEC in the STEP 7
online help.
For more information on secure communication, refer to the section Secure Communication
(Page 52).
The following section describes how you can set Secure Open User Communication via TCP
between two S7-1500 CPUs. In the process one S7‑1500 CPU acts as TLS client (active
establishing of the connection) and the other S7‑1500 CPU as TLS server (passive establishing
of the connection).
&$FHUWLILFDWHIURP &$FHUWLILFDWHIURP
7/6VHUYHU 7/6FOLHQW
9DOLGDWLRQ 9DOLGDWLRQ
'HYLFHFHUWLILFDWHIURP 'HYLFHFHUWLILFDWHIURP
7/6VHUYHU 7/6FOLHQW
Figure 5-24 Certificate handling for Secure OUC between two S7-1500 CPUs
Communication
94 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. For
example, enter the IPv4 address of the TLS server for "RemoteAddress".
NOTE
Connection parameter Interface ID
Note that you can enter the value "0" for the interface ID in the data type
TCON_IP_V4_SEC. In this case, the CPU itself searches for a suitable local CPU interface.
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerCertRef": Enter the value 2 (reference to the CA certificate of the TIA Portal
project (SHA256) or the value 1 (reference to the CA certificate of the TIA Portal project
(SHA1)). If you use a different CA certificate, enter the corresponding ID from the
certificate manager of the global security settings.
– "TLSClientCertRef": ID of the own X.509-V3 certificate.
Communication
Function Manual, 11/2024, A5E03735815-AM 95
Communications services
5.6 Secure Communication
5. Create one of the instructions TSEND_C, TRCV_C or TCON in the program editor.
6. Interconnect the CONNECT parameter of one of the instructions TSEND_C, TRCV_C or
TCON with the tags of the data type TCON_IP_V4_SEC.
3. Set the connection parameters of the TCP connection in the "Start value" column. For
example, enter the IPv4 address of the TLS client for "RemoteAddress".
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerReqClientCert ": Request for an X.509-V3 certificate from the TLS client.
Enter the value "true".
– "TLSServerCertRef": ID of the own X.509-V3 certificate.
– "TLSClientCertRef": Enter the value 2 (reference to the CA certificate of the TIA Portal
project (SHA256) or the value 1 (reference to the CA certificate of the TIA Portal project
(SHA1)). If you use a different CA certificate, enter the corresponding ID from the
certificate manager of the global security settings.
5. Create one of the instructions TSEND_C, TRCV_C or TCON in the program editor.
Communication
96 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Additional information
You can find more information about the system data types TCON_IP_4_SEC in the STEP 7
online help.
For additional information on secure communication, refer to the section Secure
Communication (Page 52).
The following sections describes the particular points to be taken into consideration in the
case of Secure Open User Communication via a CP interface. At least one station is an
S7-1500 station with the following modules:
• S7-1500 CPU as of firmware version V2.0 (except for S7-1500 Software Controller)
• CP
– CP 1543-1 as of firmware version V2.0
– CP 1545-1 as of firmware version V1.0
– CP 1543SP-1 as of firmware version V1.0
The CP acts in an S7‑1500 station as a TLS client (active connection establishment) or a TLS
server (passive connection establishment).
The fundamental procedure and the concept for using secure communication via a CP
interface is similar to that of secure communication via the interfaces of the S7-1500 CPUs.
Essentially, you have to assign the certificates to the CPU in the role of a TLS server or TLS
client and not to the CPU. Other rules and procedures therefore apply. These are described
below.
Communication
Function Manual, 11/2024, A5E03735815-AM 97
Communications services
5.6 Secure Communication
Example: Setting up a secure TCP connection between two S7-1500 CPUs via CP interfaces
In order to establish secure TCP communication between two S7‑1500 CPs you have to create
a data block with the system data type TCON_IP_V4_SEC in each CPU, carry out the parameter
assignment and call it directly at the instruction.
Requirements:
• Both S7-1500 CPUs have one of the firmware versions specified above.
• The CPs have one of the firmware versions specified above.
• TLS client and TLS server have all the required certificates.
– A device certificate (end-entity certificate) for the CP must be generated and be located
in the certificate memory of the CP. If a communication partner is an external device
(for example an MES or ERP system), a device certificate also has to exist for this
device.
– The root certificate (CA certificate) with which the device certificate of the
communication partner is signed must also be located in the certificate memory of the
CP or in the certificate memory of the external device. If you use intermediate
certificates, you have to ensure that the complete certificate path exists in the
validating device. A device uses these certificates to validate the device certificate of
the communication partner.
• The communication partner must always be addressed via its IPv4 address, not via its
domain name.
Communication
98 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
The following figure shows the different certificates in the devices for a scenario in which
both communication partners communicate via one CP. In addition, the figure shows the
transfer of the device certificates during establishment of the connection ("Hello").
&$FHUWLILFDWHIURP &$FHUWLILFDWHIURP
7/6VHUYHU 7/6FOLHQW
9DOLGDWLRQ 9DOLGDWLRQ
'HYLFHFHUWLILFDWH 'HYLFHFHUWLILFDWH
IURP7/6VHUYHU IURP7/6FOLHQW
Figure 5-28 Certificate handling in secure OUC between two S7-1500 CPUs via CP interfaces.
Communication
Function Manual, 11/2024, A5E03735815-AM 99
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. For
example, enter the IPv4 address of the TLS server for "RemoteAddress".
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerCertRef": Enter the value 2 (reference to the CA certificate of the TIA Portal
project (SHA256) or the value 1 (reference to the CA certificate of the TIA Portal project
(SHA1)).
– "TLSClientCertRef": ID of the own X.509-V3 certificate.
5. Create a TCON instruction in the program editor.
6. Connect the CONNECT parameter of the TCON instruction with the variable of data type
TCON_IP_V4_SEC.
Communication
100 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. For
example, enter the IPv4 address of the TLS client for "RemoteAddress".
4. Set the parameters for secure communication in the "Start value" column.
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerReqClientCert ": Request for an X.509-V3 certificate from the TLS client.
Enter the value "true".
– "TLSServerCertRef": ID of the own X.509-V3 certificate.
– "TLSClientCertRef": Enter the value 2 (reference to the CA certificate of the TIA Portal
project (SHA256) or the value 1 (reference to the CA certificate of the TIA Portal project
(SHA1)).
Communication
Function Manual, 11/2024, A5E03735815-AM 101
Communications services
5.6 Secure Communication
For secure Modbus TCP connection you need to create a data block with one of the system
data types TCON_IP_V4_SEC or TCON_QDN_SEC yourself, assign parameters and call it
directly at the MB_Server or MB_CLIENT instruction.
Requirements:
• S7‑1500 CPU CPU firmware version V2.5 or higher
• The Modbus client (TLS client) can reach the Modbus server (TLS server) over IP
communication in the network.
• TLS client and TLS server have all the required certificates.
Communication
102 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. Enter
the IPv4 address of the mail server, for example, for the "MailServerAddress".
4. Set the parameters for secure communication in the "Start value" column. Enter the
certificate ID of the CA certificate of the communication partner, for example, for
"TLSServerCertRef".
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. In
this case you can set up an unsecured Modbus TCP connection.
– "TLSServerCertRef": Reference to the X.509 V3 (CA) certificate of the Modbus TCP
server, which is used by the TLS client to validate the authentication of the Modbus TCP
server.
5. Create an MB_CLIENT instruction in the program editor.
6. Interconnect the CONNECT parameter of the MB_Client instruction with the tags of the
data type TCON_IP_4_SEC.
Communication
Function Manual, 11/2024, A5E03735815-AM 103
Communications services
5.6 Secure Communication
Requirements:
• TMAIL_C instruction version V5.0 or higher
• STEP 7 V15 and higher
• S7‑1500 CPU V2.5 and higher
• You have assigned all the CA certificates of the mail server (TLS server) to the CPU (TLS
client) and have downloaded the configuration to the CPU.
• Current date and time are set in the CPU.
Table 5-6 Port numbers for the SMTPS and STARTTLS processes
Process Port
SMTPS: 4651
STARTTLS Any (≠465)2
1 The instruction TMAIL_C uses SMTPS only for Port 465. For all other ports STARTTLS is used.
2 According to RFC, mail servers use Ports 25 and 587 for secure connections with STARTTLS. The use
of other port numbers for SMTP is not RFC-compliant, successful communication with such a mail
server is not guaranteed.
Communication
104 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
3. Set the connection parameters of the TCP connection in the "Start value" column. Enter
the IPv4 address of the mail server, for example, for the "MailServerAddress".
NOTE
Connection parameter Interface ID
Note that as of instruction version V5.0 of TMAIL_C instruction in the TMAIL_V4_SEC data
type, you need to enter the value "0" for the Interface ID. In this case, the CPU itself
searches for a suitable local CPU interface.
Communication
Function Manual, 11/2024, A5E03735815-AM 105
Communications services
5.6 Secure Communication
4. Set the parameters for secure communication in the "Start value" column. Enter the
certificate ID of the CA certificate of the communication partner, for example, for
"TLSServerCertRef".
– "ActivateSecureConn": Activation of secure communication for this connection. If this
parameter has the value FALSE, the subsequent security parameters are irrelevant. You
can set up a non-secure TCP or UDP connection in this case.
– "TLSServerCertRef": Reference to the X.509 V3 (CA) certificate of the mail server, which
is used by the TLS client to validate the authentication of the mail server.
5. Create a TMAIL_C instruction in the program editor.
6. Interconnect the MAIL_ADDR_PARAM parameter of the TMAIL_C instruction with the tag
of the data type TMAIL_V4_SEC.
In the following example the MAIL_ADDR_PARAM parameter of the TMAIL_C instruction is
interconnected with the tag "MailConnectionSEC" (data type TMAIL_V4_SEC).
Setting up a secure connection to a mail server over the interface of a communication module
For secure communication to a mail server over a communication module, you need to create
a data block with one of the system data types TMAIL_V4_SEC, TMAIL_QDN_SEC or
TMAIL_V6_SEC yourself, assign parameters and call it directly at the TMAIL_C instruction.
Requirements:
• TMAIL_C instruction with version V4.0
• S7-1500 CPU as of firmware version V2.0 with communication module CP 1543‑1 as of
firmware version V2.0
• ET 200SP CPU as of firmware version V2.0 with communication module CP 1542SP‑1 (IRC)
as of firmware version V1.0
• You have assigned all the CA certificates of the mail server (TLS server) to the CP (TLS
client) and have downloaded the configuration to the CPU.
• Current date and time are set in the CPU.
The STEP 7 online help describes how to set up a secure connection to a mail server over the
interface of a communication module.
Communication
106 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Application example
This application example (https://support.industry.siemens.com/cs/ww/en/view/46817803)
show how you can use the CP of an S7-1500 or S7-1200 station to set up a secure connection
to an email server and send an email with the default application "TMAIL_C" from the S7 CPU.
Additional information
You can find more information about the system data types TMail_V4_SEC and
TMAIL_QDN_SEC in the STEP 7 online help.
For additional information on secure communication, refer to the section Secure
Communication (Page 52).
With the central components of the TIA Portal, STEP 7 and WinCC, an innovative and
standardized Secure PG/PC and HMI Communication - PG/HMI communication for short - is
implemented starting with version V17 together with the latest controllers and latest HMI
devices.
The following CPU families are referred to in detail:
• S7-1500 controller family as of firmware version V2.9
• S7-1200 controller family as of firmware version V4.5
• Software controllers as of firmware version V21.9
• SIMATIC Drive controllers as of firmware version V2.9
• PLCSim and PLCSim Advanced Version V4.0
HMI components have also been updated to support Secure PG/HMI Communication:
• Panels or PCs configured with WinCC Basic, Comfort and Advanced
• PCs with WinCC RT Professional
• WinCC Unified PCs and Comfort Panels
Also updated are SINAMICS RT SW as of version V6.1 and STARTDRIVE as of version V17.
Communication
Function Manual, 11/2024, A5E03735815-AM 107
Communications services
5.6 Secure Communication
With TIA Portal version V14, the "Open User Communication" procedure for communication
based on user programs has already been extended by the "Secure Open User
Communication" variant. Other certificate-based communication mechanisms have become
established (HTTPS, Secure SMTP over TLS or OPC UA). As of TIA Portal Version V17, PG/HMI
communication has also been upgraded: Here, too, the TLS (Transport Layer Security)
protocol is used to secure PG/HMI communication using standardized security mechanisms.
WARNING
Without password, weak protection of private keys
Note that without a password to protect trusted configuration data, the private keys for
certificates required for secure communication are only weakly protected.
More information
An overview of how to protect confidential configuration data can be found in section
Protection of confidential configuration data (Page 77).
Communication
108 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Procedure
1. In the CPU properties, navigate to the area "Protection & Security > Connection
mechanisms".
2. Select the option you want to use.
Procedure
If you want to have a new certificate generated by the TIA Portal or if you want to select
another existing certificate:
1. In the "PLC communication certificate" field, click the three points to expand the field.
2. Select the certificate you want or click the "Add" button.
3. When adding a certificate, a dialog appears with setting options for the certificate.
The purpose is set to "TLS server", you can change other parameters (such as name, hash
algorithm).
The general rules for certificate management apply. For example, if you want to generate a
CA certificate, the option "Global settings for the certificate manager" must be selected. You
also have the option of generating a self-signed PLC certificate.
More information
Basic information on the subject of certificate management can be found in section
Certificate management with TIA Portal (Page 65).
Communication
Function Manual, 11/2024, A5E03735815-AM 109
Communications services
5.6 Secure Communication
The certificate-based PG/PC communication (Secure PG/PC communication) means that the
communication partner of the CPU – the programming device with installed TIA Portal – must
trust the device certificate of the CPU so that a connection can be loaded.
To put it simply, from the TIA Portal perspective you have the following options to trust the
certificate of a CPU:
• The PG with TIA Portal is in possession of the device certificate of the CPU because it was,
for example, created or imported in the project. In this case, the certificate check runs
automatically and without prompting.
• The PG with TIA Portal is not in possession of the device certificate of the CPU, because the
CPU was determined via "Accessible stations", for example, and is not available in the
project. In this case, the TIA Portal asks the TIA Portal user whether the certificate can be
trusted. This may be possible only with great effort because the CPU is not in sight, for
example, and the authenticity can therefore not be checked immediately.
• The PG with TIA Portal is in possession of the CA certificate (certification authority) and all
CPUs that can be reached in the network from the TIA Portal have device certificates
issued by this CA certificate.
Advantage of this solution: TIA Portal can check device certificates automatically, even if
the device certificates of the communication partners are not available in TIA Portal.
The solution with a CA certificate (certification authority) is explained in more detail below.
Requirement
You can use the certification authority of the TIA Portal to create device certificates for a CPU
and use the existing CA certificates to sign the device certificates. However, you can also
import another certification authority into TIA Portal and use it.
Enabling the global security policies for the certificate manager is a requirement. Only with
this setting you can generate CA-signed certificates.
See also here: Certificate management with TIA Portal (Page 65)
Communication
110 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
Adding device certificates to the TIA Portal certificate revocation list (CRL)
You have the option to add individual device certificates to a certificate revocation list (CRL),
for example, because the associated key is no longer considered secure.
When the TIA Portal establishes a connection to a CPU whose device certificate is in the
certificate revocation list, a dialog appears in the TIA Portal asking whether you still want to
trust the certificate. If you decline, the connection will not be established.
To add a device certificate to the certificate revocation list, follow these steps:
1. Copy the device certificate to the following directory:
C:\ProgramData\Siemens\Automation\Certstore\CRL
2. Start TIA Portal.
In the "Info" tab of the Inspector window, a message appears for each certificate which
provides information about whether the certificate could be successfully transferred to the
CRL store of TIA Portal.
However, no detailed causes are output in case of failure.
Communication
Function Manual, 11/2024, A5E03735815-AM 111
Communications services
5.6 Secure Communication
To ensure that communication between the CPU and a programming device or HMI device is
secure, it must first have a certificate. However, the certificate for productive operation is
only issued when the project is loaded into the CPU.
To ensure that the initial loading is also secured, the CPU first creates a self-signed certificate.
The following description explains the different phases of establishing a connection.
Communication
112 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
5*"
1PSUBM
$POOFDUJPOFTUBCMJTINFOU $16JTOPUDPOHVSFE
3FRVFTU
(FOFSBUFETFMGTJHOFEDFSUJDBUF
TFOUJOSFTQPOTFUPDPOOFDUJPO
FTUBCMJTINFOUSFRVFTU
.BOVBMDPOSNBUJPO
USVTUJOTFMGTJHOFEDFSUJDBUF
TJODFOPBVUPNBUJDBVUIFOUJDJUZ
DIFDLJTQPTTJCMF
1SPKFDUEBUB *NQMJDJUMZDPOHVSFE
$16DFSUJDBUFGPS1().*
DPNNVOJDBUJPOJTMPBEFE
WARNING
Potential security risks during commissioning
During commissioning, the CPU provides a manufacturer device certificate (if available) or a
self-signed certificate that you must trust in order to establish a connection. Only trust this
certificate if the programming device and the CPU are in a protected network and are directly
connected to each other. In an unprotected environment, these certificates can be
manipulated and allow attackers to access the communication between the programming
device/HMI and CPU (e.g. through man-in-the-middle attacks).
Communication
Function Manual, 11/2024, A5E03735815-AM 113
Communications services
5.6 Secure Communication
5*"
1PSUBM
$POOFDUJPOFTUBCMJTINFOU $16JTDPOHVSFE
SFRVFTU
$FSUJDBUFJTBVUPNBUJDBMMZ -PBEFE$16DFSUJDBUFGPS1().*
BDDFQUFE LOPXOGSPN DPNNVOJDBUJPOJTTFOUJO
DPOHVSBUJPO SFTQPOTF
As of TIA Portal version V17, the CPU and the HMI device communicate via secure HMI
communication if both devices meet the requirements for this type of communication.
The basis of secure HMI communication is that the HMI device can verify the authenticity of
the CPU, using the PLC communication certificate that the CPU sends when establishing
communication, and considers the CPU to be "trustworthy". Secure HMI communication is
only possible when this turns out to be the case.
This section describes the measures you must take for the various HMI devices to manually
label the PLC communication certificate as "trustworthy".
Requirement
• CPU and HMI device support secure HMI communication.
• A current project is available on the CPU (TIA Portal V17 and higher).
Communication
114 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
NOTE
Without an alarm view you cannot identify the errors during connection establishment.
2. Configure the CPU with the required security settings. Select a PLC communication
certificate to protect the HMI connection or have the TIA Portal generate a PLC
communication certificate.
3. Configure the HMI connection between the CPU and the HMI device.
4. Download the project to the CPU and the HMI device. During the project transfer, the PLC
communication certificate and, if necessary, a CA (Certificate Authority) certificate is
transferred to the CPU and the HMI device.
NOTE
Updating and loading the CPU configuration requires reloading into the HMI device
If you change the CPU configuration and this change causes a change to the PLC
communication certificate (e.g. when changing the IP address of an interface), you must
also reload the PLC communication certificate of the connected HMI device.
Otherwise, communication between the HMI device and CPU is not possible.
Communication
Function Manual, 11/2024, A5E03735815-AM 115
Communications services
5.6 Secure Communication
As of TIA Portal version V17, the TIA Portal and the S7‑1200/S7‑1500 CPU as of firmware
version V4.5/V2.9 automatically communicate "securely" - the connection partners set their
connection mechanisms automatically to the highest possible security method.
Only special circumstances (see Information about compatibility (Page 117)) cause a fallback
to the old PG/PC communication, called "Legacy PG/PC communication".
There may be some cases in which the higher security is not desirable because it can impact
the transmission rate of CPUs with weak communication performance.
Requirement
• There may be no online connections to the CPUs.
• For CPUs that are to be reached online, the option "Only permit secure PG/PC and HMI
communication" must be disabled (CPU parameters in the area "Connection
mechanisms").
• The communication partners are in a protected environment, for example, during the
commissioning phase.
Communication
116 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.6 Secure Communication
The following description provides information about the interaction between different TIA
Portal versions with different CPU firmware versions and the effects on the type of PG/HMI
connection.
Communication
Function Manual, 11/2024, A5E03735815-AM 117
Communications services
5.6 Secure Communication
In summary ("PG" here stands for a programming device with TIA Portal):
• PG/HMI and CPU come with the V17 (or subsequent version): TLS procedure is used.
• PG/HMI comes from a predecessor version (< V17): Legacy procedure is used - provided
that you have deactivated the option "Only allow secure PG/PC and HMI communication"
in the CPU properties.
• CPU comes with V17 (or higher), several PGs/HMIs are connected and come from both
V17 (or higher) and previous versions: TLS + legacy procedures are used - provided that
you have deactivated the option "Only allow secure PG/PC and HMI communication" in the
CPU properties.
More information
Information on device or firmware-specific features such as the TLS version used can be
found in section Device-dependent security features (Page 55).
Communication
118 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.7 SNMP
5.7 SNMP
NOTE
If SNMP is deactivated for a device, various options for diagnostics of the network topology
(for example, using the PRONETAtool) are no longer available to you.
Example: For the topology comparison Online-Offline, the TIA Portal determines which ports
are actually connected and uses SNMP for this function.
NOTE
Replacement part scenario
For compatibility reasons, an S7-1500 CPU as of firmware version V3.0 with a loaded
predecessor project (CPU firmware < V3.0) behaves like the CPU in the predecessor project:
SNMP is activated and "public" and "private" community strings are in effect.
Communication
Function Manual, 11/2024, A5E03735815-AM 119
Communications services
5.7 SNMP
Configuring SNMP
As of CPU firmware version V3.0 and TIA Portal version V18, you can change the following
settings for SNMP in the CPU properties:
• Activate SNMP (default: deactivated)
• Read-only community string (default: "public")
• Read-write community string (default: "private")
You can find the settings in the "Advanced configuration > SNMP" area.
As of CPU firmware version V3.1 and TIA Portal version V19, you can additionally enable
write-protected access for SNMP when SNMP is activated.
Communication
120 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.7 SNMP
Communication
Function Manual, 11/2024, A5E03735815-AM 121
Communications services
5.7 SNMP
Introduction
You need to activate the SNMP for a CPU 1516‑3 PN/DP to manage your network
infrastructure, CPUs and IO devices with SNMP. The example below shows the 0xB071 data
record being transferred to a PROFINET interface for this purpose.
Requirement
• CPU 1516‑3 PN/DP as of FW version V2.0
• STEP 7 version V14 or higher
Solution
Transfer the data record 0xB071 to a PROFINET interface of the CPU. As a result, SNMP is
enabled in all PROFINET interfaces of the CPU.
The following example shows how you can create the data record in a global data block and
transfer it in a program cycle OB (for example, OB1) to the PROFINET interface
(Local~PROFINET_interface_1).
To activate SNMP for the addressed PROFINET interface of the CPU 1516‑3 PN/DP, follow
these steps:
1. Create a global data block.
2. Assign a name, for example, "ActivateSnmp".
3. Under "Static", create the structure of the 0xB071 data record (in the figure:
"snmpRecord") and other variables for transferring the data record. The following figure
shows the data block structure "ActivateSnmp".
4. Transfer the 0xB071 data record in an OB program cycle (for example, OB1), with the
"WRREC" (write data record) instruction to the CPU 1516‑3 PN/DP. You can find an example
program in the next section.
Communication
122 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.7 SNMP
Communication
Function Manual, 11/2024, A5E03735815-AM 123
Communications services
5.7 SNMP
NOTE
Transferring the data record to the backup CPU
Transfer the data record to the addressed PROFINET interface of the backup CPU only after
the S7‑1500R/H system has reached the "Run REDUNDANT" system state. Otherwise, the data
record cannot be transferred to the addressed PROFINET interface of the backup CPU.
When the S7‑1500R/H system has reached the system state "Run REDUNDANT", the CPU
redundancy error OB (OB72) is started. The "Fault_ID" tag of the OB72 contains the error code
"B#16#03" or "B#16#06".
Communication
124 Function Manual, 11/2024, A5E03735815-AM
Communications services
5.7 SNMP
4. Add the organization block "CPU redundancy error" (OB72) to your user program. You can
find an example program for the OB72 in the next section.
5. Open the program cycle OB (OB1).
6. In the OB1, carry out two "WRREC" instructions for transferring the data record to the
respective addressed PROFINET interface of both the CPUs. You can find an example
program for the OB1 in the next section.
Result: The 0xB071 data record was transferred to the PROFINET interface of both the
CPUs addressed in each case.
Open the program cycle OB (OB1). With the following program code, you can run 2 "WRREC"
instructions for transferring the data record to the respective addressed PROFINET interface of
both the CPUs:
//-----------------------------------------
// Start writing SNMP settings
//-----------------------------------------
IF "ActivateSnmp".snmpWrite THEN
IF (NOT "ActivateSnmp".plcLeft.snmpWrDone)
AND (NOT "ActivateSnmp".plcLeft.snmpWrError) THEN
// write SNMP settings for the left PLC
"instWrrec_1"(REQ := "ActivateSnmp".snmpWrite,
ID := "Local1~PROFINET_interface_1",
INDEX := 16#B071,
DONE => "ActivateSnmp".plcLeft.snmpWrDone,
ERROR => "ActivateSnmp".plcLeft.snmpWrError,
STATUS => "ActivateSnmp".plcLeft.snmpWrStatus,
RECORD := "ActivateSnmp".snmpRecord);
END_IF;
IF "ActivateSnmp".plcLeft.snmpWrError THEN
; // add error handling for left plc
END_IF;
IF (NOT "ActivateSnmp".plcRight.snmpWrDone)
AND (NOT "ActivateSnmp".plcRight.snmpWrError) THEN
// write SNMP settings for the right PLC
"instWrrec_2"(REQ := "ActivateSnmp".snmpWrite,
ID := "Local2~PROFINET_interface_1",
INDEX := 16#B071,
DONE => "ActivateSnmp".plcRight.snmpWrDone,
ERROR => "ActivateSnmp".plcRight.snmpWrError,
STATUS =>
"ActivateSnmp".plcRight.snmpWrStatus,
RECORD := "ActivateSnmp".snmpRecord);
END_IF;
Communication
Function Manual, 11/2024, A5E03735815-AM 125
Communications services
5.7 SNMP
IF "ActivateSnmp".plcRight.snmpWrError THEN
; // add error handling for right plc
END_IF;
IF "ActivateSnmp".plcLeft.snmpWrDone
AND "ActivateSnmp".plcRight.snmpWrDone THEN
"ActivateSnmp".snmpWrite := FALSE;
END_IF;
END_IF;
Communication
126 Function Manual, 11/2024, A5E03735815-AM
PG communication 6
Properties
Using PG communication, the CPU or another module capable of communication exchanges
data with an engineering station (for example PG, PC). The data exchange is possible via
PROFIBUS and PROFINET subnets. The gateway between S7 subnets is also supported.
PG communication provides functions needed to load programs and configuration data, run
tests, and evaluate diagnostic information. These functions are integrated in the operating
system of the module capable of communication.
NOTE
As of TIA Portal version V17, the TLS (Transport Layer Security) protocol is supported for
programming device/HMI communication to secure the data exchange between
programming device/PC and CPU using standardized security mechanisms.
For more information, refer to the following sections:
• Requirements for secure communication (Page 77)
• Secure PG/HMI communication (Page 107)
Requirements
• The PG/PC is physically connected to the communication-capable module.
• If the communication-capable module is to be reached via S7 routing, the hardware
configuration has to be loaded in the participating stations (S7 router and end point).
Communication
Function Manual, 11/2024, A5E03735815-AM 127
PG communication
More information
You can find more information on "Go online" in the STEP 7 online help.
Communication
128 Function Manual, 11/2024, A5E03735815-AM
HMI communication 7
Properties
Using HMI communication, one or more HMI devices (for example HMI Basic/Comfort/Mobile
Panel) exchanges data with a CPU for operator control and monitoring with via the PROFINET
or PROFIBUS DP interface. The data exchange is via HMI connections.
If you want to set up several HMI connections to a CPU, use for example:
• The PROFINET and PROFIBUS DP interfaces of the CPU
• CPs and CMs with the relevant interfaces
NOTE
As of TIA Portal version V17, the TLS (Transport Layer Security) protocol is supported for
programming device/HMI communication to secure the data exchange between
programming device/PC and CPU using standardized security mechanisms.
For more information, refer to the following sections:
• Requirements for secure communication (Page 77)
• Secure PG/HMI communication (Page 107)
Communication
Function Manual, 11/2024, A5E03735815-AM 129
HMI communication
More information
You can find information on S7 routing for HMI connections in the section S7 Routing (Page
401).
You can find more information on setting up HMI connections in the STEP 7 online help.
Communication
130 Function Manual, 11/2024, A5E03735815-AM
Open User Communication 8
8.1 Overview of Open User Communication
Information on S7‑1500R/H
You can find information on Open User Communication with the S7‑1500R/H redundant
system in section Communication with the redundant system S7-1500R/H (Page 433).
Communication
Function Manual, 11/2024, A5E03735815-AM 131
Open User Communication
8.2 Protocols for Open User Communication
Communication
132 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.2 Protocols for Open User Communication
Modbus TCP
The Modbus protocol is a communication protocol with linear topology based on a
master/slave architecture. In the Modbus TCP (Transmission Control Protocol), the data is
transmitted as TCP/IP packets.
Communication is controlled solely by suitable instructions in the user program.
Communication
Function Manual, 11/2024, A5E03735815-AM 133
Open User Communication
8.3 Instructions for Open User Communication
See also
SYSLOG (https://support.industry.siemens.com/cs/ww/en/view/51929235)
Introduction
You set up Open User Communication via the corresponding connection (for example, TCP
connection) as follows:
• By programming in the user programs of the communications partners or
• By configuring the connection in STEP 7 in the hardware and network editor
Regardless of whether you set up the connection by programming or configuring,
instructions are always required in the user programs of both communications partners for
sending and receiving the data.
Communication
134 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.3 Instructions for Open User Communication
You can modify the connection parameters in the "connection description DB".
This FAQ (https://support.industry.siemens.com/cs/ww/en/view/58875807) describes how to
program the TCON instruction to set up a connection for Open User Communication between
two S7-1500 CPUs.
Protocols, system data types and employable instructions for programmed setup
The following table shows the protocols of the Open User Communication and the matching
system data types and instructions.
Communication
Function Manual, 11/2024, A5E03735815-AM 135
Open User Communication
8.3 Instructions for Open User Communication
The following table shows you the different connections of the Secure Open User
Communication and the matching system data types and instructions.
Communication
136 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.3 Instructions for Open User Communication
More information
The STEP 7 online help describes:
• The user and system data types
• The instructions for open communication
• The connection parameters
You will find information about the allocation and release of connection resources in the
section Allocation of connection resources (Page 421).
Information about the Secure Open User Communication is available in the section Secure
Open User Communication (Page 90).
Communication
Function Manual, 11/2024, A5E03735815-AM 137
Open User Communication
8.4 Open User Communication with addressing via domain names
Figure 8-1 Entering DNS server addresses using a CPU 1516‑3 PN/DP as an example
Communication
138 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.4 Open User Communication with addressing via domain names
Setting up a TCP connection via the domain name of the communication partner
For TCP communication via the domain name you need to create a data block with the
TCON_QDN system data type yourself, assign parameters and call it directly at the instruction.
The TCON, TSEND_C and TRCV_C instructions support the system data type TCON_QDN:
To set up a TCP connection via the domain name of the communication partner, follow these
steps:
1. Create a global data block in the project tree.
2. Define a tag of the data type TCON_QDN in the global data block.
The example below shows the global data block "Data_block_1" in which the tag
"DNS Connection1" of data type TCON_QDN is defined.
3. Program the parameters of the TCP connection (for example the fully qualified domain
name (FQDN)) in the tag of data type TCON_QDN.
4. Create a TCON instruction in the program editor.
5. Interconnect the CONNECT parameter of the TCON instruction with the tag of the data
type TCON_QDN.
In the example below, the CONNECT parameter of the TCON instruction is interconnected
with the tag "DNS connection1" (data type TCON_QDN).
Communication
Function Manual, 11/2024, A5E03735815-AM 139
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
Addressing a UDP connection via the domain name of the communication partner
For S7-1500 CPUs as of firmware version V2.0, you can address the recipient with its fully
qualified domain name (FQDN) when sending data via UDP. With the instruction TUSEND at
the parameter ADDR, you hereby reference a structure of the type TADDR_SEND_QDN.
The receiver can return an IPv4 or an IPv6 address. With the TURCV instruction at the ADDR
parameter, you therefore reference a structure of the TADDR_RCV_IP type. Only this structure
can include both IP address types.
NOTE
Network load
In contrast to the TCP the UDP protocol does not work connection-oriented. For every edge at
the block parameter REQ, the TUSEND or TURCV command performs queries of the DNS
server. This can lead to high network load or load on the DNS server.
Additional information
You can find more information about the system data types TCON_QDN, TADDR_SEND_QDN
and TADDR_RCV_IP in the STEP 7 online help.
How to set up a secure TCP connection via the domain name of the communication partner is
described in the section Secure Open User Communication (Page 90).
Communication
140 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
4. In the drop-down list box of the partner end point, select a connection partner. You can
select an unspecified device or a CPU in the project as the communication partner. Certain
connection parameters are then entered automatically.
The following parameters are set:
– Name of the partner end point
– Interface of the partner end point
– IPv4 address of the partner end point
If the connection partners are networked, the name of the subnet is displayed.
5. In the "Configuration type" drop-down list, select between using program blocks or
configured connections.
Communication
Function Manual, 11/2024, A5E03735815-AM 141
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
6. Select an existing connection description DB in the "Connection data" drop-down list or for
configured connections select an existing connection under "Connection name". You can
also create a new connection description DB or a new configured connection. Later, you
can still select other connection description DBs or configured connections or change the
names of the connection description DBs in order to create new data blocks:
– You can also see the selected data block at the interconnection of the CONNECT input
parameter of the selected TCON, TSEND_C or TRCV_C instruction.
– If you have already specified a connection description DB for the connection partner
using the CONNECT parameter of the TCON, TSEND_C or TRCV_C instruction, you can
either use this DB or create a new DB.
– If you edit the name of the displayed data block in the drop-down list, a new data block
with the changed name but with the same structure and content is generated and
used for the connection.
– Changed names of a data block must be unique in the context of the communication
partner.
– A connection description DB must have the structure TCON_Param, TCON_IP_v4 or
TCON_IP_RFC, depending on CPU type and connection.
– A data block cannot be selected for an unspecified partner.
Additional values are determined and entered after the selection or creation of the
connection description DB or configured connection.
The following is valid for specified connection partners:
– ISO-on-TCP connection type
– Connection ID with default of 1
– Active connection establishment by local partner
– TSAP ID
for S7-1200/1500: E0.01.49.53.4F.6F.6E.54.43.50.2D.31
The following is valid for unspecified connection partners:
– TCP connection type
– Partner port 2000
The following applies for a configured connection with a specified connection partner:
– TCP connection type
– Connection ID with default of 257
– Active connection establishment by local partner
– Partner port 2000
The following applies for a configured connection with an unspecified connection partner:
– TCP connection type
– Local port 2000
Communication
142 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
NOTE
You must enter a unique value for the connection ID at a known connection partner. The
uniqueness of the connection ID is not checked by the connection parameter settings and
there is no default value entered for the connection ID when you create a new
connection.
8. Select the desired connection type in the relevant drop-down list. Default values are set
for the address details depending on the connection type. You can choose between the
following:
– TCP
– ISO-on-TCP
– UDP
– ISO (only with Configuration mode "Use configured connection")
You can edit the input boxes in the address details. Depending on the selected protocol,
you can edit the ports (for TCP and UDP) or the TSAPs (for ISO-on-TCP and ISO).
9. Use the "Active connection establishment" check box to set the connection establishment
characteristics for TCP, ISO and ISO-on-TCP. You can decide which communication partner
establishes the connection actively.
Changed values are checked immediately for input errors by the connection configuration
and entered in the data block for the connection description.
NOTE
Open User Communication between two communication partners can only work when the
program section for the partner end point has been downloaded to the hardware. To achieve
fully functional communication, make sure that you load not only the connection description
of the local CPU on the device but also that of the partner CPU as well.
Communication
Function Manual, 11/2024, A5E03735815-AM 143
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
Based on the procedure described above, set up the connection on the partner CPU with the
instruction for receiving, TRCV, and download it to the CPU.
Communication
144 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.6 Setting up communication over FDL
Additional information
The STEP 7 online help describes:
• The instructions for open communication
• The connection parameters
This FAQ (https://support.industry.siemens.com/cs/ww/en/view/109479564) describes how
the instructions TSEND_C and TRCV_C behave in the S7-1500.
Requirements
• Configuration software: STEP 7 Professional V14
• End point of the connection: CPU S7-1500 firmware version V2.0 or higher with
communication module CM 1542‑5 with firmware version V2.0
Communication
Function Manual, 11/2024, A5E03735815-AM 145
Open User Communication
8.6 Setting up communication over FDL
3. Program the parameters of the FDL connection (e.g. the PROFIBUS addresses) in the tag of
the data type TCON_FDL.
4. Create a TCON instruction in the program editor.
Communication
146 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.7 Setting up communication with Modbus TCP
5. Interconnect the CONNECT parameter of the TCON instruction with the tag of the data
type TCON_FDL.
In the example below, the CONNECT parameter of the TCON instruction is interconnected
with the tag "FDL_Connection" (data type TCON_FDL).
Communication
Function Manual, 11/2024, A5E03735815-AM 147
Open User Communication
8.7 Setting up communication with Modbus TCP
4. Assign the parameters of the MB_CLIENT or MB_SERVER instruction. Observe the following
rules:
An IPv4 server address must be specified for each MB_CLIENT connection.
Each MB_CLIENT or MB_SERVER connection must use a unique instance DB with one of the
data structures TCON_IP_v4, TCON_QDN or TCON_Configured.
Each connection requires a unique connection ID. The connection ID and instance DB
belong together in pairs and must be unique for each connection.
Communication
148 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.7 Setting up communication with Modbus TCP
Reference
• This FAQ (https://support.industry.siemens.com/cs/ww/en/view/94766380) describes how
to program and configure the Modbus TCP communication between two S7-1500 CPUs.
• This FAQ (https://support.industry.siemens.com/cs/ww/en/view/102020340) describes
how to program and configure Modbus TCP communication between an S7-1500 CPU and
an S7-1200 CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 149
Open User Communication
8.8 Setting up communication via e-mail
NOTE
Connection parameter Interface ID
Note that you can enter the value "0" for the interface ID with instruction version V5.0 or
higher of the instruction TMAIL_C in the data type TMAIL_V4_SEC. In this case, the CPU
itself searches for a suitable local CPU interface.
Additional information
The STEP 7 online help describes:
• The system data types
• The instructions for open communication
• The connection parameters
Communication
150 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.9 Setting up communication via FTP
Communication
Function Manual, 11/2024, A5E03735815-AM 151
Open User Communication
8.9 Setting up communication via FTP
Communication
152 Function Manual, 11/2024, A5E03735815-AM
Open User Communication
8.9 Setting up communication via FTP
Application examples
• Application example: FTP communication with S7-1500 and CP 1543-1
You can find the application example on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/103550797).
• Application example: FTP client communication with S7-1200/1500
You can find the application example on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/81367009).
Additional information
The STEP 7 online help describes:
• The system data types
• The instructions for open communication
• The connection parameters
Communication
Function Manual, 11/2024, A5E03735815-AM 153
Open User Communication
8.10 Establishment and termination of communications relations
Communication
154 Function Manual, 11/2024, A5E03735815-AM
S7 communication 9
Characteristics of S7 communication
S7 communication as homogeneous SIMATIC communication is characterized by vendor-
specific communication between SIMATIC CPUs (not an open standard). S7 communication is
used for migration and for connecting to existing systems (S7‑300, S7‑400).
For data transfer between two S7‑1500 automation systems, we recommend that you use
open communication (see section Open User Communication (Page 131)).
Properties of S7 communication
Using S7 communication, the CPU exchanges data with another CPU. Once the user has
received the data at the receiver end, the reception data is automatically acknowledged to
the sending CPU.
The data is exchanged via configured S7 connections. S7 connections can be configured at
one end or at both ends.
S7 communication is possible via:
• Integrated PROFINET or PROFIBUS DP interface of a CPU
• Interface of a CP/CM
Communication
Function Manual, 11/2024, A5E03735815-AM 155
S7 communication
NOTE
Data blocks for PUT/GET instructions
When using the PUT/GET instructions, you can only use data blocks with absolute
addressing. Symbolic addressing of data blocks is not possible.
You must also enable this service for protection in the CPU configuration in the
"Protection" area.
Communication
156 Function Manual, 11/2024, A5E03735815-AM
S7 communication
Communication
Function Manual, 11/2024, A5E03735815-AM 157
S7 communication
4. In the drop-down list box of the partner end point, select a connection partner. You can
select an unspecified device or a CPU in the project as the communication partner.
The following parameters are automatically entered as soon as you have selected the
connection partner:
– Name of the partner end point
– Interface of the partner end point. If several interfaces are available, you can change
the interface as required.
– Interface type of the partner end point
– Subnet name of both end points
– IPv4 address of the partner end point
– Name of the connection which is used for the communication.
Communication
158 Function Manual, 11/2024, A5E03735815-AM
S7 communication
5. If required, change the connection name in the "Connection name" input box. If you want
to create a new connection or edit an existing connection, click on the "Select connection"
button on the right side next to the input box for the connection name.
NOTE
The PUT and GET instructions between two communication partners can only run if both
the hardware configuration and the program part for the partner end point have been
loaded into the hardware. To achieve fully functional communication, make sure that you
load not only the connection description of the local CPU on the device but also that of
the partner CPU as well.
Communication
Function Manual, 11/2024, A5E03735815-AM 159
S7 communication
Communication
160 Function Manual, 11/2024, A5E03735815-AM
S7 communication
5. Using drag-and-drop in our example, connect PLC_1 in the left S7 subnet (PROFIBUS) to
PLC_3 in the right S7 subnet (PROFINET).
The S7 connection between CPU 1 and CPU 3 is configured.
Communication
Function Manual, 11/2024, A5E03735815-AM 161
S7 communication
Additional information
You can find detailed information on configuring S7 connections and how to use the
instructions for S7 communication in the user program in the STEP 7 online help.
Communication
162 Function Manual, 11/2024, A5E03735815-AM
Point-to-point link 10
Functionality
A point-to-point connection for S7‑1500, ET 200MP and ET 200SP is established via
communications modules (CMs) with serial interfaces (RS232, RS422 or RS485):
• S7‑1500/ET 200MP:
– CM PtP RS232 BA
– CM PtP RS422/485 BA
– CM PtP RS232 HF
– CM PtP RS422/485 HF
• ET 200SP:
– CM PtP
The bidirectional data exchange via a point-to-point connection works between
communications modules or third-party systems or devices capable of communication. At
least 2 communication partners are required for communication ("point-to-point"). With
RS422 and RS485, more than two communications partners are possible.
Communication
Function Manual, 11/2024, A5E03735815-AM 163
Point-to-point link
Communication
164 Function Manual, 11/2024, A5E03735815-AM
Point-to-point link
Communication
Function Manual, 11/2024, A5E03735815-AM 165
Point-to-point link
Communication
166 Function Manual, 11/2024, A5E03735815-AM
Point-to-point link
Additional information
• You can find more detailed information on communication via point-to-point connections
and basics of serial data transmission in the function manual CM PtP communication mod
ule - Configurations for point-to-point connections
(https://support.industry.siemens.com/cs/us/en/view/59057093).
• You can find a description of how to use the instructions for point-to-point connections in
the user program in the STEP 7 online help.
• You can find information about the communications modules with a serial interface in the
manual of the particular communications module.
Communication
Function Manual, 11/2024, A5E03735815-AM 167
OPC UA communication 11
11.1 What you need to know about OPC UA
Communication
168 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2024, A5E03735815-AM 169
OPC UA communication
11.1 What you need to know about OPC UA
Scalability
OPC UA can be used for devices of different performance classes:
• Sensors
• Embedded systems
• Controllers
• PC systems
• Smartphones
• Servers running MES or ERP applications.
The performance class of the devices is differentiated by profiles. Different OPC UA profiles
offer the possibility to scale OPC UA for very small and simple devices as well as for very high-
performance devices.
An OPC UA profile describes functions and services that must be supported by the server and
client. In addition, other functionalities/services that are not required by the profile can be
optionally provided.
OPC UA profiles differ from PROFINET profiles; the latter define additional cross-vendor
properties and behavior for installations and systems in the sense of a vendor-neutral
software interface.
Communication
170 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Type-instance concept
OPC UA offers a fully networked (full-meshed network), object-oriented information model
for namespaces, including metadata for the object description. Any object structures can be
generated via referencing of the instances among each other and their types. Because servers
disclose their instance and type systems, clients can navigate through this network and
obtain all the information they need. Both instances and their type definitions are available in
runtime.
Procedures or concepts on how to handle references to types are optimized over time. These
optimizations lead to new versions of the OPC UA Specification (e.g. V1.03 => V1.04).
Communication
Function Manual, 11/2024, A5E03735815-AM 171
OPC UA communication
11.1 What you need to know about OPC UA
More information
You can find more information on the website of the OPC Foundation
(https://opcfoundation.org).
Communication
172 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2024, A5E03735815-AM 173
OPC UA communication
11.1 What you need to know about OPC UA
Communication
174 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
1 2
S7-1500 CP 1543-1
4 5 4
3
Communication
Function Manual, 11/2024, A5E03735815-AM 175
OPC UA communication
11.1 What you need to know about OPC UA
OPC UA Server
OPC UA Client
Figure 11-2 Example: Access of OPC UA clients to the OPC UA server of the CPU
Communication
176 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Example: Access of OPC UA clients to OPC UA servers via S7-1500 CPU with activated IP
Forwarding
OPC UA client and OPC UA server can also be connected to one another via an S7-1500 CPU,
in which case the S7-1500 CPU operates as an IP Forwarder. This configuration option allows
for flexible expansion of existing systems.
S7-1500 CP 1543-1
Figure 11-3 Example: Access of OPC UA clients to OPC UA servers via S7-1500 CPU with activated IP Forwarding
More information
More information on access options via the virtual interface and via IP forwarding can be
found in the following sections:
• IP forwarding (Page 405)
• Virtual interface for IP-based applications (Page 414)
Communication
Function Manual, 11/2024, A5E03735815-AM 177
OPC UA communication
11.1 What you need to know about OPC UA
Node ID (NodeId)
Nodes in the OPC UA address space are uniquely identified by a NodeId (Node Identifier).
The NodeId consists of an identifier, identifier type and a namespace index. Namespaces are
used to avoid naming conflicts.
The OPC Foundation has defined a wide range of nodes that provide information about the
given OPC UA server. These nodes can be found in the namespace of the OPC Foundation and
have the index 0.
The OPC Foundation also defines data types and tag types.
Namespace (Namespace)
In addition to the above-described namespace of the OPC Foundation, the namespace for
accessing CPU data is of interest: All the tags or methods of an S7‑1500 OPC UA server are
contained in the namespace (Namespace) of the standard server interface
"http://www.siemens.com/simatic-s7-opcua".
By default this namespace has the Index 3. The index may change later if additional
namespaces are inserted into the server or if existing ones are deleted. It is therefore
necessary for an OPC UA client to request the current index of the namespace (e.g.
"http://www.siemens.com/simatic-s7-opcua") from the server before reading or writing its
values.
The following figure shows an example of the result of such a request.
Communication
178 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Identifier
The Identifier corresponds to the name of the PLC tag in quotation marks. The quotation mark
is the only sign that is not permitted as part of a name in STEP 7. Quotation marks avoid
naming conflicts.
The following example reads the value of the "StartTimer" tag:
The Identifier can consist of several components. The individual components are then
separated by a dot.
The following example reads the "MyDB" array data block completely. This data block contains
an array with ten integer values. All ten values should be read in one pass. Therefore, "0:9" is
entered at the array range.
1RGH,G
1DPHVSDFHV 1DPHVSDFH,QGH[
1DPHVSDFH,QGH[DQG1DPHVSDFH
,GHQWLILHU7\SH VWULQJ
XUQ0\&RPSXWHU0\&RPSDQ\0\6HUYHU
XUQ0\&RPSDQ\8D6HUYHU0RGHO 1RGH,G
XUQ0\&RPSDQ\8D6HUYHU0RGHO 1DPHVSDFH,QGH[
,GHQWLILHU7\SH VWULQJ
,GHQWLILHU 0\7HPSHUDWXUH
Communication
Function Manual, 11/2024, A5E03735815-AM 179
OPC UA communication
11.1 What you need to know about OPC UA
Figure 11-4 PLC tags in the address space of the OPC UA server
Communication
180 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2024, A5E03735815-AM 181
OPC UA communication
11.1 What you need to know about OPC UA
11.1.6 Namespace overview for the OPC UA server of the S7-1200/1500 CPUs
As already written for the topic "Addressing of nodes", the namespace index is part of the
node ID. To ensure that a node ID is always unique in the address space, namespaces are
used in OPC UA; the BrowseName as the sole means of identifying a node can be ambiguous.
Namespaces are specified at OPC UA through different "Naming Authorities" which develop
the OPC UA information models, for example by a working group, the OPC Foundation or
organizations that develop standard information models.
Namespaces are identified through a namespace URI; the namespace URI identifies the
Naming Authority.
A namespace index is used to optimize accesses to the nodes of the server instead of the
namespace URI. The namespace index is a pointer to a namespace array that the server
manages. A client reads the namespace index once from the server to be able to access the
nodes of the server afterwards with a simple integer instead of a URI string.
The following table contains the assignment between namespace URIs and namespace
indexes of S7-1500 and S7-1200 CPUs.
Communication
182 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2024, A5E03735815-AM 183
OPC UA communication
11.1 What you need to know about OPC UA
For "Array Range" you specify which components of the array you want to overwrite. The
"Good" status code indicates that the values were transferred successfully. However, you can
only write the values to the S7-1500 but not the time stamps of these values. The time
stamps can only be read.
In accordance with the same scheme, the "RegisteredRead" function can also be used, which
is particularly useful for recurring data readouts. Take into account, however, that depending
on the application it may be advisable to use a Subscription instead.
Recommendation: It is best to place registrations in the startup program of the OPC UA client,
since the registration takes up time.
Communication
184 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.1 What you need to know about OPC UA
Please note that you can set the maximum number of registered nodes in the properties of
the S7-1500 CPU and that the Clients have to respect this number, see General settings of the
OPC UA server (Page 250).
Subscription
The term "Subscription" is used for a function in which only those tags for which an OPC UA
client has registered at the OPC UA server are transferred. The OPC UA server only sends a
message to the OPC UA client for these registered tags (monitored Items) when a value has
changed. The monitoring of these tags makes constant sampling by the OPC UA client
(Polling)superfluous, which reduces the network load.
You have to create a Subscription to use this function. For this purpose, you specify the
"Publishing Interval" at the UA client and click the "Create" button. The publishing interval is
the time interval in which the server sends new values to the client in a notification (data
change notification).
In the following example a subscription has been created: The client receives a message with
the new values (publishing interval 50 ms) every 50 milliseconds here.
Communication
Function Manual, 11/2024, A5E03735815-AM 185
OPC UA communication
11.2 Security at OPC UA
The "Voltage" tag contains the value of a voltage that is detected by an S7-1500 CPU.
The sampling interval ("Sampling Interval") contains a negative value (-1). This determines
that the default setting of the OPC UA server is used for the sampling interval. The default
setting is defined by the transmission interval ("Publishing Interval") of the subscription. If you
want to set the smallest possible sampling interval, select the value "0".
In this example, the length of the queue is set to "1": Only one value is read from the CPU at
an interval of 50 milliseconds and subsequently sent to the OPC UA client when the value has
changed.
The "Deadband" parameter in this example is "0.1": Changes in value have to amount to 0.1
Volt; only then does the sender send the new value to the client. The server does not send
smaller changes in value. You can use this parameter, for example, to disable signal noise:
Slight changes in a process variable which do not have a real meaning.
Addressing risks
OPC UA allows the exchange of data between different systems, both within the process and
production levels and to systems at the control and enterprise level.
This possibility also entails security risks. That is why OPC UA provides a range of security
mechanisms:
• Verification of the identity of OPC UA server and clients.
• Checking of the identity of the users.
• Signed/encrypted data exchange between OPC UA server and clients.
These security policies should only be bypassed in cases where it is absolutely necessary:
• During commissioning
• In stand-alone projects without external Ethernet connection
If you have selected the endpoint "None" for "UA Sample Client" of the OPC Foundation, for
example, the program issues a clear warning:
Communication
186 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
When STEP 7 compiles your project it also checks whether you have considered the setting
options for the protection and warns you of possible risks. This also includes an OPC UA
security policy with the setting "no security", which corresponds to the end point "None".
NOTE
Disabling security policies you do not want
If you have enabled all security policies in the secure channel settings of the S7-1500 OPC UA
server – thus, also the end point "None" (no security) – unsecured data traffic (neither signed
nor encrypted) between the server and client is also possible. The OPC UA server of the
S7-1500 CPU also sends its public certificate to the client at "None" (No security). And some
clients check this certificate. However, the client is not forced to send a certificate to the
server. The identity of the client may possibly remain unknown. Each OPC UA client can then
connect to the server irrespective of any subsequent security settings.
When configuring the OPC UA server, make sure that only security policies that are
compatible with the security concept of your machine or plant are selected. All other security
policies should be disabled.
Recommendation: Use the setting "Basic256Sha256 - Sign and Encrypt", which means that
the server only accepts Sha256 certificates. The security policies "Basic128Rsa15" and
"Basic256" are deactivated by default and should not be used as an end point. Select end
points with a higher security policy.
Communication
Function Manual, 11/2024, A5E03735815-AM 187
OPC UA communication
11.2 Security at OPC UA
Man-in-the-middle attacks
A "man-in-the-middle" could have positioned itself between server and client. A man-in-the-
middle is a program that intercepts communication between server and client and claims to
be a client or server, and is thus able to obtain information about the S7 program or to set
values in the CPU and attack a machine or plant.
OPC UA uses digital certificates that meet standard X.509 of the International
Telecommunication Union (ITU).
This allows the identity of a program, a computer or an organization to be proven
(authenticated).
X.509 certificates
An X.509 certificate includes the following information:
• Version number of the certificate
• Serial number of the certificate
• Information on the algorithm used by the certificate authority to sign the certificate.
• Name of the certificate authority
• Start and end of the validity period of the certificate
• Name of the program, person or organization for which/whom the certificate has been
signed by the certificate authority.
• The public key of the program, person or organization.
An X509 certificate thus links an identity (name of a program, person or an organization) to
the public key of the program, person or organization.
Communication
188 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
NOTE
The validity period stored in the certificate is also checked. The CPU clock must therefore be
set and date/time must be within the validity period, otherwise no communication takes
place.
Communication
Function Manual, 11/2024, A5E03735815-AM 189
OPC UA communication
11.2 Security at OPC UA
Signing
The signature makes it possible to prove the integrity and source of a message as detailed
below.
Signing starts with the sender creating a hash value from the plain text (plain text message).
The sender then encrypts the hash value with its private key and subsequently transfers the
plain text together with the encrypted hash value to the recipient. To verify the signature, the
recipient needs the public key of the sender (this is contained in the X509 certificate of the
sender). The recipient uses the sender's public key to decrypt the hash value received. The
recipient then forms the hash value themselves from the plain text received (the hash process
is contained in the sender's certificate). The recipient compares the two hash values:
• If the two hash values are identical, the plain text message has reached the receiver
unchanged and has not been manipulated.
• If the two hash values do not match, the plain text message has not reached the receiver
unchanged. The plain text message has been manipulated or has been distorted during
transfer.
Encryption
Encrypting data prevents unauthorized parties from reading the content. X509 certificates
are not encrypted; they are public and can be viewed by anyone.
Encryption involves the sender encrypting the plain text message with the public key of the
recipient. To do so, the sender requires the recipient's X509 certificate, as it contains the
public key of the recipient. The recipient decrypts the message with their private key. Only
the recipient can decrypt the message: They alone hold the private key. The private key must
therefore never be disclosed.
Communication
190 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Secure channel
OPC UA uses the private and public key of client and server to establish a secure connection,
the secure channel. Once the secure connection has been established, the client and server
generate an internal key only known to them which they both use for signing and encrypting
messages. This symmetric process (a shared key) is much faster than asymmetric processes
(private and public key).
More information
An application example for the use of certificates with the TIA Portal can be found here: Using
certificates with TIA Portal
(https://support.industry.siemens.com/cs/ww/en/view/109769068).
NOTE
The OPC UA server of the S7-1500 uses application certificates even for the security
setting "None" (no security). This ensures compatibility to OPC UA V1.1 and earlier
versions.
NOTE
Software certificates are not supported in STEP 7.
Communication
Function Manual, 11/2024, A5E03735815-AM 191
OPC UA communication
11.2 Security at OPC UA
NOTE
User certificates are not supported in STEP 7.
The described certificates are end-entity certificates: They identify, for example, a person, an
organization, a company or an instance (installation) of a software.
Communication
192 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
More information
For more information on handling client certificates, refer to the section Handling of the
client certificates of the S7-1500 CPU (Page 373).
Using OpenSSL
OpenSSL is a tool for Transport Layer Security that you can use to create certificates. You can
also use other tools, for example XCA, a type of key management software with a graphical
user interface for an improved overview of certificates issued.
To work with OpenSSL under Windows, follow these steps:
1. Install OpenSSL under Windows. If you are using a 64-bit version of the operating system,
install OpenSSL in the "C:\OpenSSL-Win64" directory, for example. You can obtain
OpenSSL-Win64 as a download from various providers for open source software.
2. Create a directory, for example "C:\demo".
3. Open the command prompt. To do so, click "Start" and enter "cmd" or "command prompt"
in the search field. Right-click "cmd.exe" in the results list and run the program as an
administrator. Windows opens the command prompt.
4. Change to the "C:\demo" directory. To do this, enter the following command: "cd
C:\demo".
5. Set the following network variables:
– set RANDFILE=c:\demo\.rnd
– set OPENSSL_CONF=C:\OpenSSL-Win64\bin\openssl.cfg
The figure below shows the command line with the following commands:
6. Now start OpenSSL. If OpenSSL has been installed in the C:\OpenSSL-Win64 directory,
enter the following: C:\OpenSSL-Win64\bin\openssl.exe The figure below shows the
command line with the following command:
Communication
Function Manual, 11/2024, A5E03735815-AM 193
OPC UA communication
11.2 Security at OPC UA
7. Generate a private key. Save the key to the "myKey.key" file. The key in this example is
1024 bits long; for greater RSA security, use 2048 bits in practice. Enter the following
command: "genrsa -out myKey.key 2048" ("genrsa -out myKey.key 1024" in the example).
The figure below shows the command line with the command and the output of OpenSSL:
8. Generate a CSR (Certificate Signing Request). To do this, enter the following command:
"req -new -key myKey.key -out myRequest.csr". During execution of this command,
OpenSSL queries information about your certificate:
– Country name: for example "DE" for Germany, "FR" for France
– State or province name: for example "Bavaria".
– Location Name: for example "Augsburg".
– Organization Name: Enter the name of your company.
– Organizational Unit Name: for example "IT"
– Common Name: for example "OPC UA client of machine A"
– Email Address:
NOTE
Note for S7-1500 CPU as server with firmware version V2.5
The IP address of the client program has to be stored in the "Subject Alternative Name" field
of the created certificate for S7-1500 CPUs version V2.5 (only for this version); otherwise, the
CPU will not accept the certificate.
The information you enter is added to the certificate. The figure below shows the command
line with the command and the output of OpenSSL:
The command creates a file in the C:\demo directory containing the Certificate Signing
Request (CSR); in the example, this is "myRequest.csr".
Communication
194 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
The command generates an X.509 certificate with the attributes that you transfer with the
CSR (in the example "myRequest.csr"), for example with a validity of one year (-days 365).
The command also signs the certificate with your private key ("myKey.key" in the example).
Your communication partners can use your public key (contained in your certificate) to check
that you are in possession of the private key that belongs to this public key. This also prevents
your public key from being misused by an attacker.
With self-signed certificates, you yourself confirm that the information in your certificate is
correct. There is no independent body that checks your information.
More information
You will find information about the handling of client certificates of the S7‑1500 CPU in the
section Handling of the client certificates of the S7-1500 CPU (Page 373).
Communication
Function Manual, 11/2024, A5E03735815-AM 195
OPC UA communication
11.2 Security at OPC UA
Communication
196 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Layers required
The figure below shows the three layers that are always required for establishing a
connection: the transport layer, the secure channel and the session.
23&8$FOLHQW 23&8$VHUYHU
$SSOLFDWLRQOD\HU $SSOLFDWLRQOD\HU
ದ8VHUDXWKRUL]DWLRQ 6HVVLRQ ದ8VHUDXWKRUL]DWLRQ
ದ8VHUDXWKHQWLFDWLRQ ದ8VHUDXWKHQWLFDWLRQ
7UDQVSRUWOD\HU
Figure 11-6 Necessary layers: transport layer, secure channel and session
• Transport layer:
This layer sends and receives messages. OPC UA uses an optimized TCP-based binary
protocol here. The transport layer is the basis for the subsequent secure channel.
• Secure channel
The secure channel receives the data received from the transport layer, and forwards that
data to the session. The secure channel forwards data of the session that is to be sent to
the transport layer.
In "Sign" security mode, the secure channel signs the data (messages) that is sent. When a
message is received, the secure channel checks the signature to detect any manipulations.
With a "SignAndEncrypt" security policy, the secure channel signs and encrypts the send
data. Data received is decrypted by the secure channel, and the secure channel then
checks the signature.
With the "No security" security policy, the message packages pass the secure channel
unchanged (the messages are received and sent in plain text).
• Session
The session forwards the messages from the secure channel to the application, or receives
from the application the messages that are to be sent. The application uses the process
values or provides the values.
Communication
Function Manual, 11/2024, A5E03735815-AM 197
OPC UA communication
11.2 Security at OPC UA
Communication
198 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
As of TIA Portal V17 and S7-1500 CPU firmware version V2.9, you can use the certificate
management services of the OPC UA server to transfer OPC UA server certificates during
runtime.
OPC UA certificates, trust lists and certificate revocation lists (CRLs) for the OPC UA server of
the S7-1500 CPU can be updated automatically using GDS push management functions. The
automation of the certificate management eliminates any manual work required for
reconfiguring the CPU, for example, after the period of validity of a certificate has expired,
and a fresh download of the CPU. You can also use the GDS push management functions to
transfer updated certificates and lists in the STOP and RUN operating states of the CPU.
The certificate management information model is specified in OPC UA Part 12 (OPC
10000-12: OPC Unified Architecture, Part 12: Discovery and Global Services).
As of TIA Portal version V18 and S7-1500 CPU firmware version V3.0, you can also use the
GDS push management function for web server certificates. The sequence of, for example,
certificate updates via GDS push-management functions is identical here in principle to the
certificate update of OPC UA server certificates. Instead of OPC UA server certificates, you
transfer web server certificates to the CPU at runtime or during operation. The differences or
restrictions are explained in the following description at the corresponding places.
The following sections provide a general overview of Global Discovery Services and the
function of an automated certificate update supported as of TIA Portal V17 / CPU firmware
version V2.9.
Discovery server
To connect to an OPC UA server, an OPC UA client requires information about its endpoint
such as the endpoint URL and the security policy. When a large number of possible servers are
available in the network, a discovery server can take over the search and management of this
server information.
• OPC UA servers register with the discovery server.
• OPC UA clients request a list of accessible servers from the discovery server and then
connect to the desired OPC UA server.
Communication
Function Manual, 11/2024, A5E03735815-AM 199
OPC UA communication
11.2 Security at OPC UA
The main application of GDS is the management of CA-signed certificates with the
corresponding CRLs:
• Initial creation of an OPC UA application certificate, for example, for the OPC UA server or
for the web server
• Regular update of the trust list and the CRLs
• Renovation of an application certificate
Certificate management
Certificate management has the task of automating the administration and distribution of
certificates and trust lists for different services or UA applications.
In this context, a distinction is made between the following roles:
• Certificate manager - an OPC UA application that provides certificate management
functions
• Certificate recipient – an OPC UA application that receives certificates, trust lists and CRLs
from the certificate manager.
There are two models for certificate management: Pull and push management.
• With pull management, the OPC UA application acts as a client of the GDS server and uses
certificate management methods to request certificate updates and trust list updates.
• With push management, the OPC UA application acts as a server and provides methods for
an OPC UA GDS as OPC UA client. The GDS in the role of certificate manager uses these
methods to transfer ("push") certificates and trusted list updates, see explanation of the
concept for automated certificate update below.
As of firmware version V2.9, the S7-1500 CPU currently only supports push management for
the OPC UA server of the CPU.
Communication
200 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
① Root CA - device that issues certificates for the system (these certificates can also be transmit
ted in other ways, for example, by email)
② OPC UA GDS with certificate manager creates or signs device certificates, manages trust lists
and certificate revocation lists (CRLs), and writes certificates and lists to the devices (push func
tion). This device requires OPC UA client functionality for the push function.
③ Device with OPC UA application receives "pushed" certificates and lists
Concept for automated certificate update for STEP 7 version V17 and higher
GDS and certificate manager are usually combined into one application; however, in the
figure below, they are two separate components.
Devices such as "normal" OPC UA clients are also suitable as certificate managers, but they
need to support the Bytestring data type that is required to transfer certificates, for example,
an S7-1500 CPU firmware V2.9 and higher as OPC UA client or the UA Expert tool (Unified
Automation) with GDS plugin.
The OPC UA server of the S7-1500 CPU as certificate receiver provides the standardized
methods and attributes that the OPC UA client certificates need to read and write trust lists
and CRLs.
The focus in the context of the OPC UA server of the S7-1500 CPU is the description of the
push function in contrast to the usual manner in which certificates are provided to the CPU:
By loading the hardware configuration.
The figure below shows how to transfer certificates and lists for OPC UA in an S7-1500 CPU
FW V2.9 or higher:
• Either by loading the hardware configuration (if appropriate, in STOP mode of the CPU;
the certificates are part of the hardware configuration and can only be loaded in RUN
mode under specific conditions; see Tip: Updating loaded certificates in RUN (Page 76))
• Or via GDS push methods in RUN or in STOP mode of the CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 201
OPC UA communication
11.2 Security at OPC UA
It is not possible to use both transmission paths in parallel. If, for example, you have opted for
transfer of OPC UA server certificates with GDS push functions at runtime, you must also
transmit all the other certificate types to the CPU via this route.
5*"
1PSUBM
$FSUJDBUFT %PXOMPBE
4$16 )BSEXBSFDPOHVSBUJPO
(%4
1VTI
$" 6QEBUF$FSUJDBUFT
$FSUJDBUF (FU-JTU 5SVTU 01$ BOE5SVTU-JTU 01$6" 4*."5*$
%BUBCBTF 6"$MJFOU 4FSWFS .FNPSZ
$BSE
$FSUJDBUF.BOBHFS $FSUJDBUF3FDFJWFS
More information
You can find more information on the certificates for OPC UA in the section Certificates with
OPC UA (Page 191).
Communication
202 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Example
You want to grant access to the OPC UA server for up to 62 OPC UA clients and fill the trusted
list accordingly.
When you add a Certificate Revocation List entry in the trusted list, you can only trust up to
61 client certificates.
Additional OPC UA certificates can not be transferred by loading the hardware configuration
to the CPU.
Tip
To keep the number of required certificates low, we recommend having the OPC UA client
certificates signed by the same CA.
In this case, the CPU as OPC UA server only needs the corresponding CA certificate and CRLs.
With these elements, the OPC UA server can then verify all client certificates signed by the CA.
This means you do not have to add the individual client certificates to the trusted list.
The following describes the settings required for the certificate update.
Requirement
• Depending on the application certificate, the corresponding STEP 7/TIA Portal version and
S7-1500 CPU firmware version is required.
See also here: What you should know about the certificate management (Page 64)
– For OPC UA server certificates, for example, TIA Portal from V17 onwards, CPU
firmware version V2.9
– For web server certificates, for example, from TIA Portal V18, CPU firmware version
V3.0
• Timet/date of the CPU is set (generally applies to certificate-based communication)
• The OPC UA server is enabled.
• The service that the GDS push management uses must be enabled. For example, the web
server must be enabled for the transfer of web server certificates.
• At least one endpoint with the "Sign & Encrypt" security policy must be configured for the
OPC UA server. The partner must use this endpoint
Communication
Function Manual, 11/2024, A5E03735815-AM 203
OPC UA communication
11.2 Security at OPC UA
Activating GDS
When the requirements listed above are met, you must still enable the GDS:
1. In the Inspector window (CPU parameters), go to the "OPC UA > Server > General" area.
2. Enable the "Enable Global Discovery Services (Push)" option.
Communication
204 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Download to CPU
When downloading the configuration to the CPU, you can delete the certificates that are
managed via GDS before the download. When you confirm the deletion, the download is
followed by a provisioning phase (see section on commissioning).
When you download the memory card outside of the CPU (card reader), this certificate store
is always deleted.
When Global Discovery Services (Push) is activated and no pushed certificates are available,
then no separate certificate, trust list or CRL is available for the OPC UA server.
Part 12 of the OPC UA specification distinguishes between a provisioning phase and a run
time phase during certificate management.
In the provisioning phase, a GDS or OPC UA client provides initial trust lists and CRLs for
clients of the OPC UA server. In this phase, the OPC UA server of the CPU accepts all client
certificates and lists it is offered – similar to the "Trusted clients" setting for the OPC UA server
that all client certificates are accepted during runtime. This is the only way in which a
connection to clients not known to the server is possible. For example, clients that the server
cannot authenticate using existing certificates or trust lists until it has received the
corresponding client certificate or the corresponding trust list.
The provisioning phase is characterized by lower security; therefore, the provisioning phase is
indicated by a lit Maintenance LED and a corresponding diagnostics buffer entry
(Maintenance demanded).
Communication
Function Manual, 11/2024, A5E03735815-AM 205
OPC UA communication
11.2 Security at OPC UA
During the runtime phase, the existing CRLs are updated, for example, and the certificates
and trust lists are renewed. Communication is secure in this phase.
Requirement
Only authorized users with sufficient function rights can set up a connection in the
provisioning phase. The users must have a role with the function right "Manage certificates".
See also Setting and loading GDS parameters (Page 203).
Communication
206 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
1SPWJTJPOJOHQIBTF
/PTFSWFSDFSUJDBUFBWBJMBCMFJO$16
/PUSVTUMJTUT MJTUPGUSVTUFEDMJFOUT BWBJMBCMFJO$16
01$6"TFSWFSPGUIF$16HFOFSBUFTTFMGTJHOFEDFSUJDBUFBOEQSJWBUF
LFZ UFNQPSBSZ
(%4 $MJFOUXSJUFTDFSUJDBUFTBOEUSVTUMJTUTJOUIFEFTJHOBUFE
DFSUJDBUFTUPSFPGUIF$16 QVTIGVODUJPO
"MMFYJTUJOHDPOOFDUJPOTCFUXFFODMJFOUBOE$16BSFUFSNJOBUFE
$MJFOUSFDPOOFDUTUPUIF$16CBTFEPOUIFOFXDFSUJDBUFTUSVTUMJTUT
Communication
Function Manual, 11/2024, A5E03735815-AM 207
OPC UA communication
11.2 Security at OPC UA
You can only use the two nodes as marked in the figure for diagnostics if the requirements
for GDS are met (endpoint security signed & encrypted plus administrator function rights
available).
ProvisioningModeEnabled: Indicates that a provisioning phase is supported
ProvisioningModeActive: Indicates that the OPC UA server of the CPU is in the provisioning
phase.
Communication
208 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
NOTICE
Recommended procedure to generate certificates
Transport of private keys should be avoided; a private key should not leave a device.
We, therefore, recommend the generation of a certificate without creating a new key pair or
with the creation of a key pair inside the CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 209
OPC UA communication
11.2 Security at OPC UA
Because the share of the set communication load is fully utilized during key generation over a
longer period of time, set the "Cycle load due to communication" share so that the maximum
cycle time is not exceeded and sufficient reserves are available. For this, use the web server
page "Diagnostics > Runtime information" of the CPU. This page shows information about the
current program/communication load and cycle time of your user program. Via a controller,
you can get help on the effects of a changed communication load on the cycle time.
NOTICE
Different keys for different target systems
Always use newly generated keys for a production system. If you simulate and test your
project, e.g. with PLCSIM Advanced on your PC, do not under any circumstances use the keys
used for the simulation also for a productive system.
Restrict the access to PC-based controllers by setting up appropriate permissions.
The OPC UA specification Part 12 (OPC 10000-12: Discovery, Global Services) defines
methods and attributes for OPC UA servers, for example, that enable GDS or OPC UA clients to
update certificates and trust lists on the server ("Push certificate management"). These
methods and attributes are also included in the address model of the OPC UA server.
The relevant section in the address model of the OPC UA server of the S7-1500 CPU is
explained below.
Requirement
The following requirements must be met for the relevant methods and attributes to become
visible for the GDS push functionality:
• GDS is activated.
• The set security policy supports the integrity and confidentiality of the data through
signature and encryption (Sign & Encrypt).
• Access with runtime function right "Manage certificates"
Communication
210 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Communication
Function Manual, 11/2024, A5E03735815-AM 211
OPC UA communication
11.2 Security at OPC UA
CreateSigningRequest
The method has the following parameters:
Communication
212 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
UpdateCertificate
Applications:
• Generation of certificate with CreateSigningRequest. No private key is available.
• New private key and new certificate were generated outside of the server. Both are
updated with UpdateCertificate.
• Certificate generated and signed with the private key of the existing certificate. No private
key is available.
Communication
Function Manual, 11/2024, A5E03735815-AM 213
OPC UA communication
11.2 Security at OPC UA
Apply Changes
The method has no parameters.
GetRejectedList
The method has the following parameters:
Certificates and trust lists for services or applications of the CPU (for example, OPC UA
servers) that can be updated during runtime are located in the address model in the
"CertificateGroups" object - there is one certificate group each for the various services of the
S7‑1500 CPU. For the OPC UA server certificate, the certificate group has the name "OPC UA
server".
Communication
214 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
You can change the Display Name of the CertificateGroups (e.g. of the "OPC UA server") in
STEP 7 (TIA Portal):
1. In the Inspector window (CPU properties), navigate to the area "Protection & Security >
Certificate management".
2. Enable the option "Use certificates provided by certificate management during runtime"
option.
3. Change the group name (DisplayName) of the certificate group in the table below. 1-64
characters in 7-bit ASCII format are permitted.
The first column contains the activated service for which certificates can be transferred at
runtime and the "ID" column contains a fixed numeric identifier that is used CPU-internally
for referencing the certificate.
Here is an example for the display in the area "Certificate management":
"CertificateTypes" node
The "CertificateTypes" variable specifies the NodeIds of the certificate types that are assigned
to the server application.
For the OPC UA server service, for example, the "RsaSha256ApplicationCertificateType"
CertificateType is supported, for the web server, it is the "HttpsCertificateType
CertificateType".
Communication
Function Manual, 11/2024, A5E03735815-AM 215
OPC UA communication
11.2 Security at OPC UA
"TrustList" node
The node for the trust list object (TrustList file) defines an OPC UA file type (Binary encoded
stream) that contains information on the certificates and CRLs that can be read and updated
in the "pki store\trusted\issuer" directory of the Memory Card. This node provides methods
and attributes that make reading and updating possible.
The node is an instance of the OPC UA data type "TrustListDataType" with the following
structure:
Communication
216 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
In OPC UA, the concept for role-based security is defined in Part 18 of the OPC UA
specification (OPC 10000-18: UA Part 18: Role-Based Security). Parts 3 and 5 of the OPC UA
specification, which contain individual aspects of the role definition, are also relevant, e.g.
which roles a server should support with which permissions and which objects are defined
with which attributes or properties in the address space.
With the implementation of the role-based concept for the S7-1500 CPUs as of firmware
version V4.0, the OPC UA server can manage the access of clients to the address space on a
fine-grained basis.
Communication
Function Manual, 11/2024, A5E03735815-AM 217
OPC UA communication
11.2 Security at OPC UA
Relationship between roles/permissions for OPC UA and roles/function rights for users and roles
The users that you define as part of the local or central user management in the security
settings of the project (users and roles) are taken into account for the access control of the
OPC UA server as follows: only users with the "OPC UA server access" function right are
allowed to access the OPC UA server.
• Local or central user management of the CPU is responsible for authenticating the users
(OPC UA clients) who access the OPC UA server.
• The OPC UA server of the CPU is responsible for authorizing users (OPC UA clients), i.e. for
checking whether a user is allowed to perform the requested action (e.g. read or write to a
node).
You configure the access control for the OPC UA server in the corresponding OPC UA
server interface. The "Access control" area has been added to the editor for OPC UA server
interfaces. The following settings are possible in this area:
– Mapping of existing roles (from the Security settings of the project > Users and roles)
to the OPC UA roles.
– Assignment of default permissions for the namespace of the server interface.
Additionally, you can define access restrictions for the namespaces. For example, you
can specify that permission for an action is granted to the role only within certain
constraints, e.g. that messages are signed and encrypted.
– Customization of the default permissions for individual nodes of the server
interface/companion specification: In a separate "Access management" tab of the
server interface editor, you can customize the permissions for each role on node level
(from CPU view: variables) to adapt the permissions.
During operation, this has the effect that one or more roles are assigned to the session of a
logged-on user. The assigned roles ensure that accesses to a node in the address space are
only possible when the OPC UA permissions of the roles for this node and the configured
access restrictions permit this (e.g. read or write).
Communication
218 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.2 Security at OPC UA
Requirements
• S7-1500 CPU with firmware V4.0 or higher
• TIA Portal as of V20
Communication
Function Manual, 11/2024, A5E03735815-AM 219
OPC UA communication
11.2 Security at OPC UA
Rules
• To assign roles to users or user groups, use the editor for users and roles (Security settings
> Users and roles in the project tree).
These users and user groups are also used by the OPC UA server. The CPU or a connected
UMC server carries out the authentication service when logging on.
• The logged in user must have the function right "OPC UA server access".
• Adding additional roles during runtime is not possible. All roles and associated OPC UA
permissions for the address space have to be configured before commissioning and
loaded in the CPU.
You can achieve greater flexibility with regard to users if you use a UMC server for central
user management and combine users into groups.
• OPC UA offers various criteria for authorizing server access; in OPC UA jargon these are
"mapping rules", for example:
– User identity: Access depends on the identity of the user
– Application identity: Access depends on the ApplicationUri specified in the client
certificate
– Endpoint: Access depends on the URL used to access the server.
The OPC UA server of the S7-1500 CPU only validates the permission via the user identity.
• The OPC UA server of the S7-1500 CPU supports "Well-Known Roles", which are defined in
OPC 10000-3: UA Part 3: Address Space Model. The "SecurityKeyServer..." roles are defined
in OPC 10000-14: UA Part 14 PubSub, section 8.8.
Well-Known Roles
The OPC Foundation has pre-defined roles in namespace 0 (http://opcfoundation.org/UA/);
these roles are available without a separate role definition for every OPC UA server that
supports role-based security.
Examples of "Well-Known Roles":
Anonymous, AuthenticatedUser, Observer, Operator, Engineer, Supervisor, ConfigureAdmin,
SecurityAdmin and Security Key Service roles.
You can easily add these roles as standard OPC UA roles in the TIA Portal.
More information
You can find the latest information on configuring the role-based security for S7-1500 CPUs
in the product information (https://support.industry.siemens.com/cs/ww/en/view/68052815).
Communication
220 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
11.3.1 Interesting information about the OPC UA server of the S7-1500 CPUs
The S7‑1500 CPUs as of firmware V2.0 are equipped with an OPC UA server. Apart from the
Standard-S7-1500 CPUs this applies to the variants S7-1500F, S7-1500T, S7-1500C,
S7-1500pro CPUs, ET 200SP CPUs, SIMATIC S7-1500 SW controllers and PLCSIM Advanced.
Convention: "S7‑1500 CPUs" also includes the above-mentioned CPU variants.
Communication
Function Manual, 11/2024, A5E03735815-AM 221
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Node classes
OPC UA servers provide information in the form of nodes. A node can be, for example, an
object, a tag, a method or a property.
The example below shows the address space of the OPC UA server of an S7-1500 CPU (extract
from the OPC UA client "UaExpert" from Unified Automation).
Figure 11-8 Example of the address space of the OPC UA server of an S7-1500 CPU
In the figure above, the "MyValue" tag is selected (highlighted in gray).
This tag is located below the "Memory" node, which has the node class "Object".
"Memory" is below the "PLC_1" node (also an Object).
Address space
The nodes are linked over references, for example, the reference "HasComponent, which
represents a hierarchical relationship between a node and its subordinate nodes. With their
references, the nodes form a network that can, for example, take the form of a tree.
A network of nodes is also called an address space. Starting from the root, all nodes can be
reached in the address space.
Communication
222 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The end points of the OPC UA server define the security level for a connection. Depending on
the purpose of use or desired security level, you have to carry out the corresponding settings
for the connection at the end point.
NOTE
Select an endpoint with a security policy that is as strict as possible for the server
• Only activate the most secure endpoints on the OPC UA server that a client still supports.
• Deactivate the security policy with a lower security policy on the OPC UA server.
Establishing a connection to the server (client-side)
• To establish a connection to the server, select the appropriate security policy for the
application.
• Corresponding certificates are required for the activated endpoints of the OPC UA server
of the CPU (e.g. a Sha256 certificate for Basic256Sha256).
Communication
Function Manual, 11/2024, A5E03735815-AM 223
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
224 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Example
A tag has the SIMATIC data type "COUNTER". You read COUNTER → UInt16 in the table. You
now know that you do not need to convert; the COUNTER value is sent over the line as a
UInt16 data type.
The client detects from the attribute "DataType" that the tag is actually the SIMATIC data type
"COUNTER". With this knowledge, the client reconstructs the data type.
Communication
Function Manual, 11/2024, A5E03735815-AM 225
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
226 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Arrays
A read or write job with OPC UA is always an array access, which means that it always has an
index and length. A single tag is a special case of an array (index 0 and length 1). The data
type is simply sent repeatedly on the line. For the tags, the "DataType" attribute indicates the
basic data type. The attributes "ValueRank" and "ArrayDimensions" show whether or not you
are dealing with an array and how large the array is.
Structures
Structures are transferred as ExtensionObject. The S7-1500 server uses binary representation
for transmission of the ExtensionObjects over the line; the individual structure elements
come one after the other. At the front is the NodeId of the data type; this is used by the client
to establish the structure.
For OPC UA Specification <= V1.03, a client has to read, decode and interpret the complete
DataTypeDictionary for this (unless it has already learned this library offline through an XML
import).
AS of OPC UA V1.04, the DataTypeDefinition attribute is available, which can be read and
interpreted more quickly and easily. A client only determines the setup of the structure once,
before or during the first access, and then uses this information for the duration of the
session.
Communication
Function Manual, 11/2024, A5E03735815-AM 227
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Additional information
More details on mapping of basic data types, arrays and structures can be found in the OPC
UA Specification Part 6, "Mappings" (see OPC UA BINARY there).
What must be considered with arrays and data types DTL and LDT in the OPC UA server of a
SIMATIC S7-1500? FAQ (https://support.industry.siemens.com/cs/ww/en/view/109766726)
Communication
228 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Examples
• You only want to add another code module to the program.
Neither data blocks nor inputs, outputs, flags, times or counters are affected.
Reaction during loading: A running OPC UA server is not interrupted.
• You want to load a new data module and you have flagged the data module as
non-OPC-UA-relevant:
Reaction during loading: A running OPC UA server is not interrupted.
• You want to overwrite a data module.
Reaction during loading: A warning appears that the server will be restarted.
Background: STEP 7 cannot determine whether the changes refer to OPC-UA-relevant data
or not.
Communication
Function Manual, 11/2024, A5E03735815-AM 229
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
An OPC UA server provides a lot of information for OPC UA clients within a network. The
following section describes options for making CPU tags (PLC tags and DB elements) available
in the address space of your own OPC UA server.
Provide CPU tags via server interfaces in the OPC UA address space
The easiest way to transfer CPU tags automatically into the address space of the OPC UA
server:
• Activate the standard SIMATIC server interface in the OPC UA properties of the CPU.
All CPU tags released for OPC UA are then automatically also available in the OPC UA
address space under the name of the CPU.
Communication
230 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The use of OPC UA server interfaces is more flexible and clearer because you configure the
server interfaces in the project tree (below the CPU, "OPC UA Communication" folder). User-
defined OPC UA server interfaces allow you to easily map OPC UA tags and CPU tags (local
data).
Figure 11-12 Creating a user-defined server interface with mapped CPU tags
The data exchange between OPC UA client and OPC UA server is clearly illustrated in the
following example of two S7-1500 CPUs.
Here, an S7‑1500 CPU as client writes values to an OPC UA tag of the OPC UA server. The
mapping between CPU variable and OPC UA tag makes it look as though the OPC UA client
writes a value directly into the CPU variable. For an S7‑1500 client CPU, use the
"OPC_UA_WriteList" instruction in conjunction with additionally required instructions for the
data exchange.
$POOFDUJPO)EM)BOEMFGSPN01$@6"@$POOFDU
4$16 4$16
BT01$6"TFSWFS BT01$6"DMJFOU
$POHVSBUJPO $MJFOUQSPHSBN
4FSWFSJOUFSGBDF
.BQQJOH 01$@6"@$POOFDU
$16WBSJBCMF01$6"UBH 01$@6"@8SJUF-JTU
01$@6"@%JTDPOOFDU
01$6"UBH OPEFT
Communication
Function Manual, 11/2024, A5E03735815-AM 231
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Writing CPU tag values directly to OPC UA tags (set OPC UA DataValue)
As of firmware version V3.0, S7‑1500 CPUs offer, it is possible to not only map tags, but also
write values directly to local OPC UA tag nodes of the server via the "OPC_UA_WriteList"
instruction. Normally, the "OPC_UA_WriteList" instruction in the client program of the CPU is
used to write values to OPC UA tags of a remote OPC UA server.
Advantage of using "OPC_UA_WriteList" in the server: In addition to the value, you can
provide the OPC UA tag node with the following additional information:
• SourceTimestamp
• StatusCode
OPC UA provides a built-in "DataValue" data type. DataValue is a structure that records both
the Value as well as the SourceTimestamp and StatusCode as additional information for the
value. The DataValue structure is only used by OPC UA services and you cannot write directly
in the program of the CPU to the elements of this structure. Write access is only possible via a
special use of the "OPC_UA_WriteList" instruction.
Application options
CPU variables cannot record a time stamp indicating when a value was last written to the CPU
variable. If you map CPU tags and OPC UA tags via server interfaces, the OPC UA server does
not therefore set the SourceTimestamp to the time when the CPU tag changed, but to the
time when the value was "collected" in the server, such as by a read service or by sampling in
the context of a subscription.
If you write DataValue directly with "OPC_UA_WriteList" to an OPC UA tag node, for example,
you can provide a time stamp determined in the program as the SourceTimestamp for the
value.
Communication
232 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The value of "Read" (-42) of the "OPC_UA_WriteList" instruction causes the server to write to
local OPC UA tag nodes.
$POOFDUJPO)EM
4$16 01$6"DMJFOU
BT01$6"TFSWFS OPU4$16
1SPHSBN $MJFOUBQQMJDBUJPO
01$@6"@8SJUF-JTU 01$6"3FBE
4VCTDSJQUJPO
4FU%BUB7BMVF
01$6"4FSWJDF
01$6"UBH OPEFT
Figure 11-14 Set data value on local OPC UA tag of the server
4$16 4$16
BT01$6"TFSWFS BT01$6"DMJFOU
1SPHSBNN
01$@6"@8SJUF-JTU
4FU%BUB7BMVF
01$6"4FSWJDF
01$6"UBH OPEFT
w4UBUVTDPEF
w4PVSDF5JNTUBNQ
w7BMVF
Figure 11-15 Client reads data value (OPC UA tag of the server of the S7-1500 CPU)
Communication
Function Manual, 11/2024, A5E03735815-AM 233
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Example: A binary value changes so fast that it falls back to its original value in the sampling
interval (fast change TRUE > FALSE > TRUE). A change of the value is not detected. But the
change of the time stamp is detected. Similarly, a notification can be triggered when the
StatusCode changes - even without the value changing.
Constraints
• OPC UA clients are only allowed to read the OPC UA tag; the "AccessLevel" attribute for
read/write permissions must be set accordingly for the OPC UA tag.
• Only OPC UA tags of the user-defined server interfaces can be set locally.
• In the user-defined server interface, there must be no mapping to CPU tags for the directly
written OPC UA tags.
Details on how to use the "OPC_UA_WriteList" instruction in the "Set OPC UA DataValue"
context can be found in the corresponding section of the communication instruction help.
More information
An application example (https://support.industry.siemens.com/cs/us/en/view/109820694) is
provided to assist you on the topic of "Setting OPC UA DataValue attributes".
You can find information on how to coordinate read and write permissions for CPU‑tags in
the Coordinating read and write permissions for CPU tags (Page 238) section.
You can find information how to create user-defined server interfaces in the Creating a user-
defined server interface (Page 283) section.
Communication
234 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Figure 11-17 Enabling PLC tags and DB tags for OPC UA tags
This array can be read completely in one pass by OPC UA clients (see Addressing nodes (Page
178)). The check boxes at "Accessible from HMI/OPC UA" and "Writable from HMI/OPC UA" are
activated for all the components of the array.
Result: OPC UA clients can both read and write these components.
Communication
Function Manual, 11/2024, A5E03735815-AM 235
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Rules
• Only allow read access to PLC tags and tags of data blocks in STEP 7 if this is necessary for
communication with other systems (controllers, embedded systems or MES).
You should not enable other PLC tags.
• Only allow write access over OPC UA if write rights are genuinely necessary for specific PLC
tags and tags of data blocks.
• If you have reset the "Accessible from HMI/OPC UA" option for all elements of a data block,
the data block for an OPC UA client is no longer visible in the address space of the OPC UA
server of the S7-1500 CPU.
• You can also prevent access to an entire data block centrally (see Managing write and read
rights for a complete DB (Page 237)). This setting "overrules" the settings for the
components in the DB editor.
More information
For information on how to coordinate write and read rights for CPU tags, refer to the section
Coordinating write and read rights for CPU tags (Page 238).
Communication
236 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Procedure
Proceed as follows to completely hide a data block for OPC UA clients or to protect a data
block from write access from OPC UA clients:
1. Select the data block to be protected in the project tree.
2. Select the "Properties" shortcut menu.
3. Select the "Attributes" area.
4. Select/clear the "DB accessible from OPC UA" checkbox as required.
NOTE
Effect on settings in the DB editor
If you hide a DB using the DB attribute described here, the settings for the components in the
DB editor are no longer relevant; individual components can no longer be accessed or
written.
Communication
Function Manual, 11/2024, A5E03735815-AM 237
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Definition of write and read rights in the information model (OPC UA XML)
In the OPC UA information model, the attribute "AccessLevel" regulates access to tags.
AccessLevel is defined bit by bit:
Bit 0 = CurrentRead and Bit 1 = CurrentWrite. The meaning of the bit combinations is as
follows:
• AccessLevel = 0: no access
• AccessLevel = 1: read only
• AccessLevel = 2: write only
• AccessLevel = 3: read+write
Communication
238 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Example
• AccessLevel = 1 (read only) in the OPC UA server interface
• Both "Accessible from HMI/OPC UA" and "Writable from HMI/OPC UA" are selected in the
PLC tag table
Result: This tag can only be read.
Rules
If write rights are required:
• AccessLevel = 2 oder 3
• "Writable from HMI/OPC UA" enabled
If read rights are required:
• AccessLevel = 1 (AccessLevel 3 is also possible, but misleading. The settings suggests that
an OPC UA client has write and read rights)
• "Accessible from HMI/OPC UA" enabled, "Writable from HMI/OPC UA" disabled
If neither read nor write rights are to be granted (no access):
• AccessLevel = 0
• "Accessible from HMI/OPC UA" disabled
Only one of the two conditions needs to be met to block all access. In this case, review
whether the tag in the OPC UA server interface is actually necessary at all.
Communication
Function Manual, 11/2024, A5E03735815-AM 239
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Access table
"Accessible from HMI/OPC UA" must be set if access over OPC UA is to be possible at all.
"Writable from HMI/OPC UA" must be set to allow an OPC UA client to write a tag / DB
element.
Please see the table for the resulting access right.
Communication
240 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Examples
An OPC UA tag (structure) is readable and writable; but inconsistent for reading and writing
access.
Consequently: Bits 0, 1, 8 and 9 are set: AccessLevelEx = "771" (1+2+256+512).
Another structure is read-only.
Consequently: Bits 0 and 8 are set, bit 1 and bit 9 are not set: AccessLevelEx = "257"
(1+0+256+0).
Export
During XML export of the standard SIMATIC server interface, the server sets the "AccessLevel"
attribute, which was expanded to 32 bits in V1.04 compared to V1.03, to the value of the
"AccessLevelEx" attribute.
Import
When importing a node set file (e.g. from an export of a server interface), the S7-1500 CPU
sets the attribute "AccessLevelEx" according to its own estimate of the consistency of the
imported data type, see next section. The imported value is ignored.
Communication
Function Manual, 11/2024, A5E03735815-AM 241
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Tip: If you browse in the address space of the S7-1500 CPU (e.g. with the OPC UA Client
UaExpert), you can find the consistent data types under Types > BaseDataType >
Enumeration/Number/String.
Tags of the following data types are not consistent (in the language usage of OPC UA:
"nonatomic"):
• SIMATIC structures are generally not consistent. This means that all tags which, for
example, have unknown structures or a UDT data type are not consistent.
• System data types such as DTL, IEC_Counter, IEC_TIMER, etc. are data types that are
derived from structures.
• Strings (Array of Char) are not consistent.
Tip: If you browse in the address space of the S7-1500 CPU (e.g. with the OPC UA Client
UaExpert), you can find data types based on structures under Types > BaseDataType >
Structure.
In addition to the consistency of the data types, the CPU examines the variables of the
technology objects for plausibility and validity.
If an OPC UA client writes an invalid or implausible value to a variable, the original value is
retained in the variable of the technology object.
Despite an unsuccessful write access, the status "Good" is output.
Example 1
Interpolation type of the cyclic cam
The variable "Cam_1".InterpolationSettings.InterpolationMode is of type INT, but may only
assume the values 1...2.
If you want to change the variable using OPC UA to an invalid value, for example, 3, then the
status code "Good" is output, but the variable is not changed.
Example 2
Position the software limit switch at a positioning axis
The position of the positive HW limit switch must be more positive than the position of the
negative SW limit switch.
"PosAxis_1".PositionLimits_SW.MaxPosition > "PosAxis_1".PositionLimits_SW.MinPosition
If you want to change the variable using OPC UA to a value that does not meet this condition,
then the status code "Good" is output, but the variable is not changed.
Which values are valid for variables of the technology objects can be looked up in the docu
mentation of the technology objects
(https://support.industry.siemens.com/cs/ww/en/view/109751049).
Communication
242 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 243
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
244 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
To create and export the OPC UA XML file, follow these steps:
1. Select the CPU. Click on the CPU symbol (for example in the network view).
2. Click "General > OPC UA > Server > Export" in the properties of the CPU.
3. Click "Export OPC UA XML file".
4. Select the directory in which you want to save the export file.
5. Select a new name for the file or keep the name that is already entered.
6. Click "Save".
NOTE
As of STEP 7 (TIA Portal) V15.1, server methods are contained in the OPC UA export file (node
set) together with their input and output parameters.
Tip
The following FAQ contains a converter with which you can convert the export file into CSV
format. You then obtain a list of the tags of the CPU that can be accessed by OPC UA.
You can find the FAQ on the Internet
(https://support.industry.siemens.com/cs/ww/en/view/109742903).
Communication
Function Manual, 11/2024, A5E03735815-AM 245
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
• If you use certificates for secured communication, e.g. HTTPS, Secure OUC, OPC UA, make
sure that the modules involved have the current time of day and the current date.
Otherwise, the modules evaluate the used certificates as invalid and secure
communication does not work.
• You have acquired a runtime license for the operation of the OPC UA functions, see
License for OPC UA (Page 269).
• If access control is enabled and you are using user management (local or central): The
users must have the "OPC UA server access" function right.
Information on the assignment of the "OPC UA server access" function right can be found
in the Siemens Industry Online Support under the following entry ID: SIOS Entry ID
109954947 (https://support.industry.siemens.com/cs/us/en/view/109954947)
Communication
246 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Application name
The application name is the name of the OPC UA application and applies to the server and the
client. The name is displayed under "OPC UA > General":
• The default for the application name is: "SIMATIC.S7-1500.OPC-UA.Application:PLC_1".
• The default consists of "SIMATIC.S7-1500.OPC-UA.Application:" and the name of the CPU
selected under "General > Product information > Name", in this case "PLC_1".
• The OPC UA server uses this application name to identify itself to a communication partner
(OPC UA client), for example, when an OPC UA client uses the discovery service to detect
accessible servers.
• The displayed application name uses the OPC UA client of the CPU when connecting to an
OPC UA Server. This means that the CPU enters this application name automatically as
"ApplicationName" for the instruction "OPC_UA_Connect" (tag of type
"OPC_UA_SessionConnectInfo" at the parameter "SessionConnectInfo" of the instruction
"OPC_UA_Connect").
When you program the instruction "OPC_UA_Connect" you must therefore assign an
empty string to the "ApplicationName". You can use the application name, for example, to
identify the client and its sessions (SessionNames) for diagnostic purposes.
If you have activated the server, you can also use a different name that is meaningful in your
project and that fulfills the requirements of your project, e.g. for worldwide uniqueness.
The example below originates from UaExpert:
Communication
Function Manual, 11/2024, A5E03735815-AM 247
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Server addresses
The OPC UA server of the S7-1500 CPU can be reached over all integrated PROFINET
interfaces of the CPU (firmware V2.0 and higher).
Direct access to the OPC UA server of the CPU over the backplane bus of the automation
system is not possible via CPs under the following conditions:
• Configuration with TIA Portal Version V16 or higher, S7-1500 CPU firmware version 2.8 or
higher and CP 1543-1 firmware version V2.2 or higher.
For configuration, see Access to OPC UA applications (Page 174).
Direct access to the OPC UA server of the CPU over the backplane bus of the automation
system is not possible via CMs.
With SIMATIC S7 1500 SW controllers, access to the OPC UA server is possible via PROFINET
interfaces that are assigned to the software PLC.
Additional access options of SW controllers are described in the following application
example: Internal and external OPC UA connection via the virtual Ethernet interface of the
software controller V2.5 or higher
(https://support.industry.siemens.com/cs/ww/en/view/109760541).
Example for URLs (Uniform Resource Locator) that can be used to set up connections to the
OPC UA server of the CPU:
Communication
248 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Dynamic IP addresses
In the example below, the IP address for the PROFINET interface [X2] has not yet been
specified.
NOTE
General device information is readable even with deactivated standard SIMATIC server
interface
Even if you disable the standard SIMATIC server interface, OPC UA clients can read general
device information about the OPC UA server of the CPU.
Examples of such device information: DeviceManual, DeviceRevision, OrderNumber. In this
case, however, all objects of the application program remain invisible to clients.
If you want to prevent that this device information is not visible, you have to disable the OPC
UA server of the CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 249
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
250 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTE
No error message following attempt to register more than the configured maximum
number of registrable nodes
If a client tries to register more nodes during runtime than the configured maximum number,
the server of the S7-1500 CPU only registers the configured maximum number. Starting from
the configured maximum number of registrable nodes, the server returns the regular string
node IDs unchanged to the client so that the speed advantage gained by registration for
these nodes is lost. The client does not receive an error message.
When configuring, make sure you have a sufficient reserve by taking into account the
maximum number of nodes that can be registered (for example, using the technical data of
the CPU).
Additional information
Details on which ports are used by the various services for data transfer via TCP and UDP, and
what are the points to note when using routers and firewalls can be found in the FAQ
(https://support.industry.siemens.com/cs/ww/en/view/8970169).
Communication
Function Manual, 11/2024, A5E03735815-AM 251
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
4VCTDSJCFNZ%#NZ"SSBZ
23&8$VHUYHU 6DPSOLQJLQWHUYDO ;PV 7UDQVPLVVLRQLQWHUYDO <PV
%#NZ"SSBZ
NZ%#NZ"SSBZ
3XEOLVKLQJLQWHUYDO
6DPSOLQJLQWHUYDO
%#
NZ"SSBZ
Communication
252 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 253
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
More information
Information about the system limits of the OPC UA server of the S7-1500 CPUs (firmware
V2.0 and V2.1) regarding subscriptions, sampling intervals and publishing intervals can be
found in the following FAQ
(https://support.industry.siemens.com/cs/ww/en/view/109755846).
When using subscriptions, certain status codes of errors provide information on the error that
occurred. For information on causes and remedies for status codes of OPC UA client that
appear, see the list of error codes in the online help of STEP 7 (TIA Portal) or in the following
FAQ (https://support.industry.siemens.com/cs/ww/en/view/109755860).
The rules for subscriptions are available in section Rules for subscriptions (Page 383).
You will find information about the diagnostics of subscriptions in the section Subscription
diagnostics (Page 343).
Communication
254 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
A configuration for the S7-1500 OPC UA server is not required; the "TransferSubscription"
service is provided on request of an OPC UA client.
All S7-1500 CPUs as of firmware V3.1.4 support the transfer of subscriptions.
Additional requirements:
• Users (clients) must have a role that grants them Read permission.
• If a subscription of an already closed session is to be transferred, the process must be
completed within the subscription timeout.
• Subscriptions can be transferred both between sessions of an authenticated user and
between sessions of anonymous users.
– For authenticated users, both sessions must be assigned to the same user.
– For anonymous users, the connection must also be encrypted and the sessions must
have been created by clients with identical application URIs.
A secure connection between the OPC UA server and an OPC UA client is only established
when the server can prove its identity to the client. This is done with the server certificate.
Communication
Function Manual, 11/2024, A5E03735815-AM 255
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
256 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
11. Scroll down in the "Secure Channel" dialog to the section "Trusted clients".
Communication
Function Manual, 11/2024, A5E03735815-AM 257
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
12. Double-click in the table on the empty row with "<add new>". A browse button is
displayed in the row.
13. Click this button.
Result:
The server now trusts the client. If the server certificate is also considered trusted, the server
and client can establish a secure connection.
NOTICE
Setting after commissioning
In order to avoid security risks, deactivate the "Automatically accept client certificates during
runtime" option again after commissioning.
Communication
258 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
By default, a server certificate is created that uses SHA256 signing. The following security
policies are enabled:
• None
Unsecured end point
NOTE
Disabling security policies you do not want
If you have enabled all security policies in the secure channel settings of the S7-1500 OPC
UA server (default setting) – thus, also the end point "None" (no security) – unsecured
data traffic (neither signed nor encrypted) between the server and client is also possible.
The identity of the client remains unknown with "No security". Each OPC UA client can
then connect to the server irrespective of any subsequent security settings.
When configuring the OPC UA server, make sure that only security policies that are
compatible with the security concept of your machine or plant are selected. All other
security policies should be disabled.
Recommendation: If possible, use the setting "Basic256Sha256".
• Basic128Rsa15 -Sign
Insecure end point, supports a series of algorithms that use the hash algorithm RSA15 and
128-bit encryption.
This endpoint protects the integrity of the data through signing.
• Basic128Rsa15 -Sign & Encrypt
Secure endpoint, supports a series of algorithms that use the hash algorithm RSA15 and
128-bit encryption.
This endpoint protects the integrity and confidentiality of the data through signing and
encrypting.
• Basic256Rsa15 -Sign
Secure endpoint, supports a series of algorithms that use the hash algorithm RSA15 and
256-bit encryption.
This endpoint protects the integrity of the data through signing.
• Basic256Rsa15 -Sign & Encrypt
Secure endpoint, supports a series of algorithms that use the hash algorithm RSA15 and
256-bit encryption.
This end point protects the integrity and confidentiality of the data through signing and
encrypting.
• Basic256Sha256 - Sign
Secure endpoint, supports a series of algorithms for 256-bit hashing and 256-bit
encryption.
This endpoint protects the integrity of the data through signing.
• Basic256Sha256 - Sign & Encrypt
Secure endpoint, supports a series of algorithms for 256-bit hashing and 256-bit
encryption.
This endpoint protects the integrity and confidentiality of the data through signing and
encryption.
Communication
Function Manual, 11/2024, A5E03735815-AM 259
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• Aes256_Sha256_RsaPss - Sign
Secure endpoint, supports a range of algorithms for 256-bit encryption and 256-bit
hashing. All certificates must use at least Sha256 signatures. This endpoint protects the
integrity of the data by signing it.
For high security requirements. PKI infrastructure required.
• Aes256_Sha256_RsaPss - Sign & Encrypt
Secure endpoint, supports a range of algorithms for 256-bit encryption and 256-bit
hashing. All certificates must use at least Sha256 signatures. This endpoint protects the
integrity and confidentiality of data by signing and encrypting it.
For high security requirements. PKI infrastructure required.
To enable the security setting, click the check box in the relevant line.
NOTE
If you use the settings "Basic256Sha256 -Sign" and "Basic256Sha256 -Sign & Encrypt", the
OPC UA server and OPC UA clients must use "SHA256"-signed certificates.
For the settings "Basic256Sha256 -Sign" and "Basic256Sha256 -Sign & Encrypt", the
certificate authority of STEP 7 automatically signs the certificates with "SHA256".
"No Security" security policy and authentication via user name and password
You can set the following combination:
Security policy = "No Security" and authentication via user name and password.
• The OPC UA server of the S7-1500 supports this combination. OPC UA clients can connect
and encrypt the authentication data or not.
• OPC UA client of the S7-1500 CPU also supports this combination: However, in runtime it
only connects if it can send the authentication data encrypted via cable!
Communication
260 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The description below shows the procedure for generating new certificates with STEP 7 and
applies in principle to various uses of the certificates. STEP 7 sets the appropriate purpose - in
this case "OPC UA Client & Server" - depending on which area of the CPU properties is used to
start the following dialog.
Recommendation: To use the full functionality for the security of the OPC UA server, use the
global security settings.
The global security settings are enabled in the CPU properties under "Protection & Security >
Certificate manager".
Communication
Function Manual, 11/2024, A5E03735815-AM 261
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
3. The dialog for generating new certificates is displayed (figure below). The values for an
example are already entered:
4. Use other parameters if this is necessary in accordance with the security specifications in
your company or your customer.
Communication
262 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 263
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The following entry would also be valid: "IP: 192.168.178.151, IP: 192.168.1.1". The
important thing here is that the IP addresses via which the OPC UA server of the CPU can
be accessed are entered here.
See "Access to the OPC UA server (Page 248)".
This allows OPC UA clients to verify whether a connection to the OPC UA server of the
S7-1500 is really to be established or whether in fact an attacker is trying to send
manipulated values from another PC to the OPC UA client.
NOTE
To increase security, you should only allow access to the OPC UA server with user
authentication.
Communication
264 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The following options for user authentication use central project settings for project users:
• For the server:
For configuration of CPU properties (OPC UA > Server > Security > User authentication).
Option: "Enable additional user administration via the security settings of the project"
• For the client:
For configuration of client interface ("Configuration" tab, "Security"). Option: "User (TIA
Portal - security settings)"
Requirement
Before you can edit the security settings, the project must be protected and you must be
logged on with sufficient rights, for example as administrator.
Communication
Function Manual, 11/2024, A5E03735815-AM 265
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
266 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
3. You will find the following function rights in the "Function rights" section:
– OPC UA server access
This function right applies on the OPC UA server of the S7-1500 CPU. Only when this
option is selected, can the user with the role "PLC-opcua-role-all-inclusive" transfer
certificates, CRLs or trusted lists to the CPU at runtime (push function). This function
right is required for automated certificate handling, for example, in the context of GDS
(Global Discovery Service).
– Managing certificates
This function right applies on the OPC UA server of the S7-1500 CPU. Only when this
option is enabled, can the user with the role "PLC-opcua-role-all-inclusive" transfer
certificates, CRLs or trusted lists to the CPU at runtime (push function). This function
right is required for automated certificate handling, for example, in the context of GDS
(Global Discovery Service).
– User authentication of the OPC UA client
This function right applies on the OPC UA client of the S7-1500 CPU (with client
instructions). Only when this option is selected, can the user with the role "PLC-opcua-
role-all-inclusive" use the user name and password for authentication to establish a
session with a server.
NOTE
"Runtime timeout" for users with OPC UA function rights
The value in the column "Runtime timeout" (max. session duration) in the table for user
configuration does not evaluate the CPU for OPC UA runtime rights.
Therefore, a user is not automatically logged out after a certain period of time. For this
purpose use OPC UA specific mechanisms such as the parameter "Max. session timeout"
(area OPC UA > Server > Settings).
Communication
Function Manual, 11/2024, A5E03735815-AM 267
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Diagnostics
You can specify the scope of the diagnostics of the OPC UA server in the CPU settings.
To change the diagnostics scope, navigate to the "OPC UA > Server > Diagnostics" area.
Default setting
The default setting is a diagnostics behavior that supports the most important diagnostics
without appreciably increasing the communication load.
You enable diagnostics for subscriptions when the OPC UA server also uses subscriptions, i.e.
if necessary during the commissioning phase only.
Reason: A large volume of diagnostic activity generates a high communication load in the
CPU and may suppress other important messages. Or, the high volume of diagnostics may
result in important messages disappearing in the mass of messages and being ignored.
Additional information
You will find additional information on the meaning and effect of the settings shown above
here (Page 336).
Communication
268 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Runtime licenses
A license is required to run the OPC UA server of the S7-1500 CPU. The type of license
required depends on the performance of the respective CPU. The following license types are
differentiated:
• SIMATIC OPC UA S7-1500 small (required for CPU 1511, CPU 1512, CPU 1513, ET 200SP
CPUs, CPU 1515SP PC)
• SIMATIC OPC UA S7-1500 medium (required for CPU 1515, CPU 1516, Software Controller
CPU 1507, CPU 1516pro-2PN)
• SIMATIC OPC UA S7-1500 large (required for CPU 1517, CPU 1518)
The required license type is displayed under "Properties > General > Runtime licenses >
OPC-UA > Type of required license":
Definition
A server interface combines nodes of an OPC UA address space of a CPU into a unit, so that a
specific view on this CPU is provided for OPC UA clients.
Each server interface defines one or more namespaces in the OPC UA server of the CPU.
STEP 7 (TIA Portal) differentiates between the following types of server interfaces:
• Companion specification
For this type of server interface, you use a Companion Specification created by a
workgroup, for example.
The workgroup is typically composed of members of the OPC Foundation and another
industry organization who have jointly specified an OPC UA information model for a
specific purpose (for example, for data exchange with RFID devices or with injection
molding machines).
This information model is realized in the form of OPC UA nodes in the address space of an
OPC UA server. OPC UA clients can access these OPC UA nodes.
Communication
Function Manual, 11/2024, A5E03735815-AM 269
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
You can also use the server interface type "Companion specification", for example, to
download company-internal information models, e.g. in SiOME.
If you implement a certain companion specification in your project, you apply the
specifications of this companion specification into your project as server interface.
For "Companion specification"-type server interfaces, you can import multiple namespaces
which the Companion specification uses.
Additional information on companion specifications is available here (Page 271).
Additional information on SiOME is available here
(https://support.industry.siemens.com/cs/ww/en/view/109755133).
– When companion specifications refer to type definitions in dependent specifications,
use the reference namespaces for this. You import reference namespaces as you would
the actual companion specifications.
See Creating a server interface for companion specification (Page 278).
– If you want to make instance data from FBs or UDTs of the CPU accessible to OPC UA
clients, you can have these instance data assignments automatically made as of TIA
Portal version V17. You only need to map the FB types or the UDTs to suitable OPC UA
data types of an imported reference namespace. For this mapping to be possible,
enable the option "Generate OPC UA nodes based on the local data mapping" in the
dialog for creating an OPC UA server interface of the type companion
specification/reference namespace.
See Generating OPC UA nodes based on local data mappings of FB types and UDTs
(Page 303)
• User-defined server interface:
For this type of server interface you combine OPC UA nodes of an OPC UA server into a
unit.
To do this, use the specifications for your project or the requirements for your machine or
your plant as a basis.
Additional information on the user-defined server interface is available here (Page 283).
Communication
270 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Other OPC UA nodes of the CPU are not included in this server interface. This provides a
better overview.
Introduction
OPC UA is universally applicable: The standard itself does not, for example, specify how PLC
tags are to be named. It is also up to the individual user (application developer) to program
and name server methods that can be called over OPC UA.
Communication
Function Manual, 11/2024, A5E03735815-AM 271
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The following section uses the example of Euromap 77 to detail how to apply companion
specifications in STEP 7 (TIA Portal) and create the necessary PLC tags.
NOTE
EUROMAP and the OPC Foundation have established the Joint Working Group "OPC UA
Plastics and Rubber Machinery".
The existing EUROMAP recommendations EUROMAP 77 (data exchange between injection
moulding machines and MES), 82.1 (temperature control devices) and 83 (general
definitions) were published under the neutral umbrella of the OPC Foundation as OPC 40077,
40082-1 and 40083.
A major change it the change of the namespace, for example, for EUROMAP 77: Currently
"http://opcfoundation.org/UA/PlasticsRubber/IMM2MES/".
The examples listed below use the previously valid designations and references.
NOTE
Euromap 77, Euromap 83 and OPC UA for Devices (DI)
With Release Candidate 2, some of the Euromap definitions have been transferred from
Euromap 77 to Euromap 83 (currently OPC 40083). You will therefore also need to import
the OPC UA server interface of Euromap 83.
"OPC UA for Devices" is a generally applicable information model for the configuration of
hardware and software components. The information model also serves as the basis for other
companion standards and is therefore also imported.
Communication
272 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Procedure in STEP 7
To use the new server interface, import the server interface into the STEP 7 project, see
section "Creating a server interface for companion specification (Page 278)".
When the project is loaded into the CPU, the new server interface is available for OPC UA
clients.
NOTE
The following description shows the work steps in SiOME 1.7.3.
Follow-up versions of SiOME make it easier for you, for example, to create corresponding
DBs, structures, variables or methods in the user program. Using a drag-and-drop operation,
you can transfer data, for example, from SiOME to the TIA Portal (user program). In this case,
the variables, etc. are already mapped correctly or, for methods, the corresponding FB
elements are also generated correctly in the user program.
Download the current SiOME version using the download link listed above, and follow the
instructions in the documentation included in the download.
Communication
Function Manual, 11/2024, A5E03735815-AM 273
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
274 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
10. Create an instance from the root object type IMM_MES_InterfaceType of the Companion
specification Euromap 77.
To do so, in the "Information model" area, right-click the "DeviceSet" directory and select
"Add Instance".
SiOME displays the "Add Instance" dialog.
11. For "Name", enter a meaningful name for your instance.
In the example, enter "IMM_Manufacturer_01234".
For "TypeDefinition", select "IMM_MES_InterfaceType".
This object type is the root object type of Euromap 77: If you generate an instance of this
object type, then use the Euromap 77 once in the address space of your OPC UA server.
Communication
Function Manual, 11/2024, A5E03735815-AM 275
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
15. Create a new instance "PowerUnit_1" of the "PowerUnitType" object type in the
"PowerUnits" directory.
16. Save the XML file.
To do so, click the "Quick save" button in the "Information model" area:
Communication
276 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 277
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Result
In your STEP 7 project, you have created a tag for the Euromap 77 in the
"IMM_Manufacturer_01234" data block.
For basic information on companion specifications, refer to the section "Using OPC UA
companion specifications (Page 271)". The benefits of the Euromap 77 companion
scpecification, which provides a model for injection molding machines, is also discussed in
detail there.
Using this companion standard, the S7-1500 CPU can control an injection molding machine,
for example, and provide an OPC UA client, such as a higher-level MES system, with an
interface for accessing the functions and tags of injection molding machine.
An OPC UA server interface of the type "Companion Standard" limits the access of clients to
exactly those functions and tags that are required, for example, for higher-level systems (MES
systems).
The following description shows how to create a server interface in STEP 7 (TIA Portal) which
contains only the Euromap 77 companion specification.
If you want to make OPC UA clients accessible to other tags or methods than those required
for the management of an injection molding machine, simply create another OPC UA server
interface. In this way, you can clearly arrange the functionality of the CPU as OPC UA server.
Communication
278 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
5. Change the name of the new server interface so that it is descriptive in your project.
The name should have the following structure according to Euromap 77:
"IMM_<Manufacturer>_<Serial number>".
The example uses the name "IMM_Manufacturer_01234".
6. In the "Import XML file" field, select an XML file that describes an information model.
The "Using OPC UA companion specifications (Page 271)" section describes how to create
such an XML file with the SiOME tool.
The figure below shows a section from the information model:
"IMM_MANUFACTURER_0123456" an instance (use) of the type "IMM_MES_InterfaceType"
which was defined by Euromap 77 . "InjectionUnit_1" is an instance of the
"InjectionUnitType" type of Euromap 77.
7. Click "OK".
STEP 7 (TIA Portal) imports the information model described in the selected XML file.
An error occurs when type definitions are used in the imported XML file that are not yet
present in STEP 7 (TIA Portal) and that are also not contained in the imported XML file.
Communication
Function Manual, 11/2024, A5E03735815-AM 279
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
In the example, an XML file is imported that uses type definitions defined in the following
namespaces (Namespaces):
– http://opcfoundation.org/UA/DI/
– http://www.euromap.org/euromap83/
– http://www.euromap.org/euromap77/
Tip: STEP 7 displays missing namespaces in the lower area of the OPC UA interface editor
("Properties" tab).
To do this, select the server interface in the project tree (here: IMM_Manufacturer_01234)
and select the "Namespaces" area in the inspector window. Missing namespaces are
selected.
If one or more namespaces are missing in your STEP 7 project, create a new server
interface of the "Reference namespace" type for each namespace.
The "Creating a server interface for reference namespace (Page 300)" section describes the
procedure.
If all reference namespaces are available, STEP 7 displays the table without errors:
8. Drag the OPC UA elements from the right area of the table (OPC UA elements) to the left
part of the table (OPC UA server interface) so that the respective OPC UA elements (the
local PLC tags) are assigned to the respective OPC UA nodes of Euromap 77.
The figure below shows a section from the assignment of the local data (PLC tags) to the
OPC UA nodes of the Euromap 77:
Communication
280 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTICE
Checking the mapping of CPU local data on nodes of the OPC UA server interface
When invalid assignments (mappings) exist in the server interface, they can result in
incorrect read and write operations. Check the assignments and run a consistency check.
Communication
Function Manual, 11/2024, A5E03735815-AM 281
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• Data type
The SIMATIC data type of the PLC tag (e.g. element of a data block) in the CPU, from
which the value of an OPC UA node (UAVariable type) is read, or to which a value is
assigned.
Consistency check
You have the option to check the server interface.
STEP 7 (TIA Portal) checks whether the OPC UA node of the server interface PLC tags (data
blocks) has been assigned compatible SIMATIC data types.
To check the consistency of the server interface, click on the following icon in the toolbar of
the OPC UA server interface editor:
Communication
282 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Export interface
You have the option of exporting the OPC UA server interface as an XML file. This XML file
contains all data type definitions referenced by the server interface.
To export the OPC UA server interface, click on the following icon in the toolbar of the OPC
UA server interface editor:
Introduction
The description is based on the following example:
A protective fence surrounds the production cell "Cell_1". The fence is equipped with the gate
"Gate_1".
An S7-1500 CPU controls the entire production cell and also controls access through Gate_1.
A robot packs drugs into boxes in the production cell and then stacks the boxes on pallets.
Self-driving vehicles for automated material transport move the pallets to the central
warehouse, thereby passing through Gate_1.
The CPU publishes a server interface via which the driverless transport systems arrange for
Gate_1 to open.
The server interface contains the server method "smOpenGate" for opening the gate and the
tag "Gate_1_State" which indicates the status of the gate (open or closed).
Communication
Function Manual, 11/2024, A5E03735815-AM 283
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
4. Change the name of the new server interface so that it is descriptive in your project.
In the example, change the name "Server-interface_1" suggested by STEP 7 to "Cell_1".
5. Click "Server interface" and then "OK".
6. Click on the triangle in front of "Program blocks" in the area "OPC UA elements" to open
the "Program blocks" folder.
STEP 7 displays the following table for editing:
Communication
284 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTE
The following applies in general: If you store data blocks or technology objects in the left
area of the table, STEP 7 (TIA Portal) creates an object in the server interface. The
elements of the data blocks are arranged as separate nodes below this.
If you store structures in the left area of the table, STEP 7 creates a node for the structure
as a whole and nodes for each element of the structure.
The same applies to arrays: Again, STEP 7 creates a node for the array as a whole and
nodes for each element of the array.
When you place a method in the left area of the table, STEP 7 creates a single node; the
arguments of the inserted method are displayed for information purposes.
In the example, you drag the "Gate_1_State" tag from the right area to the left area to
"<Add new>".
Then, drag the server method into the left area.
This server method is located within the "smOpenGate_DB [DB3]" data block in the right
area.
STEP 7 (TIA Portal) displays the dialog as follows:
Communication
Function Manual, 11/2024, A5E03735815-AM 285
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTICE
Checking the mapping of CPU local data on nodes of the OPC UA server interface
When invalid assignments (mappings) exist in the server interface, they can result in
incorrect read and write operations. Check the assignments and run a consistency check.
Since the TIA Portal only generates warnings and not errors for invalid assignments, you can
proceed step-by-step as follows:
For example, in the first step, you can modify the program/local data so that the program
runs without errors. The next step is to modify the OPC UA server interface and eliminate the
inconsistencies.
At the points at which the TIA Portal generates warnings, the OPC UA server interface does
not function during runtime. The OPC UA server generates runtime errors.
Communication
286 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Once a server interface has been defined, you can drag it to another CPU in the project tree.
Communication
Function Manual, 11/2024, A5E03735815-AM 287
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• Node type
Type of the OPC UA node, for example BOOL, BYTE, INT.
These node types were defined by Siemens, not by the OPC Foundation. For example, the
OPC Foundation uses the Boolean node type for BOOL. BOOL is directly derived from
Boolean.
The specified node type cannot be changed in this dialog: If you want to use a different
node type, you must change the type of the respective PLC tags in the STEP 7 project.
• Data type
The SIMATIC data type used in the STEP 7 project is specified, for example, Bool, Byte, Int.
etc.
• Access level
– If an OPC UA node is a tag (UAVariable type), the node can only be readable (RD) or
readable and writable (RD/WR).
– If an OPC UA node is a method (UAMethod type), this node can always be called.
• Local data
The SIMATIC data type of the data block in the CPU, from which the value of an OPC UA
node (UAVariable type) is read, or to which a value is written.
Communication
288 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Consistency check
You have the option to check the consistency of the server interface.
During the consistency check, STEP 7 checks whether the OPC UA nodes of the server
interface are each assigned to a suitable OPC UA element (identical data type) or whether the
used element still exists in the CPU.
To check the consistency of the server interface, click on the following icon in the toolbar of
the OPC UA server interface editor:
Export interface
You have the option of exporting the OPC UA server interface as an XML file. This XML file
contains all data type definitions referenced by the server interface.
To export the OPC UA server interface, click on the following icon in the toolbar of the OPC
UA server interface editor:
More information
You can find information on master copies for the OPC UA communication in the section
Master copies for OPC UA communication (Page 385).
See also
Client accesses and local accesses to the OPC UA server (Page 230)
Communication
Function Manual, 11/2024, A5E03735815-AM 289
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
290 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The figure shows an example of the declaration: When Selector = 1, Union takes a ByteArray;
when Selector = 2, Union takes a WString.
As of TIA Portal version V17 and S7-1500 CPU firmware version V2.9, the two OPC UA Built-in
data types "LocalizedText" and "ByteString" are available for mapping to corresponding
SIMATIC data structures. For the definition of these OPC UA data types, see also OPC
10000-3 DataType definitions.
These data types are used in companion specifications, for example, and can be easily
handled by the user program with the OPC UA interface editor.
LocalizedText
A structure containing a string with locale identifier (e.g. 'en-US').
The structure has three elements with a defined order and the following structure in SIMATIC:
• Encoding (data type OPC_UA_LocalizedTextEncodingMask): Indicates in bit 0 whether the
"Locale" field has a content and in bit 1 whether the "Text" field has a content. Both fields
should have a content. We therefore recommend setting the "Encoding" value for SIMATIC
to 2#00000011.
• Local (WString data type): Locale, for example, 'en-US'.
• Text (WString data type): Text box, for example, 'Text'.
ByteString
A sequence of octets.
The structure is built up as follows:
• ActualLength (data type "OPC_UA_ByteStringActualLength"): Length of the ByteString
array that is filled
• ByteString ("Array of Byte" data type): Byte array
Requirement
An OPC UA server interface has been created.
Application
You can import a companion specification or a reference namespace that contains definitions
of the "LocalizedText" or "ByteString" type.
Likewise, you can create a server interface and define an address model yourself with the
data types "LocalizedText" or "ByteString". The procedure is described in the next section.
Communication
Function Manual, 11/2024, A5E03735815-AM 291
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Procedure
You will learn how to create a node of the type "LocalizedText" or "ByteString" with the
interface editor and then have a SIMATIC data structure created automatically for this node in
the paragraphs below.
To define OPC UA nodes of the type "Localized Text"/"ByteString" in a server interface, follow
these steps:
1. Create nodes of the type "LocalizedText" or "ByteString" in the "OPC UA server interface"
area. These node types are included in the list of selectable node types.
2. Select the "Generate local data" command from the shortcut menu. To generate the local
data, select a data block, for example, a new DB with the name "MyServerInterface_Data".
Result: STEP 7 generates the corresponding structure for the mapping in which you still
need to adjust the required text length (Text) and the required locale (Locale) for
"LocalizedText".
The same is true for "ByteString"; in this case, you must adjust the length and the array.
The consistency check generates a warning to indicate the required adjustments.
Communication
292 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Rules
• You can also create UDTs with the structure as shown above for the node types
"LocalizedText" or "ByteString" and use them for DB elements.
• You can use the node types "LocalizedText" or "ByteString" in other structures (nests).
• The SIMATIC structures for "LocalizedText" or "ByteString" may only be used completely; an
isolated data type, such as "OPC_UA_LocalizedTextEncodingMask" for other purposes, is
not provided.
• Input and output parameters of methods can also be of the data type/node type
"LocalizedText" or "ByteString".
Apart from the OPC UA data types listed in the section "Mapping of data types" and their
correspondences on the SIMATIC side, there are the following OPC UA basic data types which
you can also use:
• OpcUa_NodeId
• OpcUa_QualifiedName
• OpcUa_Guid
• OpcUa_XmlElement
• OpcUa_ByteString (Page 291)
• OpcUa_LocalizedText (Page 291)
Requirement for the use of the basic data types listed above as variables in the application
program: The basic data types have to exist as complex data types that are structured exactly
like the corresponding OPC UA basic data types.
• OpcUa_NodeId and OpcUa_QualifiedName exist as system data types; that's why you can
use these data types not only for single variables but also as elements of a structure.
• For the basic data types or built-in data types GUID and XmlElement you have to create a
PLC data type in accordance with the OPC UA specification and subsequently use it as an
element in a structure so that the data types of the elements can be resolved. What each
PLC data type must look like is described below for every single basic data type.
• For OpcUa_ByteString and OpcUa_LocalizedText, the requirements have been created in
TIA Portal V17 to simply use these data types in the server interface of the "Companion
Specification" type:
– You create the corresponding node type in the server interface (for example,
OpcUa_LocalizedText)
– You click on "Generate local data"
STEP 7 then automatically generates the appropriate data structures in a DB.
• For OpcUa_Guid, these requirements have been met in TIA Portal V19. Proceed as
described in the previous section.
Communication
Function Manual, 11/2024, A5E03735815-AM 293
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
294 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The next figure shows the data block with the GUID elements that is created automatically
with "General local data".
Communication
Function Manual, 11/2024, A5E03735815-AM 295
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
By contrast, OPC UA does not define an array as a data type. Any variable value (Value) can be
an array. The following attributes and properties of Variable NodeClass are used in OPC UA to
define how a variable is structured with respect to its "geometry" as an array (except from
https://reference.opcfoundation.org/Core/Part3/v104/docs/5.6):
Principle
In order for OPC UA variables to be mapped to CPU tags of Array type, you use a structure or
UDT with the new system data type "OPC_UA_ArrayBoundaries".
The structure or UDT has the following structure elements and is structured as follows:
• The first structure element (array size) is itself an array and defines the current size of the
dynamic array. The system data type "OPC_UA_ArrayBoundaries" defines the index range
available in the server interface for each dimension (with lower and higher boundary
elements in each case).
• The second structure element (array data) contains all array elements with a selectable
data type permitted for OPC UA.
STEP 7 (TIA Portal) automatically ensures that, for example, negative indexes on the SIMATIC
end are converted to non-negative indexes (starting at "0") on the OPC UA end (server
interface).
Communication
296 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 297
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
298 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTE
Import blocked for namespace "http://www.siemens.com/simatic-s7-opcua"
You cannot import server interfaces with the namespace "http://www.siemens.com/simatic-
s7-opcua" to an S7-1500 CPU because this namespace is reserved for S7-1500 CPUs (standard
SIMATIC server interface) and is not available for imports.
If you want to import a server interface with the namespace
"http://www.siemens.com/simatic-s7-opcua", open the server interface to be imported (OPC
UA XML file) and change the namespace in the relevant places. The file thus changed can
then be imported.
WARNING
No checking of imported OPC UA XML files
Protect these OPC UA XML files against unauthorized manipulation since STEP 7 does not
check the integrity of these files.
Recommendation
To minimize risks in the case of an extension or adaptation of the server address space, follow
these steps:
1. Protect the project (project navigation: Security settings > Settings).
2. Export the corresponding server interface before the extension or adaptation.
3. Revise this OPC UA XML file.
4. Import the file again as a server interface.
Communication
Function Manual, 11/2024, A5E03735815-AM 299
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTE
EUROMAP and the OPC Foundation have established the Joint Working Group "OPC UA
Plastics and Rubber Machinery".
The existing EUROMAP recommendations EUROMAP 77 (data exchange between injection
moulding machines and MES), 82.1 (temperature control devices) und 83 (general
definitions) were published under the neutral umbrella of the OPC Foundation as OPC 40077,
40082-1 and 40083. However, the examples listed below use the previously valid
designations and references.
Communication
300 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
8. Click "OK".
STEP 7 (TIA) now generates the new server interface.
You can find the server interface in the project tree of STEP 7 (TIA Portal) under "OPC UA
Communication > Server interfaces > Reference namespace".
Communication
Function Manual, 11/2024, A5E03735815-AM 301
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
If a companion specification uses additional namespaces, add a new server interface for each
namespace.
Communication
302 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
11.3.4.11 Generating OPC UA nodes based on local data mappings of FB types and UDTs
If you want to make instance data from FBs or UDTs of the CPU accessible to OPC UA clients
you can, as of TIA Portal version V17, have these instance data assignments automatically
made.
You only have to map the FB types or the UDTs to suitable OPC UA data types of imported
reference namespaces. Based on these mappings created in STEP 7 (TIA Portal), generate the
required nodes in the server interface for each FB instance or for each UDT usage during the
compile.
If you extend your program and add more FB instances or UDT usages, or if you add existing
instances delete, you do not need to worry about adapting the server interface: STEP 7
automatically adjusts the server interface when compiling the program.
Example
• You create a function block (FB) in the user program of the CPU and define in the "Static"
area of the interface of the FB the parameters that form the "memory" of the FB. The
instances (values) of this parameter are to be accessible for OPC UA clients.
• You create an OPC UA data type (e.g. with SiOME) with elements that correspond to the
data type the parameters in the static area of interface of the FB. The order of the
elements does not matter. Then import the reference node set file (reference namespace)
as a reference name space.
The following figure shows the assignment of elements as comparison of the reference
namespace view (server interface) and the OPC UA elements view (program).
Communication
Function Manual, 11/2024, A5E03735815-AM 303
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Automatic generation of the OPC UA server instances in the server interface: Principle
The figure below shows the compilation of the project. The instances of the user program are
also generated in the server interface.
By mapping between FB type information / UDT type information and OPC UA type
information, STEP 7 is able to create all instances present in the program as nodes in the
server interface.
Communication
304 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Rules
• Only the FB elements in the "Static" area of an FB interface can be mapped to OPC UA type
descriptions.
• When mapping the data types, OPC UA elements from the same FB interface or from the
same UDT must always be selected for an object. Mapping from different FBs or UDTs to
an object is not permitted.
Requirement
• The FB types used, defined in the "Static" area of an FB, must be configured as "Accessible
for OPC UA".
• The UDTs used must be configured as "Accessible for OPC UA".
• A nodeset file (XML file) is available with OPC UA data type definitions that match the FB
types or UDTs defined in user program (can be mapped).
Use the "SiOME" tool to create your node set file (Siemens Industry Online Support).
• The user program with the FB instances and UDT usages is available.
Procedure
To map a data type from a reference namespace to an FB type or UDT data type, follow these
steps:
1. Select the CPU that you want to use as an OPC UA server.
2. Import the prepared node set file (XML file) with the type definitions as a reference
namespace.
– In the "Add new server interface" dialog, enable the option "Generate OPC UA nodes
based on the local data mapping".
Only when this option is enabled can you map FB types or UDTs by dragging them to
the OPC UA type descriptions.
3. Double-click the icon for the server interface of the "Reference namespace" type that you
just generated.
The editor for mapping between OPC UA server interface and OPC UA elements opens. In
the properties area of the editor, in the "Mapping of local data" area, the option "Generate
OPC UA nodes based on the local data mapping" is enabled. If not, enable the option now.
In the "Interface name" field, adapt the name of the server interface to be created. A new
server interface of the "Companion specification" type with this name is created during the
compile.
Communication
Function Manual, 11/2024, A5E03735815-AM 305
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
4. Assign the existing FB types or UDTs to the nodes of the server interface (reference
namespace) by dragging the OPC UA element (right side of the editor) to the
corresponding node of the server interface (reference namespace, "Local data" column).
Consistency check
The consistency check ("Consistency check" button of the editor) also checks the mapping of
the data types and updates the display of the data types in the corresponding column of the
editor.
Communication
306 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
When you use OPC UA server interfaces, you must comply with limits for the following
objects in line with the S7-1500 CPU performance class:
• Number of server interfaces
• Number of OPC UA nodes
• Load object data volume
• If you have implemented methods: Number of server methods or server method instances
Communication
Function Manual, 11/2024, A5E03735815-AM 307
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
308 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
6DV23&8$6HUYHU
0HWKRG
23&8$ )LUPZDUH 23&B8$B6HU )%&RRO &\FOLFDO
&OLHQW 23&8$ YHU0HWKRG3UH &DOO
8VHU
6HUYHU 23&3UHB SURJUDP
,QVWDQFH
$ % &
0HWKRGV)XQF
WLRQDOLW\!
&DOO
&DOO &RRO
23&3RVWB
23&B8$B6HU ,QVWDQFH
YHU0HWKRG3RVW
&DOO
&RRO
'
A Call of the server method and management of the "Done" information (method complete)
① Asynchronous call of the server method
② Asynchronous "Done" information for the method called (method complete)
B Wait for OPC UA client calls, management of calls in the queue, forwarding of "Done" information from the cyclic
user program to the OPC UA client
③ Data transfer from the OPC UA server to the method instances of the user program and vice versa
C Check whether method has been called.
If it has, forwarding of input data from the OPC UA server to the method instance of the user program and feed
back to the method instance that the method has been called ("called")
④ Synchronous call of the instruction OPC_UA_ServerMethodPre as a multi-instance stating the storage area for the
input data from the OPC UA server.
The return value indicates whether or not the method has been called by the OPC UA client.
Communication
Function Manual, 11/2024, A5E03735815-AM 309
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
⑤ Check whether the method has been completed or is still active ("busy").
D Check whether the method has been completed.
If it has, the output data of the method instance is forwarded to the OPC UA server and the method instance is
notified that the method has been completed. The OPC UA server is notified.
⑥ Call of the method FB (in this case: FB Cool) with the required instance and the process parameters
Figure 11-54 Example: Calling the "Cool" server method
Communication
310 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Amount of data which can be transferred using server method to an S7-1500 CPU
Max. 2097152 bytes (= 2.1 megabytes MaxMessageSize).
Communication
Function Manual, 11/2024, A5E03735815-AM 311
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Alarms allow you to detect errors in process control in the automation system quickly, to
localize them precisely, and to eliminate them. This leads to a significant reduction in
downtimes in a plant. The OPC UA information model "Alarms & Conditions" provides a
standardized and platform-independent way of message processing.
As of firmware version V2.9, the OPC UA server of an S7-1500 CPU supports the OPC UA
information model "Alarms and Conditions". In this way, the OPC UA server provides access to
controller alarms.
The following sections describe which alarm types available in SIMATIC are supported at the
OPC UA interface of the OPC UA server.
The following sections also describe how you configure the OPC UA server of the S7-1500
CPU for Alarms & Conditions, the main points of how the Alarms & Conditions model is
structured with OPC UA, and which special points must be taken into consideration when
using alarms from the address space of the OPC UA server as compared to the SIMATIC
controller alarms of the CPU alarm system.
Communication
312 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 313
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
314 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
After the activation of OPC UA Alarms and Conditions (CPU properties in the hardware
configuration), the OPC UA address space of the S7-1500 CPU thus reflects the various alarm
types (controller alarms) as described above:
• ProcessDiagnostics
Corresponds to the PLC supervision alarms with ProDiag
• SystemDiagnostics
Corresponds to the system diagnostics alarms
• UserProgram
Corresponds to the program alarms
• Graph
Corresponds to GRAPH alarms
By selecting the node for a subscription, you determine which alarm types are received by the
OPC UA client. For example, the "Server" node enables receipt of all alarms, the
"UserProgram" node only the receipt of program alarms.
Details about the OPC UA model for Alarms and Conditions are given in the next selection,
especially for the "Overloads" node, you can find more information here: Handling memory
limits for OPC UA Alarms and Conditions (Page 333).
Communication
Function Manual, 11/2024, A5E03735815-AM 315
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The basic concepts for alarm processing in OPC UA are expanded on here - the basic concept
of "Events" is covered here. The terms used in the various parts of the OPC UA specification
have been retained here.
Properties of events
In the address model of the OPC UA server, as of CPU firmware version V2.9, you not only
have the option to access PLC tags (read, write) via nodes and to use methods - you can also
receive events or alarms via nodes. In OPC UA terminology, these are called "events".
An event includes an event text (Message), time stamp (Time) and event source
(SourceNode).
The information supplied with an event from the server depends on the event type. OPC UA
defines a BaseEventType in part 5 of the specification (Information Model).
Other event types that provide different alarm behavior are derived from the BaseEventType.
This type information of the different event types is visible in the address space of an OPC UA
server ("Types" folder). This also applies, for example, to the event types of "Conditions" and
"Alarms", which are discussed in the next section.
The OPC UA specification defines for the BaseEventType and for derived EventTypes which
properties (fields) of an event are mandatory and which are optional.
The following figure shows the hierarchical structure of BaseEventType.
The following sections show how specialized EventTypes are derived from the root of the
derivation hierarchy, the BaseEventType. The SIMATIC-specific derivations ensure that the
information supplied in SIMATIC with an alarm and displayed on an HMI device, for example,
can also be subscribed to by an OPC UA client in the address space of the OPC UA server.
An event itself is not available as a node in the address space. Events are only triggered by
nodes or objects that have the "Event-Notifier" property. These nodes are often also referred
to as event signaling objects. Only nodes with this property can be specified as
EventMonitoredItem in a subscription to receive corresponding events in the client.
Nodes that can trigger events with an S7-1500 CPU are objects such as "Server", the
"SimaticAlarmsAndConditions" object below it, and the three objects below that,
ProcessDiagnostics, SystemDiagnostics and UserProgram. The "EventNotifier" attribute is set
for these objects in the address space of the OPC UA server of the CPU.
Communication
316 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Definition of SimaticEventType
The figure below shows that the type "SimaticEventType" is derived directly from
BaseEventType.
BaseEventType is the basic type definition for events with OPC UA.
All event types for OPC UA can be defined, directly or indirectly, based on BaseEventType.
#BTF&WFOU5ZQF
4JNBUJD&WFOU5ZQF
Communication
Function Manual, 11/2024, A5E03735815-AM 317
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
318 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The following goes further in depth about the basic concepts for OPC UA Conditions and OPC
UA Alarms based on the explanations of events in the previous sections. Again, the terms
used in the various parts of the OPC UA specification have been retained here.
Properties of Conditions
A prerequisite for understanding is the concept of "Events" in OPC UA.
In OPC UA, if an event alarm object provides status information in addition to its ability to fire
Events, we speak of Conditions. Conditions represent a state of a system or one of its
components. Basic states are "enabled" and "disabled", other state definitions are also
possible.
In turn, interested OPC UA clients are notified of state changes by means of events (Condition
Events).
An example of a Condition is state information, for example, that a device requires
maintenance.
Properties of Alarms
However, the properties of ConditionType are not sufficient to completely map the
characteristics of SIMATIC alarms in the OPC UA server.
From the ConditionType, which is derived from the BaseEventType, OPC UA defines further
derived event types such as AcknowledgeableConditionType and AlarmConditionType.
AcknowledgeableConditionType supplements the properties of ConditionType with the
"Acknowledgeable" characteristic (AckedState).
AlarmConditionType thus adds the "ActiveState" characteristic to the properties of
ConditionType and the AcknowledgeableConditionType. In SIMATIC terminology, this is an
incoming alarm. The ActiveState signals that the situation, which the Condition represents, is
currently present or has occurred.
Example: A temperature has exceeded a limit. If "ActiveState" is not set, the situation that
represents the condition no longer exists - this is usually referred to as a "normal state". In
SIMATIC terminology, this corresponds to an outgoing alarm.
In OPC UA, other statuses such as SilenceState and ShelvingState are defined, but these are
not relevant to mapping to the SIMATIC alarm system and will therefore not be described
further here.
The SimaticAlarmConditionType is derived from the AlarmConditionType and contains all
event fields to map the state and acknowledgment information of SIMATIC messages.
Communication
Function Manual, 11/2024, A5E03735815-AM 319
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Definition of SimaticAlarmConditionType
The following figure shows how events of the type "SimaticAlarmConditionType" are defined
by a series of expansions to the OPC UA "BaseEventType".
#BTF&WFOU5ZQF
$POEJUJPO5ZQF
"DIOPXMFEHFBCMF$POEJUJPO5ZQF
"MBSN$POEJUJPO5ZQF
4JNBUJD"MBSN$POEJUJPO5ZQF
Communication
320 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirements
• S7-1500 CPU firmware version V2.9 or higher.
• Runtime license for OPC UA purchased according to the license specifications and set in
the CPU properties.
• "Central alarm management in the PLC" parameter is enabled ("PLC messages" area in the
CPU properties).
Procedure
To activate alarms through OPC UA Alarms and Conditions, follow these steps:
1. In the CPU properties, go to the "OPC UA > Server > General" area.
2. Select the "Enable alarms and conditions on the OPC UA server" option.
The corresponding types and objects that can trigger events only become visible in the
address space when the option is activated.
3. If required, also activate the option "Allow message acknowledgment by OPC UA client".
In this case, any connected OPC UA client can acknowledge an alarm requiring
acknowledgment with the "Acknowledge" method.
Communication
Function Manual, 11/2024, A5E03735815-AM 321
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
More information
You can find information on methods for OPC UA Alarms and Conditions in the section
Methods for OPC UA Alarms and Conditions (Page 329).
You can find information on failed requests of a remote client in the section Request of a
remote client failed (Page 341).
Communication
322 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Special features of the display of alarms via the OPC UA server of the CPU
The following once again summarizes the special features of the alarm display via OPC UA
Alarms and Conditions for the current status.
Topic Explanation
Comment Via OPC UA, you can add a comment to a alarm using the
"AddComment" method or the "Acknowledge" method. This com
ment is no longer available after a server restart.
Pending alarms are not lost after a The OPC UA server supports the "ConditionRefresh" method with
server restart which it makes the current state of the system available to the OPC
UA client, for example, after download of a new data block
(requires server restart and re-establishment of the connection).
Communication
Function Manual, 11/2024, A5E03735815-AM 323
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
You can specify placeholders for SIMATIC alarms. With placeholders you can integrate up to
10 associated values (SD_1 to SD_10) into the alarm text. Placeholders can also be specific
text list entries.
When you are using alarms with placeholder, you must observe the following rules:
• Placeholders that represent values in the alarm are only inserted automatically for system
diagnostic alarms or security event alarms. For other categories of alarms (e.g. program
alarms), the placeholders for values are not resolved. The OPC UA clients must resolve
these alarms.
• Placeholders that reference text lists are resolved by the CPU (format, e.g.: %t#<name of
the text list>).
2. In the "Events" tab of UaExpert, you select the alarm with the integrated associated values.
In the "Details" area of the alarm, you will find the value that is to be integrated into the
alarm.
Example: "AssociatedValue_01" is assigned to SD_1 (format @1% ...@).
You will find explanations on the formats for associated values in the TIA Portal
information system (e.g. by searching for "Example of associated values").
Communication
324 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2024, A5E03735815-AM 325
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Alarms are transmitted from the OPC UA server to the OPC UA client in the default or
reference language. In the "Multilingual support" area of the CPU parameters, you can set the
loaded project languages in which the alarms are to be transmitted.
As of Version 4.0 of the S7-1500 CPUs, you have the option of having the languages of
connected OPC UA clients selected:
• When establishing the session, a client can request message texts in one or more active
project languages using the parameter "LocaleIds []"; see OPC 10000-4: Services,
ActivateSession Service Parameters.
Only message texts can be requested from the OPC UA server of the CPU in this way; the
parameter has no effect on other localized texts in the address space.
Requirement: The "Provide multilingual message texts corresponding to the active project
languages in the device" option has been enabled.
• A client can request the message texts in all three active project languages
simultaneously, e.g. to collect the alarms on a central server, so that they can be
evaluated by people in different languages.
Requirements
• S7-1500 CPU as of firmware version 4.0
• The OPC UA client supports the LocaleIds "mul" and "qst" for multilingual texts.
• The "Provide multilingual message texts corresponding to the active project languages in
the device" option has been enabled ("Alarms and Conditions" area in the CPU properties).
Communication
326 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
LocaleId = "mul"
When an OPC UA client requests a LocalizedText with LocaleId "mul", it receives the message
texts in all loaded project languages on the CPU as a JSON text element, consisting of an
Array of locale/text pairs.
In the following example, texts are specified in two languages. Spaces and breaks are not
transmitted; they have been added here to facilitate reading:
{
"t": [
["de-DE","mein Text"],
["en-US","my text"]
]
}
Resulting text:
de-DE: "mein Text"
en-US: "my text"
LocaleId = "qst"
"qst" is not an abbreviation but merely a defined string for a LocaleId, which contains
replacement texts in addition to the contents, as in the case of "mul".
When an OPC UA client requests a LocalizedText with the LocaleId "qst", it receives the
message texts in all loaded project languages on the CPU. In addition to the Array of LocaleId,
the JSON text element has a section with the definition of replacement texts (replacement
section). The client must carry out the provided replacements in the message text.
Example texts in two languages; "t" stands for "text", "r" for "replacement":
{
"t": [
["de-DE","mein Text @1@ /2/"],
["en-US","my text @1@ /2/"]
],
"r": [
["@1@", "myCompany"]
["/2/", 1.2345]
]
}
Communication
Function Manual, 11/2024, A5E03735815-AM 327
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Resulting text:
de-DE: "mein Text myCompany 1,2345"
en-US: "my text myCompany 1.2345"
Because the decimal number 1.2345 in the replacement section is not formatted as String, it
can be written correctly in the different languages (with decimal point in en-US and with
decimal comma in de-DE) – provided that this function has been implemented in the client.
Rules
Alarm texts are assembled by the server according to the following rules, and provided to the
client:
• To simplify the handling of multilingual message texts, only the LocaleId "qst" is allowed
for the server of the S7-1500.
If you request multilingual message texts with "qst" and there are placeholders (associated
values) in the text, the placeholders are provided in the replacement section. If no
placeholders are present in the text, the text is returned as LocaleId "mul" without
replacement section.
If only one language is returned (e.g. because there is only one active language or
alignment with the requested languages results in a single language) and no placeholder
is present in the text, the message text is not returned as JSON but rather is returned
directly as localized text in the appropriate language.
• A client can retrieve the alarms in all languages provided by the server or only some of
these languages. The client defines the selection through an Array of LocaleIds, which
follows the LocaleId "qst". If no other LocaleIds follow the LocaleId "qst", all available
languages are provided by the server.
• Multilingual replacement texts are not returned in the replacement section. You
implement multilingual replacement tests using text lists, see AUTOHOTSPOT.
Communication
328 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The OPC UA specification Part 9 (OPC 10000-9: Alarms & Conditions) defines methods for
OPC UA servers to enable OPC UA clients to react to state changes, for example.
In the following, the methods are described that are supported by the OPC UA server of the
S7-1500 CPU with their special features.
Requirement
Using the relevant methods for the Alarms and Conditions functionality requires the
following:
• Alarms and Conditions is activated
• For the "Acknowledge" method, the acknowledgment of alarms by OPC UA clients must be
allowed on the server side.
Method Description
Acknowledge Method for acknowledging an alarm object that is uniquely
identified by a EventId.
ConditionRefresh Method for requesting an update of all alarm objects (in
SIMATIC language: updating of all pending alarms). All mon
itored items of the subscription are updated.
Synchronization of pending alarm objects from the OPC UA
server of the CPU is indicated e.g. in the following situations:
• Connecting for the first time or resuming the connection
(after interrupting the communication)
• Screen change on an operator screen of an HMI device
AddComment Method for adding comments to alarm objects.
Communication
Function Manual, 11/2024, A5E03735815-AM 329
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Acknowledge
The Acknowledge method (MethodId: i=9111) has the following parameters:
Communication
330 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
ConditionRefresh
The ConditionRefresh method (MethodId: i=3875) has the following parameters:
NOTE
ConditionRefresh2 method
The OPC UA server of the S7-1500 CPU does not support the ConditionRefresh2 method
which can specifically synchronize a monitored item (MonitoredItem) in a subscription. In
this case, the OPC UA Server returns the result code "Bad_MethodInvalid". Use the method
"ConditionRefresh" instead.
AddComment
You have the possibility to add comments to Alarms- objects of the
SimaticAlarmConditionType type because the support of comments is mandatory for OPC UA
Alarms and Conditions .
A comment was save in the "Comment" event field.
The following time stamp event fields belong to the comment:
• "Comment.SourceTimestamp" for the time when the comment is transferred to the CPU
• "Time" for the time when the Alarms object was modified
When the "AddComment" method is called, "Time" and "Comment.SourceTimestamp" are
identical.
Special features of Alarms and Conditions comments for the OPC UA server of the CPU
Communication
Function Manual, 11/2024, A5E03735815-AM 331
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Special features of Alarms and Conditions comments for the OPC UA server of the CPU
You have the possibility to add comments to alarm objects of the
"SimaticAlarmConditionType" type with the AddComment method. A comment is also set
when the Acknowledge method is called. The "AddComment" method can be called several
times.
• A comment was save in the "Comment" event field. The "Comment.SourceTimestamp"
indicates the last time at which a comment was set.
• The "Time" time stamp marks the last modification time of the alarm object.
When the "AddComment" method is called, "Time" and "Comment.SourceTimestamp" are
identical.
When the "Acknowledge" method is called, the two time stamps may differ, since the
acknowledgment is asynchronous.
The support of comments for OPC UA Alarms and Conditions is mandatory. The SIMATIC
alarm system does not know corresponding comments for alarms. Therefore, some special
features have to be considered:
• There is only one comment:
There is only one comment for an alarm object, so that an existing comment is always
overwritten when several method calls are made in succession.
• Lifetime and time stamp:
Comments are only stored at the current alarm object. If the alarm object no longer exists,
e.g. after a server restart, the comment no longer exists either. The corresponding
"Comment" and "Comment.SourceTimestamp" event fields are then reset (zero).
The "Time" event field is then set as if the method call "AddComment" did not exist.
Example: If you comment on an unacknowledged Alarms object, the "Time" event field
receives the time of this comment change. After a server restart, the "Time" event field
does not show the time when the comment was set, but the time when the
corresponding Event arrived.
Communication
332 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The OPC UA server of the S7-1500 CPU has product-specific limited memory capacity for the
"Alarms and Conditions" function (see CPU specifications).
Two memory pools for different categories of alarms are available:
• Pool only for ProgramAlarms (corresponds to program-related alarm originators
(producers) such as program alarms via Program_Alarm, ProDiag, Graph)
• Pool only for SystemDiagnostics (corresponds to system diagnostic alarms)
Under unfavorable conditions (e.g. alarm burst) the CPU cannot make all pending alarms
(ProgramAlarms or SystemDiagnostics) from the SIMATIC alarm area available to the OPC UA
Alarms and Conditions system. However, alarms are not lost in this case.
You have the possibility to react to this overload event in the user program. According to your
application you can use the "ConditionRefresh" method to make alarms that "did not make it
into the OPC UA Alarms and Conditions system" available to the OPC UA Alarms and
Conditions system again.
Requirement
• Alarms and Conditions is activated
• Event subscriptions are set up in the OPC UA client
Communication
Function Manual, 11/2024, A5E03735815-AM 333
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Principle
The following figure shows a simplified process for temporarily storing ProgramAlarms to
make them available again at another time for the OPC UA Alarms and Condition System. The
nodes mentioned in the caption are visible in the following image of the address model.
4*."5*$"MBSNT 01$6"
"MBSNTBOE$POEJUJPOT
4VCTDSJQUJPO
1SPHSBN"MBSNT
1SPHSBN"MBSNT
0WFSMPBE"MBSN
3FGSFTI
.FUIPE
$16YY 01$6"$MJFOU
4ZTUFN%JBHOPTUJDT
01$6"4FSWFS
4ZTUFN%JBHOPTUJDT
0VUTUBOEJOH"MBSNT
$16JOTJEF
① Number of active alarms is too high to make all alarms accessible via OPC UA Alarms and Conditions
② Overloads alarm (overload alarm) is triggered. This overload alarm is active until the following situation occurs:
• No more alarms are pending for the OPC UA Alarms and Conditions system (OutstandingProgramAlarms = 0)
and
• Number of alarms in the OPC UA Alarms and Conditions system < Hysteresis-cleaned maximum value for OPC
UA alarms (= MaxAlarmsInQueue - OverloadHysteresis)
Alarms that are not available in the OPC UA Alarms and Conditions system due to the overload situation are buf
fered by the CPU as "OutstandingAlarms".
③ When an OPC UA client executes the ConditionRefresh method, not only are all alarm objects of the relevant sub
scription synchronized, but also the alarms outstanding for OPC UA Alarms and Conditions (OutstandingAlarms)
are transferred to the Alarms and Conditions memory area - until the maximum number of alarms is reached.
"Oldest" alarms are transferred first. After that every subscription to these alarms receives the transferred alarms -
not only the OPC UA client that called the ConditionRefresh method.
④ The OPC UA client controls the handling of pending alarms via the information of the Overloads nodes.
Communication
334 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Special features
• When pending alarms go out or are acknowledged, they no longer enter the OCP UA
Alarms and Conditions system area via the ConditionRefresh method. They are then
"invisible" to OPC UA Alarms and Conditions and thus to the connected OPC UA clients.
This fact influences e.g. statistical evaluations of alarm progressions.
• To avoid a high alarm frequency for the Overloads Alarm if the number of alarms oscillates
around the maximum value, the limit for triggering the alarm is higher than the limit for
canceling this alarm: The value for this difference is displayed in the "OverloadHysteresis"
node.
Example: Maximum number of alarms: 200, OverloadHysteresis: 3.
Overloads alarm is triggered starting with 200 alarms and is only canceled if there are
fewer than 197 alarms. If the number of alarms increases again, it will be triggered again
when 200 alarms are exceeded.
Communication
Function Manual, 11/2024, A5E03735815-AM 335
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
In the address space of the server, for example, the following nodes are available with
diagnostic information:
• ServerDiagnosticsSummary: Server diagnostics summary
– CurrentSessionCount: Number of active sessions
– SecurityRejectedSessionCount: Number of sessions rejected due to mismatching end
point security settings between client and server
• SessionsDiagnosticsSummary: Session diagnostics summary
– ActualSessionTimeout: Set time that a session lasts, e.g. in the event of disconnection
• SubscriptionsDiagnosticsArray: ARRAY with one element per subscription for each
session
Communication
336 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The SessionsDiagnosticsSummary node also shows the properties of the client application
accessing the server within the session.
Figure 11-58 Sessions diagnostics with the properties of the client application
From STEP 7 (TIA Portal) V18 onwards, you can access nodes in the OPC UA address space of
an S7-1500 CPU (firmware version V3.0 onwards) to evaluate the contents for diagnostic
purposes in the program.
Functional principle
In the local address space of the CPU, there are numerous nodes where the OPC UA server of
the CPU stores data and states. The "OPC_UA_ReadList" instruction enables you to access this
information and evaluate it in the user program.
Example: "ServerState" is a node in the address space of the CPU that contains values for the
server state or for state transitions (Running, Shutdown, Failed, etc.).
You do not use the instruction as a client instruction, but instead as an instruction for reading
nodes of the own local OPC UA address space. In this regard, special rules and requirements
apply to this application case.
More information
You can find more information on calling the "OPC_UA_ReadList" instruction for diagnostic
purposes in the TIA Portal help, topic "Diagnosing OPC UA servers with OPC_UA_ReadList".
Communication
Function Manual, 11/2024, A5E03735815-AM 337
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
The "Change of OPC UA server status" option is selected (OPC UA > Server > Diagnostics) in
the OPC UA properties of the CPU.
NOTE
If this option is selected, the CPU also automatically enters the lowest set security policy into
the diagnostic buffer after startup.
Examples
If the OPC UA server of the CPU shuts down due to a download process and then starts with a
valid new configuration, the diagnostic buffer shows new server state, e.g. Shutdown =>
Starting => Running.
If the OPC UA server shuts down due to a download process and the server cannot start
because the type dictionary is too large, the diagnostic buffer finally shows the state "Failed"
(Shutdown => Starting => Failed).
Communication
338 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
3RZHURQ
)DLOHG
Communication
Function Manual, 11/2024, A5E03735815-AM 339
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
The "Change of session states" option (OPC UA > Server > Diagnostics) is selected in the OPC
UA properties of the CPU.
Example
A client transmits incorrect authentication data (for example, incorrect password) when a
connection is established. The new state of the "ActivationFailed" session is entered with the
corresponding session ID in the diagnostic buffer.
&ORVHG
$FWLYDWLRQ)DLOHG 7LPHG2XW
① Client connects to server, login with correct authentication data (correct credentials).
② Client closes connection correctly.
③ Client no longer sends messages; session ends with timeout.
④ Client connects to server, login with incorrect authentication data.
Figure 11-60 Session states and state transitions
Communication
340 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
If the CPU diagnostics detects a security event during the OPC UA communication, it can
enter it in the diagnostic buffer.
Requirements
• S7-1500 CPUs as of firmware version 2.8
• The "Check for security events" option is activated (properties of the CPU > OPC UA >
Server > Diagnostics).
Example
If an attempt is made to compromise communications (for example, by session hijacking,
man-in-the-middle attacks etc.), the server detects this via analysis.
S7-1500 CPUs as of firmware version V2.8 are able to create an entry in the diagnostic buffer
for the following events:
• Bad client requests (incorrect use)
• Service error occurred
• CPU-specific high limits of the OPC UA server were violated
Communication
Function Manual, 11/2024, A5E03735815-AM 341
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Service fault
If a service itself fails, the server returns a ServiceFault. In this case, the status code (Bad...)
and the according session ID are entered in the diagnostics buffer.
Communication
342 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
In the OPC UA properties of the CPU, the option "Subscriptions: Change of status" (OPC UA >
Server > Diagnostics) is selected.
Example
An OPC UA client is connected to an S7-1500 CPU as OPC UA server and generates a
subscription in the server.
The diagnostic options for subscriptions are selected in the OPC UA properties of the CPU.
The "Creating" and "Normal" states are entered one after the other with the corresponding
subscription ID in the diagnostic buffer.
Communication
Function Manual, 11/2024, A5E03735815-AM 343
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
&UHDWLQJ 1RUPDO .HHS$OLYH /DWH
&ORVHG 7LPHG2XW
Status Meaning
Creating Client has requested a subscription in the server; the server creates the subscrip
tion.
Normal Subscription is created in the server and active.
Closed Client has deleted the subscription.
KeepAlive Status if the monitored items do not change over a long period of time. These
state transitions are not entered in the diagnostic buffer.
Late Client has generated a subscription with minimal sampling and publishing inter
vals. The amount of monitored items is not transmitted to the client during this
time.
Client no longer transmits requests to send (for example, due to failure).
TimedOut The client has requested a subscription.
The server can only honor the subscription (send Publish Response) when there is
a sufficient number of send requests (Publish Requests) from the client.
When the client stops sending subscription requests, the subscription enters the
"TimedOut" state after a certain time.
Communication
344 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Requirement
In the OPC UA properties of the CPU, the option "Subscriptions: Sampling time errors" (OPC
UA > Server > Diagnostics) is selected.
Error-free subscription
In the case of an OPC UA subscription to various elements (such as tags), the OPC UA server
of the SIMATIC S7-1500 must check the elements for value changes at specified intervals
(sampling interval). This check, referred to as "sampling", requires some time, which depends
on the number and the data type of the items. After the sampling is completed and a
publishing request has been received, the server sends the elements to the client.
7LPH
Communication
Function Manual, 11/2024, A5E03735815-AM 345
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
6DPSOLQJ 6DPSOLQJ
7LPH
More information
You can find information about the server settings for subscriptions in the section Settings of
the server for subscriptions (Page 252).
To prevent the diagnostics buffer being "swamped" by large numbers of identical OPC UA
diagnostics, as of STEP 7 V16 service pack 1, you can set parameters so that these diagnostics
are entered in the diagnostics buffer as group alarm. Per interval (monitoring time), the CPU
then only generates one group alarm per OPC UA diagnostics.
The following sections describe which diagnostics the CPU groups together and how the
process runs with a high message volume.
Requirement
The "Summarize diagnostics in case of high message volume" option is activated in the OPC
UA properties of the CPU (OPC UA > Server > Diagnostics, "Summarize diagnostics" area).
Communication
346 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Example
An OPC UA client repeatedly "overloads" an S7-1500 CPU as OPC UA server with a sampling
rate that the server cannot handle (overload).
The "Summarize diagnostics in case of high message volume" setting is activated.
A message appears in the diagnostics buffer for this diagnostic option. It states that the
sampling rate cannot be reached; followed by the number of these events within the
configured interval.
Communication
Function Manual, 11/2024, A5E03735815-AM 347
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Principle of operation
The CPU enters the first three events of an event type in the diagnostics buffer. It then
ignores all subsequent diagnostics of this group.
At the end of the monitoring time (interval), the CPU generates a group alarm in which it
enters the diagnostics and the frequency of this diagnostics during the elapsed interval. If
these diagnostics also occur in the intervals that follow, the CPU only generates one group
alarm per subsequent interval.
A diagnostic surge leaves the following pattern in the diagnostics buffer: Three individual
messages followed by a series of group alarms. This series can consist of two, three or more
group alarms depending on the selected monitoring time and duration of the diagnostic
surge.
① Diagnostic results of a group (of a type), for example "Sampling rate could not be reached".
② Interval (monitoring time): When a diagnostic event occurs the first time (or reoccurs), the
monitoring time is started (or restarted).
③ Single alarms: The first three diagnostic events from the same group are entered in the dia
gnostics buffer immediately. Starting with the fourth diagnostic event, the CPU generates only
group alarms. If a diagnostic event of this group occurs after a pause of at least one interval,
the CPU enters a single alarm in the diagnostics buffer and restarts the monitoring time.
④ Group alarms: After three diagnostic events, the CPU only generates a group alarm as a sum
mary of all additional diagnostic events in this interval. If these diagnostic events also occur in
the intervals that follow, the CPU only generates one group alarm per subsequent interval.
Figure 11-64 Summary of diagnostics
Communication
348 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
PLCopen specification
With these standardized instructions, you can develop an OPC UA client functions in your user
program that can be executed in an S7-1500 CPU.
In addition, it is possible with just a few adaptations to run this user program in controllers of
other manufacturers if these manufacturers have also implemented the OPC UA Specification
"PLCopen OPC UA client for IEC61131-3".
Requirements
• You have the required runtime license for OPC UA and have configured the license in STEP
7 (CPU Properties > Runtime Licenses).
• The client of the S7-1500 CPU is activated.
To use the client of the S7-1500 CPU, you must enable it:
1. Select the area "OPC UA > Client" in the properties of the CPU.
2. Select the "Enable OPC UA client" option.
If you do not enable the client, the connection is not established. You receive a
corresponding error message at the instructions, for example "OPC_UA_Connect".
For information about the application name, which also applies to the server and the client,
see here (Page 246).
Communication
Function Manual, 11/2024, A5E03735815-AM 349
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Overview
To use the editor and the connection parameter assignment, follow these steps:
1. First, specify a client interface. Add to this the PLC tags and PLC methods interface that
you want to access ("First step (Page 355)").
2. Next, configure the connection to the OPC UA server (Second step (Page 370)).
3. Finally, use the configured connection for the OPC UA client instructions (Third step (Page
377)).
23&B8$B'LVFRQQHFW
23&B8$B&RQQHFW
23&B8$B1DPHVSDFH*HW,QGH[/LVW
23&B8$B1RGH*HW+DQGOH/LVW 23&B8$B5HDG/LVW
23&B8$B1RGH5HOHDVH+DQGOH/LVW
23&B8$B:ULWH/LVW
Communication
350 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
23&B8$B'LVFRQQHFW
23&B8$B&RQQHFW
23&B8$B1DPHVSDFH*HW,QGH[/LVW
Optional instructions (reading out the status of a connection / reading out node IDs of
nodes with known hierarchy of the address space)
• OPC_UA_ConnectionGetStatus
• OPC_UA_TranslatePathList
23&B8$B1DPHVSDFH*HW,QGH[/LVW
23&B8$B7UDQVODWLRQ3DWK/LVW
23&B8$B5HDG/LVW
23&B8$B1RGH*HW+DQGOH/LVW 23&B8$B1RGH5HOHDVH+DQGOH/LVW
23&B8$B:ULWH/LVW
① Instructions for preparation of read and write operations with inserted instruction for request
ing, for example, the NodeIDs of nodes of the OPC UA server.
② You can determine the connection status between the establishment and termination of the
connection in parallel with other instructions.
③ Instructions for "clean-up"
Figure 11-67 Run sequence of optional instructions
Communication
Function Manual, 11/2024, A5E03735815-AM 351
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
352 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
OPC UA instruction Maximum number for Maximum number for Maximum number for
CPU 1510SP (F) CPU CPU 1507S (F)
CPU 1511 (C/F/T/TF) 1505 (S/SP/SP F/SP T/SP TF) CPU 1517 (F/T/TF)
CPU 1512C CPU 1515 (F/T/TF) CPU 1518 (F)
CPU 1512SP (F) CPU 1515 SP PC (F/T/TF)
CPU 1513 (F) CPU 1516 (F/T/TF)
OPC_UA_MethodCall 20 in total (max. 5 per con 50 in total (max. 5 per con 200 in total (max. 5 per connec
nection, see nection, see tion, see OPC_UA_Connect)
OPC_UA_Connect) OPC_UA_Connect)
OPC_UA_NodeReleaseHandleList 4* 10* 40*
OPC_UA_MethodRelease 4* 10* 40*
HandleList
OPC_UA_Disconnect 4* 10* 40*
OPC_UA_ConnectionGetStatus 4* 10* 40*
* maximum 1 per connection
Communication
Function Manual, 11/2024, A5E03735815-AM 353
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
354 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2024, A5E03735815-AM 355
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
STEP 7 names the new interface "Client interface_1". If a "Client interface_1" already exists,
the new interface receives the designation "Client interface_2" etc.
In addition, STEP 7 creates the following data blocks:
– Client_Interface_1_Configuration
The data block already contains all system data types that are needed for the
instructions of the OPC UA client.
This data block is filled when you configure the connection to the OPC UA server.
You configure a connection in the properties of the client interface, see: Example
configuration for OPC UA (Page 354).
– Client_Interface_1_Data
A data block for the PLC tags that you want to read or write from an OPC UA server as
well as for methods that you want to call in the OPC UA server.
You use this data block in your user program.
This data block is currently still empty.
5. Select a descriptive name for the new client interface.
Select "Productionline" in the example.
This also changes the names of the associated data blocks to:
– Productionline_Data
– Productionline_Configuration
Communication
356 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
6. To import an OPC UA server interface, click the "Import interface" button in the top right of
the editor.
This allows you to import an XML file which describes the server interface of an OPC UA
server.
Alternative: To determine online the server interface of a connected OPC UA server, see:
Determine server interface online (Page 363).
7. STEP 7 displays a dialog with which you can select an XML file.
This XML file describes a address space of an OPC UA server.
The address space of an OPC UA server contains all PLC tags and server methods published
by an OPC UA server.
OPC UA clients can access this address space:
- Read PLC tags
- Write PLC tags
- Calling Server Methods
The address space of an OPC UA server can be divided into one or more server interfaces.
For creating server interfaces, see: Creating a server interface for companion specification
(Page 278).
8. Create a read list in this client interface.
To do this, follow these steps:
– Click "Add new read list" in the left section of the editor.
STEP 7 adds a new list named "ReadList_1".
For the example, change the name to "ReadListProduct"
– Now add the new read list of the PLC tags that you want to read from the OPC UA
server.
In the example the "NewProduct" and "ProductNumber" tags are added to the
"ReadListProduct" read list.
Select the "NewProduct" tag in the right-hand field of the editor ("OPC UA Server
interface"). Drag the "NewProduct" tag to the "ReadProduct" read list in the middle field
of the editor. Follow the same procedure with the "ProductNumber" tag.
Communication
Function Manual, 11/2024, A5E03735815-AM 357
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
NOTE
Read and write lists do not support all node types.
The OPC UA client of the S7-1500 CPU does not support all OPC UA data types (node
types) that can be made available via an OPC UA server interface. If you place an
unsupported node type, for example, in a read list or write list a corresponding error
signal appears. In this case, you cannot include the corresponding node in the read or
write list.
Which types are supported is described here: Mapping of data types (Page 225)
Communication
358 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
9. If you want assign new values to PLC tags, create a write list in this client interface.
To do this, follow these steps:
– Click "Add new write list" in the left section of the editor.
STEP 7 adds a new list with the name "ReadList_1".
For the example, change the name to "WriteListStatus".
– Now add the new write list of all OPC UA server tags to which you want to assign new
values.
In the example, add the "WriteListStatus" tag to the write list "ProductionEnabled".
Select the Tag of right field of the editor ("OPC UA Server interface"). Drag the tag to
the write list in the middle field of the editor.
Alternative:
You can also create a new write list by selecting a node of the type Object or Folder in the
right field of the editor ("OPC UA server interface") and then dragging to "Add new write
list" in the left field of the editor.
The new write list then contains all tags of the relevant node.
In the example, select the object "Data_from_OPC_UA_Clients", which contains the tag
"ProductionEnabled". STEP 7 generates the new write list "Data_from_OPC_UA_Clients".
Change the name in "WriteListStatus".
The following figure shows the content of the write list:
10. If you want to call a method of this OPC UA server, generate a new method list.
To do this, follow these steps:
– In the left section of the editor, click "Add new method list".
STEP 7 adds a new list with the name "Method list_1".
For the example, change the name to "MethodListOpenDoor".
– Now add a method of the OPC UA server to the new method list.
In this example, add the method "OpenDoor" to the method list
"MethodListOpenDoor".
Select the method of right field of the editor ("OPC UA Server interface"). Drag the
method to the method list in the middle field of the editor.
Alternative:
You can also generate a new method list by selecting a method (node of the type Object)
in the right field of the editor (OPC UA Server interface) and then dragging it to "Add new
method list" in the left field of the editor. The new method list then contains the method
of the relevant node.
Communication
Function Manual, 11/2024, A5E03735815-AM 359
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
STEP 7 compiles the project and updates the data blocks that belong to the "Productionline"
client interface.
NOTE
During compilation, STEP 7 overwrites all data in the data blocks belonging to the client
interface. For this reason, you should neither add to nor correct these data blocks manually.
NOTE
Renaming nod names (DisplayNames)
In read lists, write lists and method lists you can rename the name of a node by means of the
shortcut menu. This is the "DisplayName" in the OPC UA language usage.
If you rename the name of a method list node and the node is already used in a programmed
block for the method call "OPC_UA_MethodCall", the compilation of the project leads to
consistency errors: During the compilation the UDTs of the method are generated with the
changed name. The references to the method used in the program are then no longer
correct.
To correct the consistency errors, you can either undo the name change of the method in the
client interface or navigate to the method call and assign the relevant parameters again there
under "Properties > Block parameters" ("Configuration" tab).
Communication
360 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
• ProductionLine_Data
A data block for the PLC tags that you have entered in the client interface editor.
In the example, this data block is called "Productionline_Data".
The figure below shows the data block.
Communication
Function Manual, 11/2024, A5E03735815-AM 361
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Consistency check
Finally, check the consistency of the read/write list or method list.
1. Select the list that you want to check.
2. Click the "Consistency check" button above the "OPC UA client interface" area.
A green check mark indicates an error-free assignment of the tags or methods to the
corresponding elements of the server interface.
You can assume that the data exchange between client and server and method calls operate
without problem in runtime.
In the event of an error a list appears in the Inspector window. From this list you can jump to
the respective error.
During the consistency check, STEP 7 checks:
• Whether all elements that you use in the respective list are also present in the server.
• Do the data types used match?
• For methods: Do the number, name, order, and data types of method arguments match?
Communication
362 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
4. In the left section of the editor, click "Add new read list", "Add new write list", or "Add new
method list".
5. In the right field of the editor, select "Online[]" as data source for "Source of server data":
Communication
Function Manual, 11/2024, A5E03735815-AM 363
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Tip: When establishing an online connection to an OPC UA server for the first time, use the
"Online access" button. When reconnecting after a disconnection, select the "Connect to
Online Server" button next to the "Online" selection field.
In the top right, enter the IP address of the OPC UA server whose server interface you want
to determine online.
7. Click "Find selected server".
STEP 7 establishes a connection to the OPC UA server and determines all security settings
(server endpoints) that the server holds in readiness.
STEP 7 displays the end points as list:
8. Click on the end point you want to use for a connection of STEP 7 to the OPC UA server.
Communication
364 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2024, A5E03735815-AM 365
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
More information
You can find information about mapping of data types in the section Mapping of data types
(Page 225).
For information on how to create a client interface, refer to the section Creating client
interfaces (Page 355).
Communication
366 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2024, A5E03735815-AM 367
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
368 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
The structure mapped in the read list matches, both in the order and in the assigned data
types, the corresponding nodes of the node set file.
If the structure now changes on the server, for example tagA and tagB are swapped, and the
read list remains the same in the client, the assignment is no longer correct:
• The total length of the data remains the same (only the order has changed)
• The configuration of the structure is different for client and server!
WARNING
No error message in the case of different structure configuration between client and
server
If the structures of client and server do not match, this rule violation will possibly not
generate any error during compilation and also not in runtime.
Make sure not to change the configured assignments for structures in runtime. If required,
reconfigure the assignment in the read and write lists!
Communication
Function Manual, 11/2024, A5E03735815-AM 369
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
With the instructions for OPC UA clients, you create a user program that exchanges data with
an OPC UA server. A series of system data types are required for this.
To simplify your work with these system data types, a connection parameter assignment for
OPC UA clients is available starting in STEP 7 (TIA Portal) Version 15.1.
Use of the connection parameter assignment is optional and not mandatory. You can also
manually create the required system data types.
We use an example to make the description easier to follow, see description of the example
(Page 354).
The section "Create client interface (Page 355)" describes how to create a client interface.
2. Click the "Properties" tab (Inspector window) if the tab is not already displayed.
STEP 7 now displays the connection parameter assignment for the instructions of the OPC
UA client.
The "General" tab is open.
3. Click on the "Configuration" tab and set the connection to the OPC UA server.
Communication
370 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
3. Enter a path within the OPC UA server to restrict access to this path. The information is
optional. However, some servers only establish a connection if a server path is specified.
When you specify a path, it is automatically entered at the "ServerEndpointUrl" entry in the
configuration DB for the client interface. The entry then consists of the components "OPC
Schematic Prefix", "IP address", "Port number" and "Server path", for example:
"opc.tcp://192.168.0.10:4840/example/path".
The following figure shows the entry of the IP address for the OPC UA server:
4. If the OPC UA server is not using the standard port 4840, you must insert the port number
here.
For example, enter the number 65535 in the field, if the OPC UA server to which you want
to establish a connection uses this port number.
5. In addition, you accept the default settings for session timeout (30 seconds) and
monitoring time (5 seconds).
"General" area
Security mode:
Select the security mode that the connection to the OPC UA server must meet from the drop-
down list.
If the server does not meet the selected mode, a session is not established.
Communication
Function Manual, 11/2024, A5E03735815-AM 371
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Security policy:
Set the encryption techniques for the signing and encryption of messages.
The following settings are possible:
• No security
• Basic128Rsa15
• Basic256
• Basic256Sha256
To configure a secure connection, you must observe the following items:
• A certificate is required for the client for a secure connection.
• You have to make the client certificate known to the server.
To find out how to proceed, see the section "Handling client and server certificates (Page
255)" under "Certificate of the OPC UA client".
"Certificates" area
Client certificate:
The certificate confirms the authenticity of the OPC UA client.
To select a certificate, click the following symbol:
Communication
372 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Setting languages
UA tags of the String type can be localized with OPC UA, that is, texts (values for the UA tag)
can be available in different languages for the server. For example, localized texts can be
available for DisplayName (Name of the node) and Description (Description).
In the "Languages" area of the "Configuration" tab you can, for example, influence the
language of the texts returned by the server as follows:
In the "Languages" area, enter a number of languages that the server transfers to the client
during connection setup.
The language or the local ID ("language code") associated with it that you enter in the first
line is the language preferred by the client.
• If the server can provide the UA tag in the requested language, it is transferred to the
client.
• If the server cannot provide the UA tag in the requested language, it checks whether it can
provide the UA tag in the language you have entered in the second line (first substitute
language).
• The server works its way down the list, and when it can provide neither the requested
language nor a substitute language, it will provide the default language.
More information
What causes the connection to an OPC UA server to fail? FAQ.
(https://support.industry.siemens.com/cs/ww/en/view/109766709)
Communication
Function Manual, 11/2024, A5E03735815-AM 373
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Requirements
The IP interface of the CPU is configured, an IP address is available.
Background: The IP address under which the CPU can be accessed in your system is entered
under "Subject Alternative Name (SAN)".
Communication
374 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Result
The server now trusts the client. If the server certificate is also considered trusted, the server
and client can establish a secure connection.
Communication
Function Manual, 11/2024, A5E03735815-AM 375
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
In the OPC UA client interface of the S7-1500, you can set what authentication is required for
a user of the OPC UA client wishing to access the server. To do so, you must select the
corresponding client interface in the project tree of the requested S7-1500 CPU under "OPC
UA communication > Client interfaces" and select the type of user authentication in the
Inspector window under "Properties > Configuration > Security".
NOTE
STEP 7 stores user name and password unencrypted in the data block/instance data block.
Recommendation: Use the user authentication for the "User (TIA Portal - Security
Settings)" TIA project.
Communication
376 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
"No Security" security policy and authentication via user name and password
You can set the following combination:
Security policy = "No Security" and authentication via user name and password.
• The OPC UA server of the S7-1500 supports this combination. OPC UA clients can connect
and encrypt the authentication data or not.
• OPC UA client of the S7-1500 CPU also supports this combination: However, in runtime it
only connects if it can send the authentication data encrypted via cable!
Result: With the following configuration, not connection can be established in runtime.
• S7-1500 as OPC UA client
• OPC UA server which supports no encryption of authentication data when "No Security"
(="none") is set as security policy.
More information
You can find information about the users and roles with OPC UA function rights in the section
Users and roles with OPC UA function rights (Page 265).
Introduction
This section shows you how to use a configured connection for OPC UA instructions (third
step).
Requirements
• You have created a client interface and added PLC tags and PLC methods to this interface,
see ("First step (Page 355)").
• You have configured a connection to an OPC UA server (Second step (Page 370)).
Overview
To read data from an OPC UA server or write data to an OPC UA server, use the following
instructions:
• OPC_UA_Connect
• OPC_UA_NamespaceGetIndexList
• OPC_UA_NodeGetHandleList
• OPC_UA_ReadList or OPC_UA_WriteList
• OPC_UA_NodeReleaseHandleList
• OPC_UA_Disconnect
Communication
Function Manual, 11/2024, A5E03735815-AM 377
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
23&B8$B'LVFRQQHFW
23&B8$B&RQQHFW
23&B8$B1DPHVSDFH*HW,QGH[/LVW
23&B8$B1RGH*HW+DQGOH/LVW 23&B8$B5HDG/LVW
23&B8$B1RGH5HOHDVH+DQGOH/LVW
23&B8$B:ULWH/LVW
Communication
378 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
The editor for the Ladder Logic (LAD) programming language displays the instruction
similarly.
4. Click the toolbox symbol in the editor for FBD or LAD.
The symbol is located in the heading of the instruction:
If you are using the editor for STL or SCL: Click the small green rectangle below the first
character of the instance name:
Communication
Function Manual, 11/2024, A5E03735815-AM 379
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
5. For "Client interface" select the client interface that you want to use for the instruction.
In the example, we select the "ProductionLine" client interface.
STEP 7 now interconnects the "ProductionLine" client interface with the parameters of the
OPC_UA_Connect instruction:
"ProductionLine" is the interface that the OPC UA client of the example (Page 354) uses for
data exchange with the OPC UA server "ProductionLine".
6. Using drag-and-drop, move the "OPC_UA_NamespaceGetIndexList" instruction into the
program editor.
You will find the instruction under "Instructions > Communication > OPC UA" in the TIA
Portal.
Select the "Multi-instance" call option.
Click the toolbox symbol (LAD and FBD) or the small green box below the instance name
(STL and SCL) if the editor is not already open.
Select the client interface that you want to use (in the example "ProductionLine").
STEP 7 now automatically interconnects all parameters of the
"OPC_UA_NamespaceGetIndexList" instruction:
7. Using drag-and-drop, move the "OPC_UA_NodeGetHandleList" instruction into the
program editor.
Select the "Multi-instance" call option.
Click the toolbox symbol (LAD and FBD) or the small green box below the instance name
(STL and SCL) if the editor is not already open.
Select the client interface that you want to use. The example uses the "ProductionLine"
client interface.
Under "Data access > Read/Write list" select the read or write list that you want to use (in
the example the read list "Product").
Communication
380 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
If you want to write data to an OPC UA server, select the write list you want to use under
"Data access > Write list" (the "ProductionStatus" write list in the example).
8. Using drag-and-drop, move the "OPC_UA_ReadList" instruction into the program editor.
Select the "Multi-instance" call option.
Click the toolbox symbol (LAD and FBD) or the small green box below the instance name
(STL and SCL) if the editor is not already open.
Select the client interface that you want to use. The example uses the "ProductionLine"
client interface.
Communication
Function Manual, 11/2024, A5E03735815-AM 381
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Under "Data access > Read list" select the read list that you want to use (in the example
the "Product" read list).
STEP 7 now automatically interconnects all parameters of the "OPC_UA_ReadList"
instruction.
If you want to write data to an OPC UA server, use the "OPC_UA_WriteList" instruction
and select the list of tags you want to send to the server under "Data access > Write list"
("ProductionStatus" write list in the example).
9. If you use different read lists or write lists as program-controlled lists in your user program,
move the "OPC_UA_NodeReleaseHandleList" instruction to the program editor using
drag-and-drop operation.
Select the client interface that you want to use.
Now select a read list or write list that you want to release: Only release read or write lists
that you rarely use, since re-registering is time-consuming.
Then, repeat the steps starting with step 7 with the "OPC_UA_NodeGetHandleList"
instruction.
10. Using drag-and-drop, move the "OPC_UA_Disconnect" instruction into the program
editor.
Select the "Multi-instance" call option.
Click the toolbox symbol (LAD and FBD) or the small green box below the instance name
(STL and SCL) if the editor is not already open.
Select the client interface that you want to use. The example uses the "ProductionLine"
client interface.
STEP 7 now automatically interconnects all parameters of the "OPC_UA_Disconnect"
instruction.
Supported instructions
For the following instructions, STEP 7 automatically supplies the parameters if you are using a
client interface and a configured connection to an OPC UA server:
• OPC_UA_Connect
• OPC_UA_NamespaceGetIndexList
• OPC_UA_NodeGetHandleList
• OPC_UA_MethodGetHandleList
• OPC_UA_MethodReleaseHandleList
• OPC_UA_ReadList
• OPC_UA_WriteList
• OPC_UA_MethodCall
• OPC_UA_NodeReleaseHandleList
• OPC_UA_Disconnect
Communication
382 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.5 Tips and recommendations
Compact instructions
As of TIA Portal V17, compact instructions are available for OPC UA which summarize the
write job/read job/method call and the connection establishment:
• OPC_UA_ReadList_C for generating a connection and reading tags
• OPC_UA_WriteList_C for generating a connection and writing tags
• OPC_UA_MethodCall_C for generating a connection and calling methods
You will find information about the compact instructions services in the TIA Portal Help.
Communication
Function Manual, 11/2024, A5E03735815-AM 383
OPC UA communication
11.5 Tips and recommendations
More information
For information on how to set the server for subscriptions, refer to the section Settings of the
server for subscriptions (Page 252).
Communication
384 Function Manual, 11/2024, A5E03735815-AM
OPC UA communication
11.5 Tips and recommendations
Communication
Function Manual, 11/2024, A5E03735815-AM 385
OPC UA communication
11.5 Tips and recommendations
More information
For information on how to create a user-defined server interface, refer to the section Creating
a user-defined server interface (Page 283).
Communication
386 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP 12
In order to provide future-proof, efficient and flexible automation, more and more
components from the production area support IT standards. Worldwide Ethernet standards,
integrated communication and versatility make IT-supported automation an economical
solution for your requirements. Functional expansions of the communication options of the
S7-1500 CPUs in this direction give you more freedom for the possible uses of your system or
machine. You use IT technology to automate efficiently. With the introduction of DHCP and
the expansions of DNS for S7-1500 CPU as of firmware version V2.9, you gain more flexibility
for the design of your automation solution.
For the interfaces of an S7-1500 CPU you can set that address parameters such as the IP
address with subnet mask, can be got from a DHCPv4 server (hereinafter DHCP server).
Communication
Function Manual, 11/2024, A5E03735815-AM 387
Addressing via DHCP
'+&3VHUYHU
'16VHUYHU 173VHUYHU
5RXWHU
'+&3VHUYHU
GLVWULEXWHG
,3
173
'16
+RVW
'RPDLQ
1HWZRUN
3/&
3/& 3/&
352),1(7
Communication
388 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.1 Principle of address assignment via DHCP
Areas of application
• Use of the S7-1500 CPU in a managed IT environment
• Adding new devices in a modular manufacturing structure
Requirement configuration
The following requirements must be met so that a PROFINET interface of the S7-1500 CPU
can obtain IP address parameters via a DHCP server:
• The address assignment via a DHCP server is configured.
Activate DHCP (Page 395)
• No PROFINET IO communication may be configured for the interface.
'+&3'LVFRYHU
'+&32IIHU
'+&35HTXHVW
'+&3$FNQRZOHGJHPHQW
DHCP Discover The DHCP client searches for a suitable DHCP server via broadcast. The DHCP client
identifies itself to the DHCP server with the configured client ID or with its MAC
address.
DHCP Offer The DHCP server offers the DHCP-client IP address parameters (IPv4 address, subnet
mask, optional default router) and if necessary further data (options).
DHCP Request The DHCPclient requests the IP address parameters and options offered in the DHCP
offer.
The DHCP client of the S7-1500 CPU always accepts the first DHCP offer of a DHCP
server that meets the requirements (IP address with subnet mask).
DHCP Acknow The DHCP server confirms and transmits the IP address parameters and options
ledgment offered in the DHCP offer.
The DHCP server also notifies the DHCP client how long the DHCP client can use the
address parameters (lease time).
Figure 12-2 Principle of address assignment with DHCP
Communication
Function Manual, 11/2024, A5E03735815-AM 389
Addressing via DHCP
12.1 Principle of address assignment via DHCP
The IP address parameters and options are stored in the load memory of the CPU. After a
general reset or restart of the CPU, the IP address parameters and options are obtained again
via DHCP.
How long can the S7-1500 CPU use the DHCP address parameters?
In addition to the address parameters, the DHCP server also notifies the S7-1500 CPU (DHCP
client)of the lease time. The lease time defines how long the CPU can use the address
parameters.
When the lease time has fully expired, the CPU returns the assigned address parameters. The
CPU has an internal time monitoring for the lease time.
At certain times when the lease time expires, the CPU has the option of extending the lease
time:
• Renewal: Half of the lease time has expired: The CPU contacts the original DHCP server
and asks for an extension of the lease time. The original DHCP server can either confirm
the existing lease time or assign a new lease time. With a new lease time, the time
monitoring in the CPU is reset.
• Rebinding: 7/8 of the lease term has expired: The CPU contacts all available DHCP servers
via broadcast and asks for an extension of the lease time. A DHCP server can either
confirm the existing lease time or assign a new lease time. With a new lease time, the
time monitoring in the CPU is reset.
In the event of a negative response from DHCP server during rebinding or if no
DHCP server replies, the CPU returns the address parameters after 8/8 of the lease time.
If the CPU has returned the address parameters after the lease time has expired, the CPU
starts a new cycle for DHCP addressing with a new DHCP discover.
More information
For information on how to configure client ID, refer to the section Configuring the client
ID (Page 396).
Communication
390 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.2 DHCP with DNS
&OLHQW,'
+RVWQDPH
'RPDLQ
Communication
Function Manual, 11/2024, A5E03735815-AM 391
Addressing via DHCP
12.2 DHCP with DNS
NOTE
Validity of the data obtained from DHCP
If you change the host name and/or domain in the user program, then all data obtained
via DHCP (IP suite, host name, domain, NTP server, DNS server) becomes invalid and is
retrieved again from DHCP server. Therefore, you should only change the Hostname
and/or Domain in urgent cases and not during operation.
All connections can be dropped if the IP address of the interface changes.
In the following configuration, the host name and its domain are configured in the
S7-1500 CPU in addition to its client ID. When assigning DHCP addresses, the CPU supplies
the client ID as well as the host name and the domain to the DHCP server.. The DHCP
server receives the information to update, for example a DNS server with the address data
of the CPU.
'+&3VHUYHU
3/&
&OLHQW,'
+RVWQDPH
'RPDLQ
'+&3'16XSGDWH
'16VHUYHU
Communication
392 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.2 DHCP with DNS
well as the host name to the DHCPv4 server. The DHCP server supplies the domain option
to the CPU.
'+&3VHUYHU
3/&
&OLHQW,'
+RVWQDPH
'RPDLQ
Figure 12-5 Configure host name, obtain domain name via DHCP
For this configuration, you must first activate the host name and domain configuration in
STEP 7. Then configure the host name in STEP 7 and configure that the domain is obtained
via DHCP.
Requirements
• You have activated the address assignment via DHCP for at least one interface of the
S7-1500 CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 393
Addressing via DHCP
12.2 DHCP with DNS
Communication
394 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.3 Activate DHCP
Requirements
• S7-1500 CPU firmware V2.9 or higher
Procedure
To activate DHCP for the PROFINET interface of an S7-1500 CPU, follow these steps:
1. Select the PROFINET interface of the S7-1500 CPU in STEP 7.
2. In the properties of the interface, navigate to "Ethernet addresses" > "Internet Protocol
Version 4 (IPv4)".
3. Select the option "IP address of DHCP server".
Result
You have set the interface so that it obtains your IP address via a DHCP server.
"Use MAC address as client ID" is set as the operating mode for DHCP on the S7-1500 CPU.
How to adjust the client ID is described under Configuring the client ID (Page 396).
Communication
Function Manual, 11/2024, A5E03735815-AM 395
Addressing via DHCP
12.4 Configuring the client ID
The client ID
The S7‑1500 CPU always identifies itself to a DHCP server with the client ID (DHCP option 61).
The client ID is interface specific.
The S7-1500 CPU supports the following two operating modes with regard to the client ID:
• Use the MAC address as the client ID: The MAC address of the CPU is used as the client ID
for the DHCP client. Note, if you execute a device exchange of the CPU in this operating
mode, the MAC address and therefore also the client ID changes.
• User-defined client ID: With this option you specify the client ID in the configuration in
STEP 7. You also have the option of adapting the client ID during runtime, for example, in
the user program using the "CommConfig" instruction.
If you perform a device exchange of the CPU in this operating mode, the new CPU is
assigned the configured client ID.
Requirement
• You have activated address assignment via DHCP for the interface.
Communication
396 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.5 Get addresses of the DNS servers via DHCP
NOTE
Validity of data obtained via DHCP
If you change ClientId with "CommConfig", all data obtained via DHCP will be invalid: IP Suite,
domain name, NTP server, DNS server. Therefore, you should only change ClientId in urgent
cases and not during operation.
You can find more information on the instruction "CommConfig" and the UDTs
"Conf_ClientId" and "Conf_ClientId_Opaque" in the STEP 7 online help.
Requirements
• You have activated the address assignment via DHCP for at least one interface of the
S7-1500 CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 397
Addressing via DHCP
12.7 Obtain host and domain name via DHCP
Requirements
• You have activated the address assignment via DHCP for at least one interface of the
S7-1500 CPU.
Requirement
• You have activated the address assignment via DHCP for at least one interface of the
S7-1500 CPU.
• You have activated the host name and domain configuration in STEP 7.
Communication
398 Function Manual, 11/2024, A5E03735815-AM
Addressing via DHCP
12.7 Obtain host and domain name via DHCP
Communication
Function Manual, 11/2024, A5E03735815-AM 399
Routing 13
13.1 Overview of the routing mechanisms of S7-1500 CPUs
The following table gives an overview of the routing mechanisms of the S7-1500 CPU.
Communication
400 Function Manual, 11/2024, A5E03735815-AM
Routing
13.2 S7 routing
13.2 S7 routing
Definition of S7 routing
S7 routing is the transfer of data beyond S7 subnet boundaries. You can send information
from a transmitter to a receiver across several s7 subnets. The gateway from one S7 subnet to
one or more other subnets is provided by the S7 router The S7 router is a device which has
interfaces to the respective S7 subnets. S7 routing is possible via various S7 subnets
(PROFINET/Industrial Ethernet and/or PROFIBUS).
NOTE
Firewall and S7 routing
A firewall does not recognize the IP address of the sender during S7 routing when the sender
is located outside the S7 subnet adjacent to the firewall.
An overview of the devices that support the "S7 routing" function is provided in this FAQ
(https://support.industry.siemens.com/cs/ww/en/view/584459).
Communication
Function Manual, 11/2024, A5E03735815-AM 401
Routing
13.2 S7 routing
&3831'3 &3831'3
&38 &38
3*3& 31 31 31
66XEQHW 352),1(7
66XEQHW 352),1(7
31 31 31 '3 '3
'3PDVWHU '3VODYHDFWLYH
66XEQHW 352),1(7
3*3&
Figure 13-2 S7 routing: PROFINET - PROFIBUS
Communication
402 Function Manual, 11/2024, A5E03735815-AM
Routing
13.2 S7 routing
&3831'3 &3831'3
&38 &38
+0, 31 31 31
66XEQHW 352),1(7
66XEQHW 352),1(7
31 31 '3 '3
'3PDVWHU '3VODYHDFWLYH
Using S7 routing
For the CPU, select the PG/PC interface and the S7 subnet in the "Go online" dialog of STEP 7.
S7 routing is performed automatically.
Communication
Function Manual, 11/2024, A5E03735815-AM 403
Routing
13.2 S7 routing
,2FRQWUROOHU ,GHYLFH
3*3& HJ&3831'3 HJ&3831'3
31 31 31
7HOH6HUYLFH
$GDSWHU 66XEQHW
0RGHP 0RGHP HJ352),1(7
66XEQHW
HJ352),1(7
More information
• The allocation of connection resources with S7 routing is described in the section
Allocation of connection resources (Page 421).
• You can find more information on setting up TeleService in the STEP 7 online help.
• For information on HMI communication, refer to the section HMI communication (Page
129).
• You can find more information on S7 routing and TeleService adapters when you search
the Internet using the following links:
– Device manual Industrial Software Engineering Tools TS Adapter IE Basic
(https://support.industry.siemens.com/cs/us/en/view/51311100)
– Downloads for the TS Adapter
(https://support.industry.siemens.com/cs/us/en/ps/16006/dl)
Communication
404 Function Manual, 11/2024, A5E03735815-AM
Routing
13.3 IP forwarding
13.3 IP forwarding
,3VXEQHW$
9
&38ZLWK
DFWLYDWHG,3
IRUZDUGLQJ
9
,3VXEQHW%
,3SDFNHWV
+0,
Figure 13-6 Access of a programming device to an HMI via IP forwarding
Areas of application
• Easy access from the control level to the field level for configuration and parameter
assignment of field devices, e.g. via PDM or web browser
• Simplified integration of devices for remote access, e.g. for diagnostics during remote
maintenance or firmware update
Communication
Function Manual, 11/2024, A5E03735815-AM 405
Routing
13.3 IP forwarding
IP route table
When IP forwarding is enabled, the CPU forwards received IP packets that are not addressed
to itself. How the CPU forwards the IP packets is defined in its internal IP route table.
The CPU automatically creates the IP route table from the following information of the loaded
hardware configuration:
• IP configuration of the Ethernet interfaces
• Configured router
• For the PC, the IP router, the IO device and the HMI device, the IP addresses of a standard
gateway or the corresponding routes are also entered.
Communication
406 Function Manual, 11/2024, A5E03735815-AM
Routing
13.3 IP forwarding
3&
,3DGGUHVV
5RXWHU
9
,3URXWHU
9
9
&38ZLWK
DFWLYDWHG,3
IRUZDUGLQJ
9 9
,3SDFNHWV
9 9
,2GHYLFH +0,
Figure 13-8 Sample configuration
This example configuration results in the following IP routing table for the CPU.
Communication
Function Manual, 11/2024, A5E03735815-AM 407
Routing
13.3 IP forwarding
In an IP router, you set up additional routes, e.g. via a web interface. Set up the following
route for this example:
• Destination IP subnet: 192.168.2.0
• Subnet mask: 255.255.255.0
• Gateway: 10.10.0.10
Communication
408 Function Manual, 11/2024, A5E03735815-AM
Routing
13.3 IP forwarding
Restrictions
You cannot configure any additional IP routes other than the router ("Standard Gateway") for
an S7-1500 CPU. The network destination is either a connected IP subnet, or the network
destination can be reached via exactly one configurable router. Because the S7‑1500 CPU
does not support additional IP routes, you cannot build bi-directional IP router cascades.
In the following configuration, you can configure either "Router 1" or "Router 2" in the
CPU. "Router 1" is configured as an example. In this case, you cannot configure "Router 2". IP
communication between the PC and the HMI device is not possible because the route is not
continuous in both directions.
3&
,3VXEQHW$
5RXWHU
,3VXEQHW%
&38ZLWK
DFWLYDWHG,3
IRUZDUGLQJ
9
,3VXEQHW&
5RXWHU
,3VXEQHW'
+0,
Figure 13-9 Unsupported IP router cascade
Communication
Function Manual, 11/2024, A5E03735815-AM 409
Routing
13.3 IP forwarding
Reaching C/C++ Runtime of the CPU 1518 4 PN/DP MFP via interfaces X1 or X2
If you activate PN/DP MFP IP forwarding for the CPU 1518 4 PN/DP, you will not only reach
devices in the IP subnet of interface X3 via interfaces X1 and X2, but also C/C++ Runtime.
From the C/C++ Runtime of the CPU 1518 4 PN/DP MFP, you reach all devices in the IP subnets
of the interfaces X1, X2 and X3.
Conditions:
• IP forwarding is enabled for the CPU 1518 4 PN/DP MFP.
• The IP address of C/C++ Runtime and the IP address of interface X3 are located in the same
IP subnet.
• The routes to the IP subnets at X1 and X2 are entered in C/C++ Runtime.
In C/C++ Runtime, enter a route with the following command: "Route add-net <destination
IP subnet> mask <subnet mask> gw <gateway>
The following figure shows a configuration in which a PC accesses the C/C++ Runtime of
CPU 1518-4 PN/DP MFP via interface X2.
,3DGGUHVV
5RXWH
3&
3PVUFBEENBTL
,3SDFNHWV
9 &3831'30)3
ZLWKDFWLYDWHG,3IRUZDUGLQJ
$$ 3VOUJNF
%FGBVMU
3PVUFBEEOFUNBTLHX
9 9 9
Communication
410 Function Manual, 11/2024, A5E03735815-AM
Routing
13.3 IP forwarding
,3VXEQHW$ ,3VXEQHW'
$1
6&$/$1&(6
&38ZLWK
DFWLYDWHG,3
8 IRUZDUGLQJ
9 9
,3VXEQHW% ,3VXEQHW&
,3SDFNHWV
• The CPU accesses all devices within the dark green IP subnets B and C close to the CPU via
the interfaces X1 and X2.
• A SCALANCE S router is configured in the CPU. The CPU accesses the devices in the
remote, light green IP subnet A via the router.
• The "Access to PLC via communication module" function is enabled for the CP 1543 in the
CPU. The CPU reaches all devices within the IP subnet D via W1 interface.
If IP forwarding is activated in the CPU, a device from IP subnet A can access any device within
IP subnets B, C and D close to the CPU.
Protect your automation system and connected devices against unauthorized access from
outside.
Separate the CPU-related IP subnets from the remote IP subnets with a firewall. For example,
use the SCALANCE S security modules with integrated firewall.
This application example (https://support.industry.siemens.com/cs/ww/en/view/22376747)
describes how to protect an automation cell with a firewall using the SCALANCE S602 V3 and
SCALANCE S623 security modules.
Communication
Function Manual, 11/2024, A5E03735815-AM 411
Routing
13.4 Data record routing
Enabling/disablng IP forwarding
To enable IP forwarding, proceed as follows:
1. Select the CPU in the network view of STEP 7 (TIA Portal).
2. In the properties of the CPU of the Inspector window, navigate to "General" > "Advanced
Configuration" > "IP forwarding".
3. In the "Configuration IPv4 Forwarding" area, select the check box "Activate IPv4 for
interfaces of this PLC".
Communication
412 Function Manual, 11/2024, A5E03735815-AM
Routing
13.4 Data record routing
Example: Data record routing with the Port Configuration Tool (PCT)
You can use the Port Configuration Tool (PCT) to configure the IO link master of the ET200
and assign parameters to connected IO link devices. The subnets are connected via data
record routers. Data record routers are, for example, CPUs, CPs, IMs, IO link master.
You can learn about the constellations of data record routers supported by the PCT in this
FAQ (https://support.industry.siemens.com/cs/us/en/view/87611392).
The figure below shows an example configuration with the data record routing with PCT.
63&7
+0,
PROFINET
ET 200SP PROFIBUS
with IO Link Master
RFID RFID
System System
Actuators RF200 RF200
Figure 13-13 Example configuration for data record routing with PCT
Additional information
• The differences that exist between "normal" routing and data record routing are described
in this FAQ (https://support.industry.siemens.com/cs/ww/en/view/7000978).
• Whether or not the CPU, CP or CM you are using supports data record routing can be
found in the relevant manuals.
• The allocation of connection resources with data record routing is described in the section
Allocation of connection resources (Page 421).
• You can find additional information on configuration with STEP 7 in the STEP 7 online
help.
Communication
Function Manual, 11/2024, A5E03735815-AM 413
Routing
13.5 Virtual interface for IP-based applications
23&8$
W1
3DUWQHU
X2 X3 X1 X1
,QGXVWULDO(WKHUQHW
6ZLWFK
Figure 13-14 Principle of the virtual interface
Communication
414 Function Manual, 11/2024, A5E03735815-AM
Routing
13.5 Virtual interface for IP-based applications
Compared to conventional interfaces, the virtual interface has the following restrictions:
• No access to the web server over the virtual interface.
• Online backup is not possible via a connected programming device with the TIA Portal.
• If the CPU and communication partners are connected via the virtual interface, they
cannot exchange data via LLDP (Link Layer Discovery Protocol).
• The S7 routing service does not use the virtual interface W1.
Requirement
For a CPU service to be accessible via the Ethernet interface of a CP, the following
requirements must be fulfilled:
• S7‑1500 CPU as of firmware version V2.8
• CP 1543‑1 as of firmware version V2.2
Recommendation: Use a CP 1543‑1 as of firmware version V3.0. As of this version, the
security functions (firewall) are also available for the virtual interface and no additional
firewall needs to be installed between the station and an insecure network.
After selecting the CP, the specifications and parameters for the virtual interface are
displayed. You can edit the settings for the IP protocol and the PROFINET parameters here.
• The IP subnet is freely selectable, just like with the CP. The IP subnet is entered via the
subnet mask and IP address of the virtual interface.
• When entering the IP subnet for the virtual interface, note that you are not using the same
IP subnet as for the local interfaces of the CPU.
Once the IP address is entered, it is shown in the properties dialog of the OPC UA server in the
list of server addresses. These settings provide the CPU with the new W1 virtual interface, via
which the CPU services described above, such as the OPC UA server, can be accessed via a
Communication
Function Manual, 11/2024, A5E03735815-AM 415
Routing
13.5 Virtual interface for IP-based applications
NOTE
The IP address of the virtual interface is not listed as W1 in the device display under the
currently displayed local interfaces (Xn) but is available under "Addresses" in the "Settings"
section. The virtual interface is also visible when no CP is plugged or when the virtual
interface is not activated. If no IP suite is available, the IP address and the subnet mask are
0.0.0.0.
If you change the configured and loaded IP address parameters of the virtual interface via
display, T_CONFIG instruction, or online, the loaded configuration is active again after the
CPU restarts.
Communication
416 Function Manual, 11/2024, A5E03735815-AM
Routing
13.5 Virtual interface for IP-based applications
NOTE
Checking the manual configuration
If the firewall is enabled, you need to manually check whether the desired services are
allowed by the firewall. Only enable those services for the IP and MAC filters that you also
want to access via the CP interface. See the notes on security settings and firewall rules of the
S7‑1500 CPs in the information system of the TIA Portal.
Settings in the communications module (CP 1543‑1, FW version V2.2, < V3.0)
The security functions of the CP 1543‑1 with a firmware version lower than V3.0 cannot
secure data traffic via the virtual interface. Although you can activate the security functions in
the TIA Portal, it is not possible to compile such a configuration.
NOTICE
Connecting to non-secure networks
If you connect the CP to a non-secure network, it is imperative that you place an additional
firewall between the CP and the non-secure network. You can use the SCALANCE S602 V3
and SCALANCE S623 Security Modules with integrated firewall, for example.
Communication
Function Manual, 11/2024, A5E03735815-AM 417
Connection resources 14
14.1 Connection resources of a station
Introduction
Some communications services require connections. Connections occupy resources in the
automation system (station). The connection resources are made available to the station by
the CPUs, communications processors (CPs) and communications modules (CMs).
Communication
418 Function Manual, 11/2024, A5E03735815-AM
Connection resources
14.1 Connection resources of a station
The figure below shows an example of how individual components make connection
resources available to an S7-1500 station.
" # $ %
Communication
Function Manual, 11/2024, A5E03735815-AM 419
Connection resources
14.1 Connection resources of a station
Example
You have configured a CPU 1516-3 PN/DP with a CM 1542-1 communications module and a
CP 1542-5 communications processor.
• Maximum connection resources of the station: 256
• Available connection resources:
– CPU 1516-3 PN/DP: 128
– CM 1542-1: 64
– CP 1542-5: 16
– Total: 208
The setup provides 208 connection resources. By adding further communications modules,
the station can support a maximum of 48 additional connection resources.
Communication
420 Function Manual, 11/2024, A5E03735815-AM
Connection resources
14.2 Allocation of connection resources
More information
Information on the connection resources of the S7-1500R/H redundant system is available in
the section Connection resources of the redundant system S7-1500R/H (Page 446).
+0,
6 6
Communication
Function Manual, 11/2024, A5E03735815-AM 421
Connection resources
14.2 Allocation of connection resources
Table 14-2 Maximum occupied connection resources for different HMI devices
HMI device Maximum occupied connection resources of the
station per HMI connection
Basic Panel 1
Unified Basic Panel 3
Comfort Panel 21
Unified Comfort Panel 3
Mobile Panel 21
RT Advanced 21
RT Professional 3
Unified PC 3
1 If you do not use system diagnostics or alarm configuration, the station occupies only one connec
tion resource per HMI connection.
Example: You have configured the following HMI connections for a CPU 1516‑3 PN/DP:
• Two HMI connections to an HMI TP700 Comfort. (2 connection resources each)
• One HMI connection to an HMI KTP1000 Basic. (1 connection resource)
In total 5 connection resources are occupied for HMI communication in the CPU.
NOTE
Lack of resources due to temporary connection resources
A lack of connection resources occurs in the following situation:
• The OPC UA client of the CPU establishes or closes several connections simultaneously.
• The number of available connection resources of the station is insufficient for permanent
and temporary connection resources of the OPC UA client communication.
Ensure that there are always enough available connection resources in the station to
establish and end OPC UA connections.
Measures:
• Plan enough reserve for the OPC UA client connections.
• If necessary, establish or close the OPC UA connections one after the other.
Communication
422 Function Manual, 11/2024, A5E03735815-AM
Connection resources
14.2 Allocation of connection resources
NOTE
Connection resources with data record routing
With data record routing, on the data record router, two special connection resources for S7
routing are occupied. Neither the data record connection nor the allocated connection
resources are displayed in the table of connection resources.
Communication
Function Manual, 11/2024, A5E03735815-AM 423
Connection resources
14.2 Allocation of connection resources
Offline
During configuration of connections, STEP 7 monitors the occupation of the connection
resources. If the maximum possible number of connection resources is exceeded, STEP 7
signals this with a suitable warning.
Online
The CPU monitors the use of connection resources in the automation system. If you establish
more connections in the user program than those provided by the automation system, the
CPU acknowledges the instruction to establish the connection with an error.
Communication
424 Function Manual, 11/2024, A5E03735815-AM
Connection resources
14.3 Display of the connection resources
Figure 14-4 Example: Reserved and available connection resources (offline view)
Communication
Function Manual, 11/2024, A5E03735815-AM 425
Connection resources
14.3 Display of the connection resources
The warning triangle in the column of the dynamic station resources is displayed because the
sum of the maximum available connection resources of CPU, CP and CM (= 310 connection
resources) exceeds the station limit of 256.
NOTE
Available connection resources exceeded
STEP 7 signals the exceeding of the station-specific connection resources with a warning. To
make full use of the connection resources from the CPU, CP and CM, either use a CPU with a
higher maximum number of available station-specific connection resources or reduce the
number of communications connections.
Communication
426 Function Manual, 11/2024, A5E03735815-AM
Connection resources
14.3 Display of the connection resources
The online view of the "Connection resources" table in addition to the offline view also
contains columns with the connection resources currently being used. Thus, the online view
displays all used connection resources in the automation system, regardless of how the
connection was set up.
The "Other communication" row displays connection resources assigned for communication
with external devices. The table is updated automatically.
NOTE
If a routed S7 connection goes through a CPU, the required connection resources of the CPU
do not appear in the table of connection resources.
Communication
Function Manual, 11/2024, A5E03735815-AM 427
Connection resources
14.3 Display of the connection resources
Communication
428 Function Manual, 11/2024, A5E03735815-AM
Diagnostics and fault correction 15
15.1 Connection diagnostics
After selecting the connection in the connections table, you obtain detailed diagnostic
information in the "Connection information" tab.
Communication
Function Manual, 11/2024, A5E03735815-AM 429
Diagnostics and fault correction
15.1 Connection diagnostics
Communication
430 Function Manual, 11/2024, A5E03735815-AM
Diagnostics and fault correction
15.1 Connection diagnostics
Communication
Function Manual, 11/2024, A5E03735815-AM 431
Diagnostics and fault correction
15.2 Emergency address
Additional information
You will find the description of the web server functionality in the function manual Web serv
er (https://support.industry.siemens.com/cs/us/en/view/59193560).
Requirements
• You have selected "Set IP address in the project" for the IP protocol in the device
configuration in STEP 7.
• No configuration with enabled DCP write protection loaded.
• The CPU is in STOP mode.
Result
The CPU starts up with the valid IP address.
Communication
432 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system
S7-1500R/H 16
Introduction
Communication with the S7‑1500R/H redundant system basically functions as with the
S7‑1500 standard system.
This chapter describes the special features and restrictions for communication with the
S7‑1500R/H redundant system.
Communication
Function Manual, 11/2024, A5E03735815-AM 433
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
Introduction
In addition to the device IP addresses of the CPUs, the S7‑1500R/H redundant system also
supports these system IP addresses:
• System IP address for the PROFINET interfaces X1 of the two CPUs (system IP address X1)
• System IP address for the PROFINET interfaces X2 of the two CPUs (system IP address X2)
• System IP address for the PROFINET interfaces X3 of the two CPUs (system IP address X3)
You use the system IP addresses for communication with other devices (for example, HMI
devices, CPUs, PCs). The devices always communicate over the system IP address with the
primary CPU of the redundant system. This ensures, for example, that the communication
partner can communicate with the new primary CPU (previously backup CPU) in the RUN‑Solo
system state after failure of the original primary CPU in redundant operation.
There is a virtual MAC address for each system IP address.
You enable the system IP addresses in STEP 7.
Applications
You use the system IP addresses for the following applications:
• HMI communication with the S7‑1500R/H redundant system: You can use an HMI device
to control or monitor the process on the redundant S7 1500R/H system.
• Open User Communication with the S7‑1500R/H redundant system:
– Another CPU or an application on a PC accesses data of the S7‑1500R/H redundant
system.
– The S7‑1500R/H redundant system accesses a different device.
TCP, UDP and ISO‑on‑TCP‑connections are possible.
• IP forwarding: If you use the system IP addresses as the gateway/default route for IP routes
through the S7‑1500R/H redundant system, IP packets are forwarded even if a CPU fails.
Requirements
• The interface of the communication partner is connected to both CPUs, each via the same
interface (e.g. X2).
• The system IP address for the interfaces of the S7‑1500R/H system is enabled.
Communication
434 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
,QGXVWULDO(WKHUQHW
6\VWHP,3DGGUHVV;
5&38 5&38
3ULPDU\ %DFNXS
; ; ; ;
352),1(7,2
,2'HYLFH
① Open User Communication between another CPU and the S7‑1500R redundant system
② HMI communication with the S7‑1500R redundant system
③ Open User Communication between the S7‑1500R redundant system and a PC
Figure 16-1 Example: Communication of the S7‑1515R redundant system via the system IP address X2
Communication
Function Manual, 11/2024, A5E03735815-AM 435
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
,QGXVWULDO(WKHUQHW
6\VWHP,3DGGUHVV;
5&38 5&38
3ULPDU\ %DFNXS
; ;
,2'HYLFH
6ZLWFK
① Open User Communication between the S7‑1500R redundant system and another CPU
② HMI communication with the S7‑1500R redundant system
③ Open User Communication between the S7‑1500R redundant system and a PC
Figure 16-2 Example: Communication of the S7‑1513R redundant system via the system IP address X1
Communication
436 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
,QGXVWULDO(WKHUQHW
6\VWHP,3DGGUHVV;
5&38 5&38
3ULPDU\ %DFNXS
; ; ; ;
6\VWHP,3DGGUHVV;
352),1(7,2
+0,
,2'HYLFH
6ZLWFK
① Open User Communication between the S7‑1500R redundant system and another CPU
② HMI communication with the S7‑1500R redundant system
③ Open User Communication between the S7‑1500R redundant system and a PC
Figure 16-3 Example: Communication of the S7‑1515R redundant system via the system IP
addresses X1 and X2
With an S7‑1500H(F) system, you also have the option of dividing your system into several
PROFINET rings.
In this case, you must connect the required S1/S2 devices in a separate PROFINET ring behind
a Y‑switch.
Recommendation: For increased availability of the S1/S2 devices, you need two Y-switches
with DNA redundancy (SCALANCE XF204‑2BA DNA). One Y‑switch takes on the roles of MRP
manager and DNA manager. Another Y‑switch takes on the roles of MRP client and DNA
client. DNA redundancy is only possible with a connected PROFINET ring.
Communication
Function Manual, 11/2024, A5E03735815-AM 437
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
You can find more information on configuration scenarios with Y‑switches in the S7-1500R/H
Redundant System (https://support.industry.siemens.com/cs/ww/en/view/109754833) System
Manual.
,3VXEQHW$
*DWHZD\
6\VWHP,3DGGUHVV;
5&38 5&38
(QDEOH,3
IRUZDUGLQJ
,3SDFNHWV
; ; ; ;
6\VWHP,3DGGUHVV;
6ZLWFK
*DWHZD\ ,3VXEQHW%
+0,
Figure 16-4 Example: IP forwarding via system IP addresses
Communication
438 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.1 System IP addresses for R/H CPUs
NOTE
Uniqueness of the virtual MAC address
The S7-1500R/H redundant system uses a MAC address from the address range
00-00-5E-00-01-00 to 00-00-5E-00-01-00 for each system IP address. This address range
is also used for VRRP (Virtual Redundancy Protocol).
If you use devices with VRRP, e.g. switches, ensure the uniqueness of the MAC addresses
within an Ethernet broadcast domain.
Result: The X1 system IP address for the X1 PROFINET interface of the two CPUs is enabled.
Communication
Function Manual, 11/2024, A5E03735815-AM 439
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
Introduction
As of STEP 7 V19, you have the option of expanding redundant S7‑1500R/H systems as of
FW‑version V3.1 with CP 1543‑1 communications processors as of FW‑version V3.0. When
extended with CP 1543‑1 communications processors, R/H‑CPUs support the configuration of
a W1 virtual interface with device and system IP‑addresses. The communication partners
connected to the CPs communicate with the R/H-CPUs via these IP addresses.
You can enable the system IP address of W1 in STEP 7.
There is a virtual MAC address for each system IP address.
NOTE
If you communicate with the redundant system via the device IP addresses, you should
preferably use the device IP address of the primary CPU. The transfer rate is better and the
communication load is lower via the device IP address of the primary CPU.
You can find more information about the "RH_CTRL" instruction in the online help for STEP 7.
You can find information about configuring the system IP address for the W1 virtual interface
and the virtual MAC address in the Redundant System S7‑1500R/H
(https://support.industry.siemens.com/cs/us/en/view/109754833) System Manual.
Communication
440 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
*OEVTUSJBM&UIFSOFU
4ZTUFN*1BEESFTT8PGUIF$16T
3$16 $1 3$16
1SJNBSZ #BDLVQ
8 8
9 9 9 9
*0EFWJDF
Communication
Function Manual, 11/2024, A5E03735815-AM 441
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
NOTE
Primary-backup switchover in S7‑1500H systems with an active backplane bus
If there is a failure of a CP in an S7‑1500H system with an active backplane bus, no primary-
backup switchover takes place. In this case, set up the primary-backup switchover in your
user program if required.
In the following figure, the PC is connected to the two X1 interfaces of the CPs 1543‑1. For
the route to the HMI device, the assigned W1 system IP address is entered in the PC as the
router. The HMI device is connected via a switch to the PROFINET ring of the S7‑1500R
redundant system. In the HMI device, the X1 system IP address of the CPUs is entered as the
router.
3&
,3VXEQHW$
*DWHZD\
6\VWHP,3DGGUHVV:RIWKH&38V
3$16 3$16
,3FRPPXQLFDWLRQ QSJNBSZ CBDLVQ (QDEOH,3
IRUZDUGLQJ
8 8
9 9 9 9
6\VWHP,3DGGUHVV;RIWKH&38V
6ZLWFK
*DWHZD\ *1TVCOFU#
+0,
Figure 16-7 Example: IP forwarding via the system IP addresses of CPUs and CPs
Communication
442 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
Communication
Function Manual, 11/2024, A5E03735815-AM 443
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
Communication
444 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.4 Response to Snycup
More information
A description of the program-controlled switching of the system IP address can be found
under the special instructions for redundant systems S7-1500R/H in the System Manual
S7-1500R/H (https://support.industry.siemens.com/cs/us/en/view/109754833).
Response of communication connections via the system IP address in the system state SYNCUP
• HMI, PG‑ and S7‑connections are temporarily closed. For a short time during the SYNCUP it
is not possible to establish connections to the S7‑1500R/H redundant system.
• All existing connections of Open User Communication are interrupted:
– Connections set up by the CPUs of the redundant system as an active connection
partner are set up again after the SYNCUP.
– The S7‑1500R/H redundant system sets up connection endpoints again for the passive
connection establishment after the SYNCUP.
• The processing of running instances of the instructions TSEND and TRCV is stopped. The
block parameter STATUS returns 80C4H (temporary communication error).
Communication
Function Manual, 11/2024, A5E03735815-AM 445
Communication with the redundant system S7-1500R/H
16.6 Connection resources of the redundant system S7-1500R/H
NOTE
Increased duration of connection interruption
If the remote system does not transmit actively after the primary-backup switchover, the
connection monitoring (e.g. TCP-Keep-Alive or application) may have to be performed by the
remote system until the connection can be re-established.
Communication
446 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.6 Connection resources of the redundant system S7-1500R/H
Connect via... Connection resources of the Connection resources CPU Connection resources CPU
station with redundancy ID 1 with redundancy ID 2
a system IP address X X X
a device IP address of the CPU X X -
with redundancy ID 1
a device IP address of the CPU X - X
with redundancy ID 2
Figure 16-9 Display of the connection resources of the S7‑1500R/H redundant system in STEP 7
Communication
Function Manual, 11/2024, A5E03735815-AM 447
Communication with the redundant system S7-1500R/H
16.7 HMI communication with the redundant system S7-1500R/H
Requirements
• A S7-1500R/H redundant system, e.g. CPU 1513R‑1PN
• System IP address is enabled
• HMI device with PROFINETI interface
Procedure
To set up a HMI connection to an S7‑1500R/H redundant system, follow these steps:
1. In the network view of STEP 7, select a PROFINET interface of the HMI device.
2. Using a drag&drop operation, draw a line between the PROFINET interface of the HMI
device and a PROFINET interface of the S7‑1500R/H redundant system.
The HMI device and the S7‑1500R/H redundant system are networked together.
Figure 16-10 Networking an HMI device with the S7‑1500R/H redundant system
3. In the list of functions, click the "Connections" icon. This activates connection mode.
4. Using a drag-and-drop operation, draw a line between the HMI device and a CPU of the
S7‑1500R/H redundant system.
The list "Connection partners" opens.
Communication
448 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.7 HMI communication with the redundant system S7-1500R/H
NOTE
Automatic setup of HMI connection
When you drag-and-drop a tag from the S7‑1500R/H redundant system into an HMI screen or
into the HMI tag table, STEP 7 automatically sets up an HMI connection. This HMI connection
exists by default between the PROFINET interface of the HMI device and the PROFINET
interface X1 of the CPU with redundancy ID 1. The connection uses the device IP address of
the PROFINET interface X1.
You can change the HMI connection to a system IP address in the properties of the HMI
connection.
More information
You can set up an HMI connection to the S7‑1500R/H redundant system via the devices IP
address. With help of scripts in the HMI configuration, the connection of the failed CPU are
switched automatically to the still running CPU. A description to this procedure can be found
in the following FAQ (https://support.industry.siemens.com/cs/us/en/view/109781687).
Communication
Function Manual, 11/2024, A5E03735815-AM 449
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
Introduction
S7‑1500R/H systems as of FW version V3.1 also support Secure Open User Communication
(Secure OUC).
If you extend an S7‑1500R/H system as of FW version V3.1 with CP 1543‑1 communications
processors, you can also use Secure OUC via these connected CPs.
Requirements:
• STEP 7 as of V19
• CP 1543‑1 as of FW version V3.0
Secure Open User Communication protocols for the S7‑1500R/H redundant system
The following table shows which protocols of the Open User Communication you can use for
the S7‑1500R/H redundant system and the matching system data types and instructions.
Table 16-1 Protocols, system data types, and instructions that can be used for Open User Communica
tion with the S7‑1500R/H redundant system
Protocol System data type Instructions
TCP • TCON_QDN Establish connection and send/receive
• TCON_QDN_SEC data via:
TLS over TCP
• TCON_IP_v4 • TSEND_C/TRCV_C or
• TCON_IP_V4_SEC • TCON, TSEND/TRCV or
• TCON, TUSEND/TURCV
ISO-on-TCP • TCON_IP_RFC
(connection can be terminated via
TDISCON)
UDP • TCON_IP_v4 Establish connection and send/receive
• TADDR_Param data via:
• TADDR_SEND_QDN • TSEND_C/TRCV_C
• TADDR_RCV_IP • TUSEND/TURCV/TRCV
(connection can be terminated via
TDISCON)
Modbus TCP • TCON_IP_v4 • MB_CLIENT
• TCON_IP_V4_SEC • MB_RED_CLIENT
• TCON_QDN • MB_SERVER
• TCON_QDN_SEC • MB_RED_SERVER
Communication
450 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
16.8.1 Setting up the connection of the Open User Communication with the
redundant S7-1500R/H system
Communication
Function Manual, 11/2024, A5E03735815-AM 451
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
Requirements
• A redundant S7‑1500R/H system as TCP client, e.g. 2 CPUs 1513‑1PN
• System IP address of the PROFINET interface X1 is enabled
• Connection partner as TCP server, e.g. CPU 1516‑3 PN/DP
• The X1 PROFINET interfaces of the redundant 1513R CPUs and the X2
PROFINET interface of the CPU 1516‑3PN/DP are located in the same subnet.
Communication
452 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
4. In "Partners" under "End point:" select the CPU 1516‑3PN/DP as the communication
partner.
5. In "Partners" under "Interface:" select the PROFINET interface X2 of the CPU 1516‑3PN/DP.
6. In "Local" under "Connection data" select the setting "<new>".
STEP 7 creates a data block for the connection data in the user program of the S7‑1500R/H
redundant system, for example "PLC_1_Send_DB".
"TCP" is set by default as the connection type.
7. In "Partners" under "Connection type" select the setting "NEW".
STEP 7 creates a data block for the connection data in the user program of the other CPU,
for example "PLC_3_Receive_DB".
Communication
Function Manual, 11/2024, A5E03735815-AM 453
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
Communication
454 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
More information
You can find more information on system states in the S7‑1500R/H
(https://support.industry.siemens.com/cs/ww/en/view/109754833) system manual.
You can find more information on the configuration and parameter assignment of your
PROFINET IO system in the PROFINET Function Manual
(https://support.industry.siemens.com/cs/ww/en/view/49948856).
Communication
Function Manual, 11/2024, A5E03735815-AM 455
Communication with the redundant system S7-1500R/H
16.8 Open User Communication with the redundant system S7-1500R/H
Introduction
You can use both Open User Communication (OUC) as well as Secure OUC via the CP 1543‑1
communications processors.
If you want to use Secure OUC, the following additional requirements must be met so that
you can handle the device and CA certificates:
• Project protection is activated
• Security functions are enabled in each CP 1543‑1 you want to use for Secure OUC.
• Same security settings in each CP on both primary and backup CPUs in the same slot
• The same CA certificates are configured for both CPs
• The device certificates of the CPs each refer to both CPs, e.g. configure an Subject
Alternative Name (SAN) in both device certificates
NOTE
No automatic synchronization of the security settings
In STEP 7, the security settings are not automatically synchronized between the CPs.
Therefore, configure the CPs in the same slot of the primary and backup CPUs identically.
Communication
456 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
More information
You can find information on how to create or assign certificates in the Managing certificates
(Page 64) section.
You can find information about Secure Open User Communication via a CP interface in the
Secure OUC via CP interface (Page 97) section.
16.9.1 Information worth knowing on the OPC UA server in the S7-1500R/H system
As of firmware version V3.1, S7-1500R/H CPUs support OPC UA server functions. An OPC UA
client is not supported.
The extensions for the OPC UA server of S7-1500R/H systems comply with the OPC 10000-4
specification: Services (Rel. 1.04), taking into account the restrictions described below.
The OPC UA server is accessible via all the integrated interfaces of the CPUs as well as via a CP
1543-1. To this end, the CP must be connected via the virtual interface W1 of the CPU (area
"Access to PLC via communication module" in the CPU properties).
An OPC UA server facilitates open and standardized access to the CPU. In the R/H system, an
OPC UA server runs on each of the two CPUs. The OPC UA servers of the primary and backup
CPUs synchronize via redundancy mechanisms. In redundant operation, from the perspective
of an OPC UA client, it is a server application.
Communication
Function Manual, 11/2024, A5E03735815-AM 457
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
Compared to standard CPUs, S7-1500R/H CPUs offer an advanced information model. With
this advanced information model, it is possible for clients to take into account the specific
features of the redundant system.
From the perspective of an OPC UA client, the same mechanisms are used to access the
S7-1500R/H system (e.g. Discovery Service) as when accessing standard S7-1500 CPUs.
Communication
458 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
CAUTION
Thorough testing of the maximum cycle time during the commissioning phase
During the commissioning phase, check whether the S7-1500R/H system works reliably
with the set maximum cycle time even under worst-case conditions (alarms,
communication load from maximum number of clients including
connection/disconnection).
Requirements
• TIA Portal V19 with installed Hardware Support Package
(HSP) "HSP_V19_0445_001_S71500_RH_3.1".
The S7-1500R/H CPUs are installed with this HSP.
Redundancy at OPC UA
The redundant system consisting of two or more servers is called a "Redundant Server Set" in
OPC UA. Server redundancy in accordance with the OPC UA specification recognizes the
following operating modes (Modes of Redundancy):
• Transparent Mode (transparent Redundancy)
In transparent operating mode, the server is solely responsible for failover in the event of
an error (Failover). The OPC UA client does not require any redundancy knowledge to
continue the data exchange. To work in Transparent Mode, the client must connect to the
system IP address of the CPU interface. If you are using a CP 1543-1, use the virtual
interface W1 of the CPU with the configured system IP address.
• Non-transparent Mode (non-transparent Redundancy)
In non-transparent mode, the client is responsible for switching from one server to the
other in the event of an error (Failover). The client must initiate the required actions in
order to benefit from the redundant system. To work in non-transparent Mode, the client
must connect to the corresponding device IP addresses of the R/H CPUs. If you are using a
CP 1543-1, use the virtual interfaces W1 of the CPUs with configured device IP addresses
An S7-1500R/H system supports both operating modes.
The Redundant Server Set provides access to information on availability via the "ServiceLevel"
variable; a byte that numerically reflects the "Health status" of a server.
Communication
Function Manual, 11/2024, A5E03735815-AM 459
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
The ServiceLevel allows conclusions to be drawn about the redundancy status, e.g. whether
the CPU is the primary or backup CPU or whether the system is in the RUN-Redundant system
state. You can find information on the ServiceLevel in the section on non-transparent mode
(Page 462).
More information
You can find additional and up-to-date information on using the OPC UA server with
S7-1500R/H systems in the following entry: FAQ How do you use the OPC UA server in an
S7-1500 R/H system? (https://support.industry.siemens.com/cs/ww/en/view/109822965)
7UDQVSDUHQW5HGXQGDQW6HW
6HUYHU
&OLHQW &OLHQWDQGSURFHVVLQIR
6KDUHG
6HUYHU85,DQG
(QGSRLQW85/
6HUYHU
&OLHQWDQGSURFHVVLQIR
Communication
460 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
You can determine the ServerState and ServiceLevel of the redundant servers using the
RedundantServerArray:
You can find more information on the ServiceLevel in the next section.
Communication
Function Manual, 11/2024, A5E03735815-AM 461
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
1RQ7UDQVSDUHQW5HGXQGDQW6HW
6HUYHU
6HUYHU85,
&OLHQW (QGSRLQW85/ &OLHQWDQGSURFHVVLQIR
6HUYHU
6HUYHU85,
(QGSRLQW85/ &OLHQWDQGSURFHVVLQIR
Communication
462 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
The following figure from the specification OPC 10000-4: Services shows the steps that the
client goes through when it receives the signal to switch to the "Alternate server" due to a low
ServiceLevel value for the "Source server".
+RWDQG
6RXUFH6HUYHU 0LUURUHG $OWHUQDWH6HUYHU
2SHQ6HFXUH&KDQQHO
6WDUWXS
&UHDWH6HVVLRQ 2SHQ6HFXUH&KDQQHO
$FWLYDWH6HVVLRQ $FWLYDWH6HVVLRQ
0RQLWRU&RQQHFWLRQ
&UHDWH6XEVFULSWLRQ
&UHDWH0RQLWRUHG,WHPV
6XEVFULSWLRQV
(UURU 2. UHVXPH
6WDWXV
$FWLYDWH6DPSOLQJ
6ZLWFK6HUYHUV
$FWLYDWH3XEOLVKLQJ
ServiceLevel
ServiceLevel is a variable that is modeled as a property of the ServerType object in the address
space of the server. You use the ServiceLevel to find out whether the addressed server is still
supplying data, for example. The ServiceLevel is a numerical value for the "Health status" of
the server and thus provides the client with a trigger for switching the server.
The structure of the ServerType object is described in the OPC 10000-5: Information Model
specification, section "ServerType".
For S7-1500R/H, the following ServiceLevel values apply to the respective OPC UA server:
• RUN-Redundant: ServiceLevel primary CPU = 255 (CPU in RUN), service level backup
CPU = 227 (CPU in RUN).
• CPU in STOP: ServiceLevel of the failed CPU (RUN STOP transition) = 1 (NoData). This is
the trigger for the client for the failover.
Communication
Function Manual, 11/2024, A5E03735815-AM 463
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
The client can connect to the H system via the two independent networks. The two H CPUs
are not connected via one of the networks. In this way, the failure of a network can be
tolerated.
Independent subnets are not a requirement for non-transparent mode. You can also use non-
transparent mode for configurations with a subnet.
Communication
464 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
In the ServerRedundancy object below, a client can find all the required information to
connect to the R/H system.
The ServerUriArray-Property allows a client to select a suitable server. The information on
which network paths can be used to access the servers can be found via the object type
NonTranparentNetworkRedundancyType - a subtype of NonTransparentRedundancyType. The
object type NonTranparentNetworkRedundancyType references the ServerNetworkGroups
variable, which contains an array of servers (EndpointUrlList) together with information on
which redundant network paths exist for each server (NetworkPaths).
You can find a detailed description of the relevant nodes with their references below the
VendorServerInfo node in the OPC UA specification (OPC 10000‑5: Information Model).
For an S7-1500R/H system, the EndpointUrlList contains an entry for each device IP address or
virtual device IP address (if configured together with a CP 1543-1) via which the servers of
the S7-1500R/H system can be accessed. In the event of a failure, the client can decide
whether to connect to the same server via a different path or whether to choose the
redundant server.
Communication
Function Manual, 11/2024, A5E03735815-AM 465
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
Node Contents Accessible data in the RUN-Redund Accessible data in the RUN-Solo system
<configured ant system state state
name>
<R/H system> Information regarding the Server interface data (identical for Client is connected with:
R/H system both CPUs) • Primary CPU: Data of the server inter
CPU-specific information of the face of the primary CPU.
primary CPU • Backup CPU: Server interface data (if
ServiceLevel = NoData: server interface
data is invalid or not available).
<PLC 1> Information via R/H CPU Server interface data (identical for Client is connected with:
with redundancy ID 1 both CPUs) • PLC 1 (= primary CPU): Data of the serv
CPU-specific information of the CPU er interface of the primary CPU.
with redundancy ID 1 • PLC 1 (= backup CPU): Server interface
data (ServiceLevel = NoData signifies
the data is invalid or not available).
• PLC 2 (= backup CPU): No data (access
error BadInvalidState /
(BadResourceUnavailable))
Communication
466 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
Node Contents Accessible data in the RUN-Redund Accessible data in the RUN-Solo system
<configured ant system state state
name>
<PLC 2> Information via R/H CPU Server interface data (identical for Client is connected with:
with redundancy ID 2 both CPUs) • PLC 2 (= primary CPU): Data of the serv
CPU-specific information of the CPU er interface of the primary CPU.
with redundancy ID 2 • PLC 2 (= backup CPU): Server interface
data (ServiceLevel = NoData signifies
the data is invalid or not available).
• PLC 1 (= backup CPU): No data (access
error BadInvalidState /
(BadResourceUnavailable))
Operating mode
The OperatingMode-Property below the R/H system node shows the operating mode of the
primary CPU for the R/H system node.
The following values are defined for the individual CPUs of the R/H system and for the R/H
system:
Communication
Function Manual, 11/2024, A5E03735815-AM 467
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
RedundancyMode
The RedundancyMode-Property shows the system status of the R/H system and is only
available in the R/H system node.
Communication
468 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
Communication
Function Manual, 11/2024, A5E03735815-AM 469
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
Communication
470 Function Manual, 11/2024, A5E03735815-AM
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
NOTE
When switching to the OPC UA server methods from version V1.0 to version V1.1, check
whether your user program takes into account the described rules and the adapted
functionality. Adjust the program if necessary.
Example program
FUNCTION_BLOCK "mySERVER_METHOD"
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
VAR DB_SPECIFIC
UAMethod_InParameters : Struct
IN_BOOL : Bool;
IN_INT : Int;
END_STRUCT;
UAMethod_OutParameters : Struct
OUT_BOOL : Bool;
OUT_INT : Int;
END_STRUCT;
END_VAR
VAR
OPC_UA_ServerMethodPre_Instance {InstructionName :=
'OPC_UA_ServerMethodPre'; LibVersion := '1.1'} :
OPC_UA_ServerMethodPre;
DONE_PRE { S7_SetPoint := 'True'} : Bool;
BUSY_PRE : Bool;
ERROR_PRE : Bool;
STATUS_PRE : DWord;
UAMethod_Called : Bool;
OPC_UA_ServerMethodPost_Instance {InstructionName :=
'OPC_UA_ServerMethodPost'; LibVersion := '1.1'} :
OPC_UA_ServerMethodPost;
UAMethod_Result { S7_SetPoint := 'True'} : DWord;
UAMethod_Finished : Bool;
DONE_POST { S7_SetPoint := 'True'} : Bool;
BUSY_POST : Bool;
ERROR_POST : Bool;
Communication
Function Manual, 11/2024, A5E03735815-AM 471
Communication with the redundant system S7-1500R/H
16.9 Using an OPC UA server in an S7-1500R/H system
STATUS_POST : DWord;
END_VAR
BEGIN
#OPC_UA_ServerMethodPre_Instance(Done => #DONE_PRE,
Busy => #BUSY_PRE,
Error => #ERROR_PRE,
Status => #STATUS_PRE,
UAMethod_Called => #UAMethod_Called,
UAMethod_InParameters := #UAMethod_InParameters);
//Method is called
IF #UAMethod_Called AND NOT #ERROR_PRE THEN
(* Functionality:
InParameters are valid
and copied to OutParameters *)
#UAMethod_OutParameters.OUT_BOOL := #UAMethod_InParameters.IN_BOOL;
#UAMethod_OutParameters.OUT_INT := #UAMethod_InParameters.IN_INT;
#UAMethod_Result := 0;
#UAMethod_Finished := TRUE;
END_IF;
#OPC_UA_ServerMethodPost_Instance(UAMethod_Result :=
#UAMethod_Result,
UAMethod_Finished := #UAMethod_Finished,
Done => #DONE_POST,
Busy => #BUSY_POST,
Error => #ERROR_POST,
Status => #STATUS_POST,
UAMethod_OutParameters := #UAMethod_OutParameters);
#UAMethod_Finished := FALSE;
#UAMethod_Result := 0;
END_IF;
END_FUNCTION_BLOCK
Communication
472 Function Manual, 11/2024, A5E03735815-AM
Industrial Ethernet Security with CP 1543-1 17
All-round protection - the task of Industrial Ethernet Security
With Industrial Ethernet Security, individual devices, automation cells or network segments of
an Ethernet network can be protected. Data transfer can also be protected by a combination
of different security measures:
• Data espionage
• Data manipulation
• Unauthorized access
Security measures
• Firewall
– IP firewall with stateful packet inspection (layer 3 and 4)
– Firewall also for Ethernet "non-IP" frames according to IEEE 802.3 (layer 2)
– Bandwidth limitation
– Global firewall rules
All network nodes located in the internal network segment of a CP 1543‑1 are protected
by its firewall. Exception: If you access the CPU via the interface of the CP with the "Access
to PLC via communication module" function, the firewall does not protect this connection.
• Logging
To allow monitoring, events can be stored in log files that can be read out using the
configuration tool or can be sent automatically to a Syslog server.
• HTTPS
For encrypted transfer of websites, for example during process control.
• FTPS (explicit mode)
For encrypted transfer of files.
• Secure NTP
For secure time-of-day synchronization and transmission.
• SNMPv3
For secure transmission of network analysis information safe from eavesdropping.
Communication
Function Manual, 11/2024, A5E03735815-AM 473
Industrial Ethernet Security with CP 1543-1
17.1 Firewall
• VPN groups
You can combine the CP 1543-1 with other security modules into VPN groups through
configuration. IPsec tunnels are established between all the security modules of a VPN
group (VPN). All internal nodes of these security modules can communicate securely with
each other through this tunnel.
• Protection for devices and network segments
The firewall and VPN groups protective functions can be applied to the operation of single
devices, multiple devices, or entire network segments.
Additional information
An overview with links to the most important contributions on Industrial Security is available
in this FAQ (https://support.industry.siemens.com/cs/ww/en/view/92651441).
17.1 Firewall
Firewall rules
Firewall rules describe which packets are permitted or forbidden in which direction.
Communication
474 Function Manual, 11/2024, A5E03735815-AM
Industrial Ethernet Security with CP 1543-1
17.3 NTP client
17.2 Logging
Functionality
For test and monitoring purposes, the security module has diagnostics and logging functions.
• Diagnostics functions
These include various system and status functions that you can use in online mode.
• Logging functions
This involves the recording of system and security events. Depending on the event type,
the recording is made in volatile or non-volatile local buffer areas of the CP 1543‑1. As an
alternative, it is also possible to record on a network server.
The parameter assignment and evaluation of these functions is only possible with a
network connection.
Functionality
To check the time validity of a certificate and the time stamp of log entries, the date and time
are maintained on the CP 1543‑1 as on the CPU. This time can be synchronized with NTP. The
CP 1543-1 forwards the synchronized time to the CPU via the backplane bus of the
automation system. This way the CPU also receives a synchronized time for the time events in
program execution.
The automatic setting and periodic synchronization of the time takes place either via a secure
or non-secure NTP server. You can assign a maximum of 4 NTP servers to the CP 1543‑1. A
mixed configuration of non-secure and secure NTP servers is not possible.
Communication
Function Manual, 11/2024, A5E03735815-AM 475
Industrial Ethernet Security with CP 1543-1
17.5 VPN
17.4 SNMP
Functionality
Like the CPU, the CP 1543‑1 supports the transfer of management information using the
Simple Network Management Protocol (SNMP). To achieve this, an "SNMP agent" is installed
on the CP/CPU that receives and responds to the SNMP queries. Information about the
properties of devices capable of SNMP is contained in so-called MIB files (Management
Information Base) for which the user needs to have the appropriate rights.
With SNMPv1, the "community string" is also sent. The "community string" is like a password
that is sent along with the SNMP query. The requested information is sent when the
"community string" is correct. The request is discarded when the string is incorrect.
With SNMPv3, data can be transferred encrypted. To do this, select either an authentication
method (e.g. SHA) or an authentication and encryption method (e.g AES).
You can activate and deactivate the use of SNMP for the CP/CPU. Deactivate SNMP if the
security guidelines in your network do not permit SNMP or if you use your own SNMP
solution.
To find out how to activate and deactivate SNMP for the CPU, refer to section SNMP (Page
119).
17.5 VPN
Functionality
For security modules that protect the internal network, VPN (Virtual Private Network) tunnels
provide a secure data connection through the non-secure external network.
The module uses the IPsec protocol (tunnel mode of IPsec) for tunneling.
In STEP 7 you can assign VPN groups to security modules. VPN tunnels are automatically
established between all modules of a VPN group. A module in one project can belong to
several different VPN groups at the same time in the process.
Communication
476 Function Manual, 11/2024, A5E03735815-AM
Glossary
Automation system
Programmable logic controller for the open-loop and closed-loop control of process chains of
the process engineering industry and manufacturing technology. The automation system
consists of different components and integrated system functions according to the
automation task.
Backup CPU
If the R/H system is in RUN-Redundant system state, the primary CPU controls the process. The
backup CPU processes the user program synchronously and can take over process control if
the primary CPU fails.
Bus
Transmission medium that connects several devices together. Data transmission can be
performed electrically or via optical fibers, either in series or in parallel.
Client
Device in a network that requests a service from another device in the network (server).
CM
→ Communications module
Communications module
Module for communications tasks used in an automation system as an interface expansion of
the CPU (for example PROFIBUS) and providing additional communications options (PtP).
Communications processor
Module for expanded communications tasks covering special applications, for example in the
area of security.
Consistent data
Data that belongs together in terms of content and must not be separated when transferred.
CP
→ Communications processor
Communication
Function Manual, 11/2024, A5E03735815-AM 477
Glossary
CPU
Central Processing Unit - Central module of the S7 automation system with a control and
arithmetic unit, memory, operating system and interface for programming device.
Device
Generic term for:
• Automation systems (PLC, PC, for example)
• Distributed I/O systems
• Field devices (for example, PLC, PC, hydraulic devices, pneumatic devices) and
• Active network components (for example, switches, routers)
• Gateways to PROFIBUS, AS interface or other fieldbus systems
Device certificates
Such certificates are signed by a certificate authority (CA).
The signature of an end-entity certificate is checked with the public key of the certificate
authority certificate.
The "Subject" attribute must not be identical to the "Issuer" attribute.
The "Subject", for example, contains the name of a program as with the OPC UA application
certificate.
"Issuer" is the certificate authority that signed the certificate.
The "CA" field must be set to "False".
DP master
Within PROFIBUS DP, a master in the distributed I/O that behaves according to the EN 50170
standard, Part 3.
→ See also DP slave
DP slave
Slave in the distributed I/O that is operated on PROFIBUS with the PROFIBUS DP protocol and
behaves according to the EN 50170 standard, Part 3.
→ See also DP master
Duplex
Data transmission system; a distinction is made between full and half duplex.
Half duplex: One channel is available for alternate data exchange (sending or receiving
alternately but not at the same time).
Full duplex: Two channels are available for simultaneous data exchange in both directions
(simultaneous sending and receiving in both directions).
Communication
478 Function Manual, 11/2024, A5E03735815-AM
Glossary
End-entity certificate
→ See also device certificate
Ethernet
International standard technology for local area networks (LAN) based on frames. It defines
types of cables and signaling for the physical layer and packet formats and protocols for
media access control.
FETCH/WRITE
Server services using TCP/IP, ISO-on-TCP and ISO for access to system memory areas of S7
CPUs. Access (client function) is possible from a SIMATIC S5 or a third-party device/PC. FETCH:
Read data directly; WRITE: Write data directly.
Field device
→ Device
Freeport
Freely programmable ASCII protocol; here for data transfer via a point-to-point connection.
FTP
File Transfer Protocol; a network protocol for transferring files via IP networks. FTP is used to
download files from the server to the client or to upload files from the client to the server.
FTP directories can also be created and read out and directories and files can be renamed or
deleted.
HMI
Human Machine Interface, device for visualization and control of automation processes.
IE
→ Industrial Ethernet
IM
→ Interface module
Communication
Function Manual, 11/2024, A5E03735815-AM 479
Glossary
Industrial Ethernet
Guideline for setting up an Ethernet network in an industrial environment. The essential
difference compared with standard Ethernet is the mechanical ruggedness and immunity to
noise of the individual components.
Instruction
The smallest self-contained unit of a user program characterized by its structure, function or
purpose as a separate part of the user program. An instruction represents an operation
procedure for the processor.
Interface module
Module in the distributed I/O system. The interface module connects the distributed I/O
system via a fieldbus to the CPU (IO controller/DP master) and prepares the data for the I/O
modules.
Intermediate CA certificate
This is a certificate authority certificate that is signed with the private key of a root certificate
authority.
An intermediate certificate authority signs end-entity certificates with its private key.
The signature of these end-entity certificates is verified with the public key of the
intermediate certificate authority.
The "Subject" and "Issuer" attributes of the intermediate CA certificate must not be identical.
This certificate authority has after all not signed its certificate itself.
The "CA" field must be set to "True".
IP address
Binary number that is used as a unique address in computer networks in conjunction with the
Internet Protocol (IP). It makes these devices uniquely addressable and individually accessible.
An IPv4 address can be evaluated using a binary subnet mask that results in a network part or
a host part as a structure. The textual representation of an IPv4 address consists, for example,
of 4 decimal numbers with the value range 0 to 255. The decimal numbers are separated by
periods.
Communication
480 Function Manual, 11/2024, A5E03735815-AM
Glossary
ISO protocol
Communications protocol for message or packet-oriented transfer of data in an Ethernet
network. This protocol is hardware-oriented, very fast and allows dynamic data lengths. The
ISO protocol is suitable for medium to large volumes of data.
ISO-on-TCP protocol
Communications protocol capable of S7 routing for packet-oriented transfer of data in an
Ethernet network; provides network addressing. The ISO-on-TCP protocol is suitable for
medium and large volumes of data and allows dynamic data lengths.
MAC address
Worldwide unique device identification for all Ethernet devices. The MAC address is assigned
by the manufacturer and has a 3-byte vendor ID and 3-byte device ID as a consecutive
number.
Master
Higher-level, active participant in the communication/on a PROFIBUS subnet. The master has
rights to access the bus (token) and can request and send data.
→ See also DP master
Modbus RTU
Remote Terminal Unit; Open communications protocol for serial interfaces based on a
master/slave architecture.
Modbus TCP
Transmission Control Protocol; Open communications protocol for Ethernet based on a
master/slave architecture. The data are transmitted as TCP/IP packets.
Network
A network consists of one or more interconnected subnets with any number of devices.
Several networks can exist alongside each other.
Communication
Function Manual, 11/2024, A5E03735815-AM 481
Glossary
NTP
The Network Time Protocol (NTP) is a standard for synchronizing clocks in automation
systems via Industrial Ethernet. NTP uses the connectionless UDP transport protocol for the
Internet.
OPC UA
OPC Unified Automation is a protocol for communication between machines, developed by
the OPC Foundation.
Operating states
Operating states describe the behavior of a single CPU at a specific time.
The CPUs of the SIMATIC standard systems have the STOP, STARTUP and RUN operating
states.
The primary CPU of the redundant system S7-1500R/H has the operating states STOP,
STARTUP, RUN, RUN-Syncup and RUN-Redundant. The backup CPU has the operating states
STOP, SYNCUP and RUN-Redundant.
Operating system
Software that allows the use and operation of a computer. The operating system manages
resources such as memory, input and output devices and controls the execution of programs.
PG
→ Programming device
PNO
→ PROFIBUS user organization
Point-to-point connection
Bidirectional data exchange via communications modules with a serial interface between two
communications partners (and two only).
Port
Physical connector to connect devices to PROFINET. PROFINET interfaces have one or more
ports.
Primary CPU
If the R/H system is in RUN-Redundant system state, the primary CPU controls the process. The
backup CPU processes the user program synchronously and can take over process control if
the primary CPU fails.
Communication
482 Function Manual, 11/2024, A5E03735815-AM
Glossary
PROFIBUS
Process Field Bus - European Fieldbus standard.
PROFIBUS address
Unique identifier of a device connected to PROFIBUS. The PROFIBUS address is sent in the
frame to address a device.
PROFIBUS device
Device with at least one PROFIBUS interface either electrical (for example RS-485) or optical
(for example Polymer Optical Fiber).
PROFIBUS DP
A PROFIBUS with DP protocol that complies with EN 50170. DP stands for distributed I/O =
fast, real-time capable, cyclic data exchange. From the perspective of the user program, the
distributed I/O is addressed in exactly the same way as the centralized IO.
PROFINET
Open component-based industrial communications system based on Ethernet for distributed
automation systems. Communications technology promoted by the PROFIBUS user
organization.
PROFINET device
Device that always has a PROFINET interface (electrical, optical, wireless).
PROFINET interface
Interface of a module capable of communication (for example CPU, CP) with one or more
ports. A MAC address is assigned to the interface in the factory. Along with the IP address and
the device name (from the individual configuration), this interface address ensures that the
PROFINET device is identified uniquely in the network. The interface can be electrical, optical
or wireless.
Communication
Function Manual, 11/2024, A5E03735815-AM 483
Glossary
PROFINET IO
IO stands for input/output; distributed I/O (fast, cyclic data exchange with real-time
capability). From the perspective of the user program, the distributed I/O is addressed in
exactly the same way as the centralized IO.
PROFINET IO as the Ethernet-based automation standard of PROFIBUS & PROFINET
International defines a cross-vendor communication, automation, and engineering model.
With PROFINET IO, a switching technology is used that allows all devices to access the
network at any time. In this way, the network can be used much more efficiently through the
simultaneous data transfer of several devices. Simultaneous sending and receiving is enabled
via the full-duplex operation of Switched Ethernet.
PROFINET IO is based on switched Ethernet with full-duplex operation and a bandwidth of
100 Mbps.
Programming device
Programming devices are essentially compact and portable PCs which are suitable for
industrial applications. They are identified by a special hardware and software configuration
for programmable logic controllers.
Protocol
Agreement on the rules by which the communication between two or more communication
partners transpires.
PtP
Point-to-Point, interface and/or transmission protocol for bidirectional data exchange
between two (and only two) communications partners.
Redundant systems
Redundant systems have multiple (redundant) instances of key automation components.
Process control is maintained if a redundant component fails.
Ring topology
All devices of a network are connected together in a ring.
Root CA certificates
→ See also root certificate
Root certificate
This is the certificate of a certificate authority: It signs end-entity certificates and intermediate
CA certificates with its private key.
The "Subject" attribute and the "Issuer" of this certificate must be identical. This certificate
authority has signed its certificate itself.
The "CA" field must be set to "True".
Communication
484 Function Manual, 11/2024, A5E03735815-AM
Glossary
Router
Network node with a unique identifier (name and address) that connects subnets together
and allows transportation of data to uniquely identified communications nodes in the
network.
RTU
Modbus RTU (RTU: Remote Terminal Unit, transfers the data in binary form; allows a good
data throughput. The data must be converted to a readable format before it can be
evaluated.
S7 routing
Communication between S7 automation systems, S7 applications or PC stations in different
S7 subnets via one or more network nodes functioning as S7 routers.
SDA service
Send Data with Acknowledge. SDA is an elementary service with which an initiator (for
example DP master) can send a message to other devices and then receives acknowledgment
of receipt immediately afterwards.
SDN service
Send Data with No Acknowledge. This service is used primarily to send data to multiple
stations and the service therefore remains unacknowledged. Suitable for synchronization
tasks and status messages.
Security
Generic term for all the measures taken to protect against
• Loss of confidentiality due to unauthorized access to data
• Loss of integrity due to manipulation of data
• Loss of availability due to the destruction of data
Self-signed certificates
These are certificates that you sign with your private key and use as end-entity certificates.
Communication
Function Manual, 11/2024, A5E03735815-AM 485
Glossary
The signature of these end-entity certificates is verified with your public key.
The "Subject" and "Issuer" attributes of self-signed certificates must be identical: You have
signed your certificate yourself.
The "CA" field must be set to "False".
You can, for example, use self-signed certificates as application certificates for an OPC UA
client.
The procedure required to generate a self-signed certificate with the certificate generator of
the OPC Foundation is described here (Page %getreference).
Server
A device or more generally an object that can provide certain services; the service is
performed at the request of a client.
Slave
Distributed device in a fieldbus system that can only exchange data with a master after the
master has requested this.
→ See also DP slave
SNMP
Simple Network Management Protocol, uses the wireless UDP transport protocol. SNMP
works in much the same way as the client/server model. The SNMP manager monitors the
network nodes. The SNMP agents collect the various network-specific information in the
individual network nodes and makes this information available in a structured form in the
MIB (Management Information Base). This information allows a network management
system to run detailed network diagnostics.
Subnet
Part of a network whose parameters must be matched up on the devices (for example in
PROFINET). A subnet includes the bus components and all connected stations. Subnets can be
linked together, for example using gateways or routers to form one network.
Switch
Network components used to connect several terminal devices or network segments in a
local network (LAN).
Switched communication
In addition to the device IP addresses of the CPUs, the redundant system S7‑1500R/H supports
system IP addresses:
• System IP address for the X1 PROFINET interfaces of the two CPUs (system IP address X1)
• System IP address for the X2 PROFINET interfaces of the two CPUs (system IP address X2)
You use the system IP addresses for communication with other devices (for example, HMI
devices, CPUs, PG/PC). The devices always communicate over the system IP address with the
primary CPU of the redundant system. This ensures that the communication partner can
Communication
486 Function Manual, 11/2024, A5E03735815-AM
Glossary
communicate with the new primary CPU (previously backup CPU) in the RUN-Solo system
state after failure of the original primary CPU in redundant operation.
System states
The system states of the redundant system S7-1500R/H result from the operating states of
the primary and backup CPUs. The term system state is used as a simplified expression that
refers to the operating states that occur simultaneously on both CPUs. The redundant system
S7-1500R/H has the system states STOP, STARTUP, RUN-Solo, SYNCUP and RUN-Redundant.
TCP/IP
Transmission Control Protocol / Internet Protocol, connection-oriented network protocol,
generally recognized standard for data exchange in heterogeneous networks.
Time-of-day synchronization
Capability of transferring a standard system time from a single source to all devices in the
system so that their clocks can be set according to the standard time.
Tree topology
Network topology characterized by a branched structure: Two or more bus nodes are
connected to each bus node.
Twisted-pair
Fast Ethernet via twisted-pair cables is based on the IEEE 802.3u standard (100 Base-TX). The
transmission medium is a shielded 2x2 twisted-pair cable with an impedance of 100 Ohms
(22 AWG). The transmission characteristics of this cable must meet the requirements of
category 5.
The maximum length of the connection between the terminal and the network component
must not exceed 100 m. The connectors are designed according to the 100Base-TX standard
with the RJ-45 connector system.
UDP
User Datagram Protocol; communications protocol for fast and uncomplicated data transfer,
without acknowledgment. There are no error checking mechanisms as found in TCP/IP.
User program
In SIMATIC, a distinction is made between the CPU operating system and user programs. The
user program contains all instructions, declarations and data by which a system or process
can be controlled. The user program is assigned to a programmable module (for example,
CPU, FM) and can be structured in smaller units.
USS
Universal Serial Interface protocol (Universelles Serielles Schnittstellen-Protokoll); defines an
access method according to the master-slave principle for communication via a serial bus.
Communication
Function Manual, 11/2024, A5E03735815-AM 487
Glossary
Web server
Software/communications service for data exchange via the Internet. The web server
transfers the documents using standardized transmission protocols (HTTP, HTTPS) to a Web
browser. Documents can be static or put together dynamically from different sources by the
web server on request from the Web browser.
Communication
488 Function Manual, 11/2024, A5E03735815-AM
Index
A Connection resources
Overview, 44
Advanced Encryption Algorithm, 57 Overview, 418
AES, 57 HMI communication, 422
Applicant, 60 S7 routing, 423
Data record routing, 423
Asymmetric encryption, 58 occupying, 423
Station specific, 425
B Module-specific, 426
C D
Certificate authorities, 60 Data consistency, 49
Communication
Function Manual, 11/2024, A5E03735815-AM 489
Index
H OPC UA
Introduction, 173
Handshake Protocol, 59 NodeId, 178
HMI communication, 33, 129 Namespace, 178
Identifier, 179
Security mechanisms, 186
I
Signing and encryption, 189
IM, 32 X.509 certificates, 191
Industrial Ethernet Security, 473 Certificate generator, 192
OpenSSL, 193
Interface module, 32 Secure channel, 196
Interfaces for communication, 29 Secure connection, 196
Interfaces of communications modules Layer model, 197
Point-to-point connection, 31 GDS, 199
GDS, 204
Interfaces of communications processors, 30
Security settings, 223
IP address, emergency address (temporary), 432 End points, 223
IP forwarding, 405 PLC tags, 235
DB tags, 235
ISO, 33, 132
OPC UA client
ISO-on-TCP, 132, 140 Basics, 183
Certificate, 374
L Authentication, 376
OPC UA server
Logging, 475 Address space, 180
Basics, 221
M Write and read rights, 235
Performance, 243
Man-in-the-middle attack, 60 Performance increase, 243
Modbus protocol (RTU), 163 XML export file, 244
Modbus TCP, 133 Commissioning, 246
Application name, 247
Addressing, 248
N TCP port, 250
NTP, 33, 475 Subscription, 250
TCP port, 252
Publishing interval, 253
O Sampling interval, 253
Occupation of connection resources, 423 Generating a server certificate, 255
Security settings, 258
Customizing the server certificate, 261
Authentication, 264
Runtime licenses, 268
Runtime licenses, 269
Open communication
Connection configuration, 140
Setting up TCP, ISO-on-TCP, UDP , 140
Setting up e-mail, 150
Setting up FTP, 151
Communication
490 Function Manual, 11/2024, A5E03735815-AM
Index
Communication
Function Manual, 11/2024, A5E03735815-AM 491