s71500 Communication Function Manual en-US en-US
s71500 Communication Function Manual en-US en-US
FUNCTION MANUAL
SIMATIC
S7-1500, ET 200MP, ET 200SP,
ET 200AL, ET 200pro, ET 200eco PN
Communication
support.industry.siemens.com
Introduction
1
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 AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
1 Introduction........................................................................................................................................ 11
1.1 Function Manuals documentation guide........................................................................... 17
1.1.1 Information classes Function Manuals............................................................................... 17
1.1.2 Basic tools........................................................................................................................ 18
1.1.3 S7 Port Configuration Tool (S7-PCT).................................................................................. 20
1.1.4 S7 Failsafe Configuration Tool (S7-FCT)............................................................................. 20
1.1.5 MultiFieldbus Configuration Tool (MFCT).......................................................................... 21
1.1.6 SIMATIC Technical Documentation.................................................................................... 22
2 Security information........................................................................................................................... 24
2.1 General security information............................................................................................. 24
3 Industrial cybersecurity...................................................................................................................... 25
3.1 Cybersecurity information................................................................................................. 25
3.2 Security-relevant information in this manual..................................................................... 26
4 Product overview................................................................................................................................ 27
5 Communications services................................................................................................................... 32
5.1 Overview of communication options................................................................................. 32
5.2 Communications protocols and port numbers used for Ethernet communication............... 34
5.3 Overview of connection resources..................................................................................... 40
5.4 Setting up a connection.................................................................................................... 41
5.5 Data consistency............................................................................................................... 44
5.6 Secure Communication..................................................................................................... 47
5.6.1 Basics of Secure Communication....................................................................................... 47
5.6.1.1 Useful information on Secure Communication................................................................... 47
5.6.1.2 Device-dependent security features................................................................................... 50
5.6.1.3 Confidentiality through encryption.................................................................................... 51
5.6.1.4 Authenticity and integrity through signatures.................................................................... 54
5.6.2 Managing certificates........................................................................................................ 57
5.6.2.1 What you should know about the certificate management................................................. 57
5.6.2.2 Certificate management with TIA Portal............................................................................ 58
5.6.2.3 Examples for the management of certificates.................................................................... 61
5.6.2.4 How communication with certificates works: HTTP over TLS.............................................. 65
5.6.3 Requirements for secure communication.......................................................................... 68
5.6.3.1 Protection of confidential configuration data..................................................................... 68
5.6.3.2 Useful information for the protection of confidential PLC configuration data...................... 70
5.6.3.3 Changing your password................................................................................................... 72
5.6.3.4 Resetting the password..................................................................................................... 73
Communication
Function Manual, 11/2023, A5E03735815-AL 5
Table of contents
6 PG communication.............................................................................................................................. 114
9 S7 communication.............................................................................................................................. 140
Communication
6 Function Manual, 11/2023, A5E03735815-AL
Table of contents
Communication
Function Manual, 11/2023, A5E03735815-AL 7
Table of contents
Communication
8 Function Manual, 11/2023, A5E03735815-AL
Table of contents
13 Routing............................................................................................................................................... 353
13.1 Overview of the routing mechanisms of S7-1500 CPUs...................................................... 353
13.2 S7 routing........................................................................................................................ 353
13.3 IP forwarding.................................................................................................................... 358
13.4 Data record routing........................................................................................................... 365
13.5 Virtual interface for IP-based applications.......................................................................... 366
Communication
Function Manual, 11/2023, A5E03735815-AL 9
Table of contents
Glossary.............................................................................................................................................. 411
Index................................................................................................................................................... 422
Communication
10 Function Manual, 11/2023, A5E03735815-AL
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
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 25)
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/2023, A5E03735815-AL 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 34)
tion those settings that are relevant to your application.
Updated information about the Updated information on the following connection Connection resources (Page 371)
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 391).
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. 400)
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 34)
tion those settings that are relevant to your application.
Activate / Deactivate the SNMP Depending on the FW version of the S7-1500 SNMP (Page 106)
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 366)
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 296)
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 205)
"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/2023, A5E03735815-AL
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 57)
ates mechanism, without separate download of the Automated certificate management
hardware configuration. with GDS (Page 182)
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 96)
• 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 68)
• 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 182)
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 274)
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 341)
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/2023, A5E03735815-AL 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 345)
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 358)
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 153)
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/2023, A5E03735815-AL
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 385)
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 239)
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. 93)
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 91)
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 153)
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/2023, A5E03735815-AL 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 79)
Certificate handling in STEP 7 You can manage certificates for the following Section Certificate management with
applications in STEP 7: TIA Portal (Page 58)
• 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 106)
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/2023, A5E03735815-AL
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/2023, A5E03735815-AL 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)
Tools
The tools described below support you in all steps: from planning, over commissioning, all
the way to analysis of your system.
Communication
18 Function Manual, 11/2023, A5E03735815-AL
Introduction
1.1 Function Manuals documentation guide
As successor of the SIMATIC Selection Tools , the TIA Selection Tool assembles the already
known configurators for automation technology into a single tool.
With the TIA Selection Tool , you can generate a complete order list from your product
selection or product configuration.
You can find the TIA Selection Tool on the Internet.
(https://support.industry.siemens.com/cs/ww/en/view/109767888)
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 19
Introduction
1.1 Function Manuals documentation guide
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).
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
Communication
20 Function Manual, 11/2023, A5E03735815-AL
Introduction
1.1 Function Manuals documentation guide
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/2023, A5E03735815-AL 21
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
22 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 23
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 25).
Communication
24 Function Manual, 11/2023, A5E03735815-AL
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 11).
Communication
Function Manual, 11/2023, A5E03735815-AL 25
Industrial cybersecurity
3.2 Security-relevant information in this manual
Communication
26 Function Manual, 11/2023, A5E03735815-AL
Product overview 4
CPUs, communications modules and processors, and PC systems of the S7‑1500, ,
ET 200MPET 200SPET 200pro and ET 200AL systems provide you with interfaces for
communication via PROFINET, PROFIBUS and point-to-point connections.
&3831'3 &386331
Communication
Function Manual, 11/2023, A5E03735815-AL 27
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
28 Function Manual, 11/2023, A5E03735815-AL
Product overview
Communication
Function Manual, 11/2023, A5E03735815-AL 29
Product overview
Communication
30 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 31
Communications services 5
5.1 Overview of communication options
Communication
32 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.1 Overview of communication options
Communication
Function Manual, 11/2023, A5E03735815-AL 33
Communications services
5.2 Communications protocols and port numbers used for Ethernet communication
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 385).
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
34 Function Manual, 11/2023, A5E03735815-AL
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 the S7‑1500 CPU. Many
communication protocols and implementations enable you to use other port numbers.
The following tables show the different layers and protocols used in the S7‑1500 CPUs and in
the S7‑1500 communications 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
tection 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.
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.
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/2023, A5E03735815-AL 35
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
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 connection without RPC. Default: Enabled (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 enabled by the following con
(PROFINET) PTCP provides a time delay measure figurations:
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 communications 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.
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.
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/2023, A5E03735815-AL
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
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. The following applies to FW versions
ded
lower than V3.0:
As of FW • Programmed connections: 5001
version ... 49152
V3.0, the • Configured connections: 5001 ...
following 65535
applies to
pro
grammed
and con
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.
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/2023, A5E03735815-AL 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
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.
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 to 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
tection mode during an active com
munication relationship.
Communication
38 Function Manual, 11/2023, A5E03735815-AL
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
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 communications 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
Function Manual, 11/2023, A5E03735815-AL 39
Communications services
5.3 Overview of connection resources
Protocol / Role Port num (2) Link layer Description / function Notes / default setting
ber (4) Transport lay
er
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.
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.
Communication
40 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.4 Setting up a connection
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 371).
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/2023, A5E03735815-AL 41
Communications services
5.4 Setting up a connection
When specifying the connection parameters (in the Inspector window, in the properties of
the instruction), you are supported by the easy-to-use user interface.
Communication
42 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.4 Setting up a connection
Communication
Function Manual, 11/2023, A5E03735815-AL 43
Communications services
5.5 Data consistency
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 371).
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.
Communication
44 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.4 Setting up a connection
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
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
Communication
Function Manual, 11/2023, A5E03735815-AL 45
Communications services
5.5 Data consistency
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.
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.
Communication
46 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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.
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
Function Manual, 11/2023, A5E03735815-AL 47
Communications services
5.6 Secure Communication
Communication
48 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
The following paragraphs give an overview of these basic concepts, which are required for
managing certificates in STEP 7 (TIA Portal), for example, and for programming
communication instructions for secure Open User Communication (sOUC).
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
Function Manual, 11/2023, A5E03735815-AL 49
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 199).
For more information on secure programming device/HMI communication, refer to the
section Secure PG/HMI communication (Page 96).
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
50 Function Manual, 11/2023, A5E03735815-AL
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
Communication
Function Manual, 11/2023, A5E03735815-AL 51
Communications services
5.6 Secure Communication
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
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.
Communication
52 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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
Function Manual, 11/2023, A5E03735815-AL 53
Communications services
5.6 Secure Communication
Both asymmetric and symmetric encryption are considered secure encryption schemes - there
is basically no difference in security between the two procedures. The degree of security
depends on parameters such as the selected key length.
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.
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).
Communication
54 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
The figure below is a simplified overview of the process. It does not show how Alice can
check the digital signature.
7ZHQW &$ FRQILUPVZLWKKLV $OLFHJHWV%RE VSXEOLFNH\ZKLFKLVVLJQHGE\
VLJQDWXUHWKDWWKHSXEOLFNH\LV 7ZHQW6KHFDQEHFRQILGHQWWKDWWKLVSXEOLF
%RE V+HKDVFKHFNHG %RE NH\LVUHDOO\%RE VLIVKHWUXVWV7ZHQW
&$
$OLFHWUXVWV7ZHQW
7ZHQW &$ $OLFH
WKHFHUWLILFDWHDXWKRULW\&$
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 55
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
56 Function Manual, 11/2023, A5E03735815-AL
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 57
Communications services
5.6 Secure Communication
Using the same route, as of TIA Portal version V18, you can also transfer web server
certificates for a S7-1500 CPU (as of firmware V3.0).
The following table provides an overview of the certificate management options depending
on the service used and the TIA Portal firmware version or CPU firmware version.
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 182)
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
58 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 59
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.
When the hardware configuration is loaded, the device certificate, the public key as well as
the private key are loaded into the CPU.
Communication
60 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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
Function Manual, 11/2023, A5E03735815-AL 61
Communications services
5.6 Secure Communication
The certificates are to be referenced by their certificate ID in the user program (TCON
communication instruction in combination with the associated system data type, for example
TCON_IPV4_SEC). STEP 7 assigns the certificate ID automatically during the generation or
creation of certificates.
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
62 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
To ensure that self-signed certificates can be verified you have to include the self-signed
certificates of the communication partner into the list of trusted partner devices for each
CPU. To this purpose you must have activated the "Use global security settings for certificate
manager" option and be logged in as a user in the global security settings. Proceed as follows
to add the self-signed certificate of the communication partner of the CPU:
1. Mark PLC_1 and navigate to the "Certificates of partner devices" table in the "Protection &
Security" section.
2. Click in an empty line in the "Certificate subject" column in the "Device certificates" table to
add a new certificate.
3. Select the self-signed certificate 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 data exchange and load the
configurations together with the program.
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.
Proceed as follows to import certificates of the communication partner:
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.
Through 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
Function Manual, 11/2023, A5E03735815-AL 63
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.
Optionally the MES system can also request a device certificate of the CPU to authenticate the
CPU (i.e., the TLS client). In this case, the CA certificates of the CPU must be made available to
the MES system. The prerequisite for importing the certificates into the MES system is a
preceding export of the CA certificates from the STEP 7 project of the CPU. Follow these steps:
1. Open the certificate manager in the global security settings in the project tree.
2. Select the matching table (CA certificate) for the certificate to be exported.
3. Right-click the selected certificate to open the shortcut menu.
4. Click "Export".
5. Select the export format of the certificate.
In the next step you have to create the user programs for the data exchange and load the
configurations together with the program.
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.
① 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.
Communication
64 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 65
Communications services
5.6 Secure Communication
You did not have to handle certificates for these CPUs; the CPU automatically generates the
certificates required for the Web server.
For S7-1500 CPUs as of firmware V2.0, STEP 7 generates the server certificate (end-entity
certificate) for the CPU. You assign a server certificate to the Web server in the properties of
the CPU (Web server > Security).
Because a server certificate name is always preset, there is no change to the easy
configuration of the Web server: You activate the Web server. The "Permit access only with
HTTPS" option is enabled by default - STEP 7 generates a server certificate with the default
name during compiling.
Irrespective of whether you use the certificate manager in the global security settings or not:
STEP 7 has all the information required to generate the server certificate.
In addition, you have the possibility to determine the properties of the server certificate, for
example, the name or the validity period.
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
66 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 67
Communications services
5.6 Secure Communication
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.
1BTTXPSE 1BTTXPSECBTFELFZJOGPSNBUJPO
4&$63*5:
4FDVSF$PNNVOJDBUJPO
/PQBTTXPSEFNQUZQBTTXPSE %FGBVMULFZJOGPSNBUJPO
4&$63*5:
Communication
68 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 69
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
70 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
Communication
Function Manual, 11/2023, A5E03735815-AL 71
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.
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 100)) and you can load
any valid configuration with your configured password.
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.
Communication
72 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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 with mode selector of the CPU
Restoring the factory settings of the CPU via the mode selector also deletes the IP address of
the CPU, but not the password for protecting 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 78).
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.
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".
Communication
Function Manual, 11/2023, A5E03735815-AL 73
Communications services
5.6 Secure Communication
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.
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.
More information
Information on changing the password can be found in section Changing your password
(Page 72).
Communication
74 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 75
Communications services
5.6 Secure Communication
3. Create a text file named "S7_JOB.S7S" in the root directory of the memory card with the
content "SET_PWD".
This file is the "Job file" for assigning a password for the protection of the confidential PLC
configuration data of the PLC.
4. The file structure on the SIMATIC memory card then looks as follows:
NOTE
Safe storage of the SIMATIC memory card
Store the SIMATIC memory card in a safe location to which only authorized persons have
access.
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.
Communication
76 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 77
Communications services
5.6 Secure Communication
• 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.
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 75) you can read how to use the
SIMATIC Memory Card to assign the password to protect confidential PLC configuration data.
Communication
78 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 79
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
80 Function Manual, 11/2023, A5E03735815-AL
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 47).
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.
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".
Communication
Function Manual, 11/2023, A5E03735815-AL 81
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.
– "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
82 Function Manual, 11/2023, A5E03735815-AL
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 47).
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
Function Manual, 11/2023, A5E03735815-AL 83
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.
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.
Communication
84 Function Manual, 11/2023, A5E03735815-AL
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)). 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
Function Manual, 11/2023, A5E03735815-AL 85
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 47).
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 (with the exception of S7-1500 Software
Controller)
• CP 1543-1 as of firmware version V2.0 or CP 1543SP-1 as 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
86 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
Example: Setting up a secure TCP connection between two S7-1500 CPUs via CP interfaces
For secure TCP communication between two S7‑1500 CPs you need to create a data block
with the TCON_IP_V4_SEC system data type yourself in every CPU, assign parameters and call
it directly at one of the instructions TSEND_C, TRCV_C or TCON.
Requirements:
• Both S7 1500 CPUs have at least firmware version V2.0. If you use the CP 1543SP-1:
Firmware version as of V1.0.
• Both CPs (for example CP 1543-1) must have at least firmware version V2.0
• 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
Function Manual, 11/2023, A5E03735815-AL 87
Communications services
5.6 Secure Communication
The following figure shows the different certificates in the devices for the case that both
communication partners communicate via a CP 1543-1. 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
'HYLFHFHUWLILFDWHIURP 'HYLFHFHUWLILFDWHIURP
7/6VHUYHU 7/6FOLHQW
Figure 5-28 Certificate handling in secure OUC between two S7-1500 CPUs via CP interfaces.
Communication
88 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
2. Define a tag of the data type TCON_IP_4_SEC in the global data block. To do so, enter the
string "TCON_IP_V4_SEC" in the "Data type" field.
The example below shows the global data block "Data_block_1" in which the tag "SEC
connection 1 TLS-Client" of the data type TCON_IP_V4_SEC is defined.
The Interface ID has the value of the HW identifier of the IE interface of the local CP (TLS
client).
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)). 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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 89
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)). 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.
6. Interconnect the CONNECT parameter of the instruction TSEND_C, TRCV_C or TCON with
the tags of the data type TCON_IP_V4_SEC.
Communication
90 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 91
Communications services
5.6 Secure Communication
To set up a secure connection from a Modus TCP client (TLS client) to a Modbus TCP server
(TLS server) and set up the IPv4 address of the mail server, follow these steps:
1. Create a global data block in the project tree.
2. Define a tag of the data type TCON_IP_V4 SEC in the global data block.
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
92 Function Manual, 11/2023, A5E03735815-AL
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-5 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
Function Manual, 11/2023, A5E03735815-AL 93
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.
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.
Communication
94 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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.
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 47).
Communication
Function Manual, 11/2023, A5E03735815-AL 95
Communications services
5.6 Secure Communication
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
96 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
If your machine or system does not require this protection based on the Siemens Industrial
Defense-in-Depth concept, you can dispense with password assignment, for example,
because another equivalent protection is present. It is possible to do without the password if
you have implemented measures to prevent unauthorized access to the TIA Portal project and
the configuration of the CPU.
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 68).
Procedure
1. In the CPU properties, navigate to the area "Protection & Security > Connection
mechanisms".
2. Select the option you want to use.
Communication
Function Manual, 11/2023, A5E03735815-AL 97
Communications services
5.6 Secure Communication
More information
Basic information on the subject of certificate management can be found in section
Certificate management with TIA Portal (Page 58).
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.
Communication
98 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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 58)
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/2023, A5E03735815-AL 99
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
100 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 101
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).
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.
Communication
102 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 103
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 104)) 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.
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
104 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.6 Secure Communication
Even projects created with TIA Portal < V17 and transferred to a memory card work without
problems in an S7-1500 CPU V2.9.
However, the concept of protecting confidential PLC configuration data applies as soon as
you open the project with TIA Portal ≥ V17, update the firmware version of the CPU via a
device replacement and thus save it as a CPU with a firmware version ≥ V2.9 (see Useful
information for the protection of confidential PLC configuration data (Page 70)). The project
can no longer be edited with previous versions of TIA Portal V17.
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 50).
Communication
Function Manual, 11/2023, A5E03735815-AL 105
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
106 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 107
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.
Communication
108 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.7 SNMP
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
Function Manual, 11/2023, A5E03735815-AL 109
Communications services
5.7 SNMP
Communication
110 Function Manual, 11/2023, A5E03735815-AL
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".
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 111
Communications services
5.7 SNMP
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;
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
112 Function Manual, 11/2023, A5E03735815-AL
Communications services
5.7 SNMP
"ActivateSnmp".snmpRecord.snmpControl := 0;
The next time the "WRREC" instructions are called, SNMP will be deactivated again.
Communication
Function Manual, 11/2023, A5E03735815-AL 113
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 68)
• Secure PG/HMI communication (Page 96)
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
114 Function Manual, 11/2023, A5E03735815-AL
PG communication
More information
You can find more information on "Go online" in the STEP 7 online help.
Communication
Function Manual, 11/2023, A5E03735815-AL 115
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 68)
• Secure PG/HMI communication (Page 96)
Communication
116 Function Manual, 11/2023, A5E03735815-AL
HMI communication
More information
You can find information on S7 routing for HMI connections in the section S7 Routing (Page
353).
You can find more information on setting up HMI connections in the STEP 7 online help.
Communication
Function Manual, 11/2023, A5E03735815-AL 117
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 385).
Communication
118 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.2 Protocols for Open User Communication
Communication
Function Manual, 11/2023, A5E03735815-AL 119
Open User Communication
8.3 Instructions 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.
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
Communication
120 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.3 Instructions for Open User Communication
Communication
Function Manual, 11/2023, A5E03735815-AL 121
Open User Communication
8.3 Instructions for Open User Communication
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
122 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 123
Open User Communication
8.4 Open User Communication with addressing via domain names
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 374).
Information about the Secure Open User Communication is available in the section Secure
Open User Communication (Page 79).
Communication
124 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.4 Open User Communication with addressing via domain names
3. Enter the IPv4 address of a DNS server in the "DNS server addresses" column of the "Server
list" table.
You can enter up to 4 IPv4 addresses of DNS servers.
Figure 8-1 Entering DNS server addresses using a CPU 1516‑3 PN/DP as an example
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 125
Open User Communication
8.4 Open User Communication with addressing via domain names
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).
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 79).
Communication
126 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
Communication
Function Manual, 11/2023, A5E03735815-AL 127
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.
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
128 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 129
Open User Communication
8.5 Setting up Open User Communication via TCP, ISO-on-TCP, UDP and ISO
5. Set the properties of the connection in the "Properties" tab in the "General" area, for
example the name of the connection and the interfaces of the communications partner
that will be used.
For connections to an unspecified partner, set the address of the partner.
You can find the local ID (reference of the connection in the user program) in the "Local
ID" area.
6. In the Project tree, select the "Program blocks" folder for one of the CPUs and open OB1 in
the folder by double-clicking on it. The program editor opens.
7. Select the required instruction from the "Instructions" task card, "Communication" area,
"Open user communication", for example TSEND and drag it to a network of OB1.
8. At the ID parameter of the instruction, assign the local ID of the configured connection to
be used for the transmission of data.
9. Interconnect the "DATA" parameter of the TSEND instruction with the user data, for
example in a data block.
10. Download the hardware configuration and user program to the CPU.
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.
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.
Communication
130 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.6 Setting up communication over FDL
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/2023, A5E03735815-AL 131
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.
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
132 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.7 Setting up communication with Modbus TCP
Communication
Function Manual, 11/2023, A5E03735815-AL 133
Open User Communication
8.7 Setting up communication with Modbus TCP
Communication
134 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.8 Setting up communication via e-mail
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.
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
Function Manual, 11/2023, A5E03735815-AL 135
Open User Communication
8.9 Setting up communication via FTP
Communication
136 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.9 Setting up communication via FTP
Communication
Function Manual, 11/2023, A5E03735815-AL 137
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
138 Function Manual, 11/2023, A5E03735815-AL
Open User Communication
8.10 Establishment and termination of communications relations
Communication
Function Manual, 11/2023, A5E03735815-AL 139
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 118)).
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
140 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 141
S7 communication
Communication
142 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 143
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
144 Function Manual, 11/2023, A5E03735815-AL
S7 communication
Communication
Function Manual, 11/2023, A5E03735815-AL 145
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
146 Function Manual, 11/2023, A5E03735815-AL
S7 communication
If you assign the "PROFINET onboard [X2]" interface to the CPU 1515SP PC (F) of the SIMATIC
PC station, the CPU 1515SP PC (F) can be used as a router for S7 connections. If you use the
CP interface for "None, or a different Windows setting", you cannot use the Open Controller
as a router for routed S7 connections.
An existing S7 connection routed by the CPU 1515SP PC (F) becomes invalid if the
assignment of the interface of the CPU 1515SP PC (F) is changed from "SIMATIC PC station" to
"None, or a different Windows setting". Since the PLC now no longer handles routing
functions for this connection, when the CPU 1515SP PC (F) is compiled, no message relating
to the invalid connection is displayed. The invalid routed S7 connection is displayed only
when the end points of the connection are compiled.
The interfaces required for routed S7 connections must remain explicitly assigned on the CPU
1515SP PC (F) . You can edit the assignment of the interface of the CPU 1515SP PC (F) in the
properties under "PROFINET onboard [X2] > Interface assignment".
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
Function Manual, 11/2023, A5E03735815-AL 147
10
Point-to-point link
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
148 Function Manual, 11/2023, A5E03735815-AL
Point-to-point link
Communication
Function Manual, 11/2023, A5E03735815-AL 149
Point-to-point link
Communication
150 Function Manual, 11/2023, A5E03735815-AL
Point-to-point link
Communication
Function Manual, 11/2023, A5E03735815-AL 151
Point-to-point link
3. Select the instructions for Modbus communication according to your task in the
"Communication" area, "Communications processor" folder of the "Instructions" task card
and drag them to a network of OB1:
– The "Modbus_Comm_Load" instruction configures the port of the CM for Modbus
communication.
– The "Modbus_Master" instruction is used for Modbus master functionality.
– The "Modbus_Slave" instruction is used for Modbus slave functionality.
4. Assign the parameters for the instructions according to your configuration.
5. Download the hardware configuration and user program to the CPU.
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
152 Function Manual, 11/2023, A5E03735815-AL
11
OPC UA communication
Communication
Function Manual, 11/2023, A5E03735815-AL 153
OPC UA communication
11.1 What you need to know about OPC UA
Communication
154 Function Manual, 11/2023, A5E03735815-AL
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.
Nano Embedded Device 2017 Server Profile
For the smallest devices with severely limited functionality, there is the "Nano Embedded
Device 2017 Server Profile" of the OPC Foundation. This profile is functionally equivalent to
the core server facet and defines the OPC UA TCP binary protocol as the required transport
profile. The profile allows for connections without UA Security and does not allow
subscriptions or method calls. Support for diagnostic objects and variables is optional for this
profile.
Additional profiles build on the "Nano Embedded Device 2017 Server Profile", requiring more
resources and offering more functionality.
Micro Embedded Device 2017 Server Profile
This profile provides limited functionality; it requires at least two parallel connections.
Additionally, it allows subscriptions/data monitoring, but no UA Security and no method calls.
• S7-1200 Basic Controllers support the "Micro Embedded Device 2017 Server Profile". The
S7-1200 additionally supports UA Security.
Communication
Function Manual, 11/2023, A5E03735815-AL 155
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).
More information
You can find more information on the website of the OPC Foundation
(https://opcfoundation.org).
Communication
156 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2023, A5E03735815-AL 157
OPC UA communication
11.1 What you need to know about OPC UA
Communication
158 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 159
OPC UA communication
11.1 What you need to know about OPC UA
The following figure shows an example of a possible configuration: The CPU could also have
the role OPC UA client and the device on the subnet of the CP could have the role OPC UA
server.
OPC UA Server
OPC UA Client
Figure 11-2 Example: Access of OPC UA clients to the OPC UA server of the CPU
Communication
160 Function Manual, 11/2023, A5E03735815-AL
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 358)
• Virtual interface for IP-based applications (Page 366)
Node ID (NodeId)
Nodes in the OPC UA address space are uniquely identified by a NodeId (Node Identifier).
Communication
Function Manual, 11/2023, A5E03735815-AL 161
OPC UA communication
11.1 What you need to know about OPC UA
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.
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.
Communication
162 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.1 What you need to know about OPC UA
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/2023, A5E03735815-AL 163
OPC UA communication
11.1 What you need to know about OPC UA
The "MyDB" data block is a global data block. The data block is therefore located below the
node "DataBlocksGlobal". "StartTimer" is a memory tag and is therefore stored below the
"Memory" node.
Figure 11-4 PLC tags in the address space of the OPC UA server
Communication
164 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.1 What you need to know about OPC UA
Communication
Function Manual, 11/2023, A5E03735815-AL 165
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.
Communication
166 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.1 What you need to know about OPC UA
In the following example, the "StartTimer" tag is first registered on the server. Afterwards, the
rapid function "RegisteredWrite" is used for setting the value.
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.
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 222).
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/2023, A5E03735815-AL 167
OPC UA communication
11.1 What you need to know about OPC UA
Clients whose subscription requires shorter publishing intervals are "slowed" to 1000 ms and
the server is protected from overload.
Sampling and transmission (Sampling & Publishing) within the scope of a subscription are
communication processes which, like other communication processes (TCP/UDP/Web server
communication...), are processed by the CPU with priority 15. OBs with higher priority
interrupt the communication. If you set the sampling and transmission intervals too short,
this setting causes a high communication load. Therefore, select intervals as large as possible,
which are still sufficient for the application.
For information about the consistency of tags, refer to Consistency of CPU tags (Page 214).
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.
Communication
168 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.1 What you need to know about OPC UA
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/2023, A5E03735815-AL 169
OPC UA communication
11.1 What you need to know about OPC UA
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
170 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
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)
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:
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".
Communication
Function Manual, 11/2023, A5E03735815-AL 171
OPC UA communication
11.2 Security at OPC UA
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.
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).
Communication
172 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
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.
Check during connection establishment
When a connection is being established between the client and server, the devices check all
information from the certificate that is required to determine its integrity, such as signature,
period of validity, application name (URN) and, in case of firmware version V2.5 only, also the
IP address of the client in the client certificate.
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/2023, A5E03735815-AL 173
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.
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).
Communication
174 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
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.
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
Function Manual, 11/2023, A5E03735815-AL 175
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 328).
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.
Communication
176 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
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:
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:
Communication
Function Manual, 11/2023, A5E03735815-AL 177
OPC UA communication
11.2 Security at OPC UA
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
178 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
The figure below shows the command line with the command and OpenSSL:
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 328).
Communication
Function Manual, 11/2023, A5E03735815-AL 179
OPC UA communication
11.2 Security at OPC UA
The security policies are also named according to the algorithms used. Example:
"Basic256Sha256 - Sign & Encrypt" means: Secure endpoint, supports a series of algorithms
for 256-bit hashing and 256-bit encryption.
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
180 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
Communication
Function Manual, 11/2023, A5E03735815-AL 181
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
182 Function Manual, 11/2023, A5E03735815-AL
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
• 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.
① 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
Communication
Function Manual, 11/2023, A5E03735815-AL 183
OPC UA communication
11.2 Security at OPC UA
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 in STOP of the CPU; the certificates are part
of the hardware configuration.
• Or via GDS push methods in RUN or in STOP mode of the CPU.
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.
7,$
3RUWDO
&HUWLILFDWHV 'RZQORDG
6&38 +DUGZDUHFRQILJXUDWLRQ
*'6
3XVK
&$ 8SGDWH&HUWLILFDWHV
*HW/LVW 7UXVW 23& DQG7UXVW/LVW 23&8$ 6,0$7,&
&HUWLILFDWH
'DWDEDVH 8$&OLHQW 6HUYHU 0HPRU\
&DUG
&HUWLILFDWH0DQDJHU &HUWLILFDWH5HFHLYHU
More information
You can find more information on the certificates for OPC UA in the section Certificates with
OPC UA (Page 175).
Communication
184 Function Manual, 11/2023, A5E03735815-AL
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 185
OPC UA communication
11.2 Security at OPC UA
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 57)
– 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. The
partner must use this endpoint.
• An authenticated user with sufficient function rights is configured
The user must have a role that has the function right "Manage certificates".
This function right, in turn, has the following requirements:
– Project protection must be enabled in the project tree: Project tree: "Security settings
> Settings > Project protection".
– In the "OPC UA > General" area of the CPU settings, the following general user
management setting must be enabled: "Enable additional user management via project
security settings"
The Users and roles with OPC UA function rights (Page 235) section describes how to set the
function rights.
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
186 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
When GDS push certificate management is enabled, the services (applications) of the CPU
also use certificates from the certificate store whose certificates are managed at runtime.
1. In the CPU settings, navigate to the area "Protection & Security > Certificate management".
2. Select the "Use certificates provided by the certificate management at runtime" option.
The other option (use certificates configured and downloaded using TIA Portal) uses the
certificates that are downloaded to the CPU from the TIA Portal with the configuration in
CPU STOP. Certificates or trust lists cannot be updated in this certificate store during
runtime.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 187
OPC UA communication
11.2 Security at OPC UA
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).
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 186).
Communication
188 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
The process of the provisioning phase for web server certificates is comparable. In contrast
to OPC UA, the GDS client only pushes web server certificates but not trust lists into the
corresponding certificate store.
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/2023, A5E03735815-AL 189
OPC UA communication
11.2 Security at OPC UA
After the hardware configuration is downloaded, the certificate store for certificates that can
be updated during runtime is deleted on download or the certificates are retained, depending
on the setting. This means that if GDS is activated and the certificate store has been deleted,
the CPU is in the provisioning stage after the hardware configuration has be loaded.
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
190 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
The OPC UA server of the CPU makes this method available if the client has the required
function right "Manage certificates".
The "CreateSigningRequest" method allows for the following variants:
• Certificate update without creating a new key pair (internal CPU keys that are already
available are used)
• Certificate update with creation of a new key pair (CPU-internal)
There is also the possibility to generate certificates with externally created key pairs.
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/2023, A5E03735815-AL 191
OPC UA communication
11.2 Security at OPC UA
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
192 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
You can find a detailed description of the individual methods below this overview table.
Communication
Function Manual, 11/2023, A5E03735815-AL 193
OPC UA communication
11.2 Security at OPC UA
CreateSigningRequest
The method has the following parameters:
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
194 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
Apply Changes
The method has no parameters.
Method Result Codes
Communication
Function Manual, 11/2023, A5E03735815-AL 195
OPC UA communication
11.2 Security at OPC UA
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".
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.
Communication
196 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.2 Security at OPC UA
"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".
"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
Function Manual, 11/2023, A5E03735815-AL 197
OPC UA communication
11.2 Security at OPC UA
Communication
198 Function Manual, 11/2023, A5E03735815-AL
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 199
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
200 Function Manual, 11/2023, A5E03735815-AL
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 as strict as possible a security policy
Select an application-appropriate security policy for the end point and disable the less strict
security policy at the OPC UA server.
A Sha256 certificate is required for the most secure end points (Basic256Sha256) of the
S7-1500 CPU OPC UA server.
Communication
Function Manual, 11/2023, A5E03735815-AL 201
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
202 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• Offline with the Openness API: In your program, you use the API (Application
Programming Interface) of the TIA Portal to access the function for exporting all PLC tags
that can be read by OPC UA. This requires .NET Framework 4.0; see TIA Portal Openness,
Automating SIMATIC projects with scripts
(https://support.industry.siemens.com/cs/ww/en/view/109477163).
• If you already know the syntax and the PLC program, you can access the OPC UA server
without first researching the information.
Communication
Function Manual, 11/2023, A5E03735815-AL 203
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
As of FW version V2.8, the behavior of the OPC UA server has been optimized as follows:
• When objects are downloaded in STOP operating state of the CPU, the OPC UA server still
always stops and then restarts. STEP 7 does not show a warning in this case.
• When objects are downloaded in RUN operating state of the CPU, the OPC UA server only
stops if the downloaded objects are, or could be, OPC UA-relevant. The OPC UA server
restarts after re-initialization due to the modified OPC UA data.
Before OPC-UA-relevant objects are loaded into the CPU and stop the OPC UA server, STEP
7 displays a warning in the preview dialog for loading. You can then decide whether a
server restart is compatible for the running process or whether you want to cancel the
download. These warnings are only displayed when the OPC UA server is running. If the
OPC UA server is not enabled, modified OPC UA data have no influence on the download
process.
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
204 Function Manual, 11/2023, A5E03735815-AL
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 205
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
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.
Communication
206 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
Principle functionality of the "OPC_UA_WriteList" instruction for setting DataValues
The DataValue structure is, for example, modeled as a UDT and a tag of this data type is
transferred to the "OPC_UA_WriteList" instruction. The instruction then consistently transfers
the elements of the tag to the OPC UA tag node.
The value of the "ConnectionHdl" instruction parameter determines the function of the
"OPC_UA_WriteList" instruction: Either "Normal" client instruction or instruction to write to
local OPC UA tag nodes. OPC UA clients can read the value with additional information in the
latter case and evaluate it accordingly.
This principle is illustrated in the following figures, once with any client and once with an
S7‑1500 CPU as OPC UA client. In the case of the S7‑1500 CPU client, the assignment of the
DataValue elements to the corresponding instruction parameters of the "OPC_UA_ReadList"
instruction is shown. You have full access to all elements of the DataValue structure.
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
Communication
Function Manual, 11/2023, A5E03735815-AL 207
OPC UA communication
11.3 Using the S7-1500 as an OPC UA 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)
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.
Communication
208 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
You should not model individual elements of structures or arrays additionally as lower-level
OPC UA tags.
Reason: If you model individual elements of arrays or structures additionally as separate
lower-level nodes in the address space of the server, then these nodes are not automatically
filled. For the OPC UA server, these separate nodes are independent of the higher-level
OPC UA tags of the structure or array type, because they are not mapped to CPU tags.
To fill these separately modeled nodes, you must create each individual element as its own
DataValue structure in the program.
Tip: In order for OPC UA clients to be able to simultaneously learn about changes to relevant
nodes in this case, set the values of all OPC UA tags involved in the same "OPC_UA_WriteList"
call.
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 212) section.
You can find information how to create user-defined server interfaces in the Creating a user-
defined server interface (Page 251) section.
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
161)). The check boxes at "Accessible from HMI/OPC UA" and "Writable from HMI/OPC UA" are
activated for all the components of the array.
Communication
Function Manual, 11/2023, A5E03735815-AL 209
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Result: OPC UA clients can both read and write these components.
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 211)). This setting "overrules" the settings for the
components in the DB editor.
Communication
210 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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 212).
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/2023, A5E03735815-AL 211
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
212 Function Manual, 11/2023, A5E03735815-AL
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 213
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).
Communication
214 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 215
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
216 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 217
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Elements that exist in the CPU but are not used in the program do not appear in the OPC UA
XML file after the export. Examples of such unused elements are:
• UDTs that are not mapped to a data block
• Function blocks with inputs/outputs without assigning inputs/outputs to CPU tags
You use the OPC UA XML file for the offline configuration of an OPC UA client; it is structured
according to the OPC UA specification and acts as a standard SIMATIC server interface.
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
218 Function Manual, 11/2023, A5E03735815-AL
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 239).
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 219
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• 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:
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 158).
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).
Communication
220 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Example for URLs (Uniform Resource Locator) that can be used to set up connections to the
OPC UA server of the CPU:
Dynamic IP addresses
In the example below, the IP address for the PROFINET interface [X2] has not yet been
specified.
Communication
Function Manual, 11/2023, A5E03735815-AL 221
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
222 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 223
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
V1.04 (attribute "DataTypeDefinition" at the data type node). If your client supports the OPC
UA specification V1.04 or higher, then disable the option.
Advantages of the data type definitions according to OPC UA specification as of V1.04:
• The server starts faster
• The memory is used more efficiently
• The "Browse" function is faster
6XEVFULEHP\'%P\$UUD\
23&8$VHUYHU 6DPSOLQJLQWHUYDO 3XEOLVKLQJLQWHUYDO
'%P\$UUD\
P\'%P\$UUD\
3XEOLVKLQJLQWHUYDO
6DPSOLQJLQWHUYDO
'%
P\$UUD\
Communication
224 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
250 ms is used as the "Minimum sampling interval" in the figure below. The value 200 ms is
entered as the "Minimum publishing interval".
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).
Communication
Function Manual, 11/2023, A5E03735815-AL 225
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The rules for subscriptions are available in section Rules for subscriptions (Page 337).
You will find information about the diagnostics of subscriptions in the section Subscription
diagnostics (Page 301).
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
226 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The following example shows a dialog of the client "UA Sample Client". When the user clicks
the "Yes" button, the client trusts the server certificate:
Communication
Function Manual, 11/2023, A5E03735815-AL 227
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
certificates with tools, for example with OpenSSL or the certificate generator of the OPC
Foundation:
• The procedure for OpenSSL is described here: "Generating PKI key pairs and certificates
yourself".
• Working with the certificate generator of the OPC Foundation is described here: "Creating
self-signed certificates".
11. Scroll down in the "Secure Channel" dialog to the section "Trusted clients".
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.
Communication
228 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
Function Manual, 11/2023, A5E03735815-AL 229
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
230 Function Manual, 11/2023, A5E03735815-AL
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!
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/2023, A5E03735815-AL 231
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
4. Use other parameters if this is necessary in accordance with the security specifications in
your company or your customer.
Communication
232 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 233
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
NOTE
To increase security, you should only allow access to the OPC UA server with user
authentication.
Communication
234 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 235
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
236 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA 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).
Diagnostics
You can specify the scope of the diagnostics of the OPC UA server in the CPU settings.
Communication
Function Manual, 11/2023, A5E03735815-AL 237
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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 295).
Communication
238 Function Manual, 11/2023, A5E03735815-AL
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.
You can also use the server interface type "Companion specification", for example, to
download company-internal information models, e.g. in SiOME.
Communication
Function Manual, 11/2023, A5E03735815-AL 239
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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 241).
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 247).
– 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 265)
• 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 251).
Communication
240 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
The production jobs are transferred via a server method: A control system transmits
information on a workpiece by calling the server method in the CPU. This server method also
starts production.
The control system, i.e. the connected OPC UA client, should only see this one server method.
Therefore, you create a user-defined server interface in the CPU and assign the server method
to this server interface. You enable only this server interface for OPC UA clients and thus limit
the view of the CPU to this one function.
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.
Information modeling and standardization for devices and sectors
For applications of the same kind, it is worth standardizing your device or machine interface
with the "OPC UA toolkit".
Many different bodies and working groups have driven forward standardization and
developed a range of companion specifications.
These specifications define:
• The objects, methods and tags with which a typical device or machine is to be described.
• The namespace intended for the specified objects.
Machines are typically structured in functional or technological units, and these units are
then standardized.
Companion specifications offer machine and plant operators the benefits of a standardized
interface. For example, all RFID readers that comply with the AutoID specifications can be
integrated in the same way. This means that all RFID readers that comply with the AutoID
specifications can be addressed by OPC UA clients in the same way irrespective of
manufacturer.
Another example of companion specifications is the Euromap 77 Companion Specifications
from the injection molding machinery sector.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 241
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
242 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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/2023, A5E03735815-AL 243
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
5. To import the file, select the "Opc.Ua.Di.NodeSet2.xml" file and click "Open".
Result: SiOME imports the XML file and shows the namespace
"http://opcfoundation.org/UA/DI/" in the "Namespaces" area.
The standard namespace "http://opfoundation.org/UA/" is always available in SiOME and
does not have to be imported.
6. Now import the namespace "http://www.euromap.org/euromap83/"
To do so, click the "Import XML" button again in the "Information model" area.
Select the file "Opc_Ua.EUROMAP83.NodeSet2.xml".
Result: SiOME imports the XML file and shows the namespace
"http://www.euromap.org/euromap83/" in the "Namespaces" area.
7. Now import the namespace "http://www.euromap.org/euromap77/"
To do so, click the "Import XML" button again in the "Information model" area.
Select the file "Opc_Ua.EUROMAP77.NodeSet2.xml".
8. Create your own namespace for your project.
To do this, right-click in the "Namespaces" area on "OPC UA Modelling Editor Project" or on
"Namespaces" and select "Add Namespace".
SiOME opens the "Add Namespace" dialog.
9. Enter the name of a new namespace.
The "YourCompany.org" namespace is used in the example.
SiOME now also displays the new namespace:
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
244 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 245
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.
Communication
246 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
For basic information on companion specifications, refer to the section "Using OPC UA
companion specifications (Page 241)". 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
Function Manual, 11/2023, A5E03735815-AL 247
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
6. In the "Import XML file" field, select an XML file that describes an information model.
The "Using OPC UA companion specifications (Page 241)" 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.
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 263)" section describes the
procedure.
If all reference namespaces are available, STEP 7 displays the table without errors:
Communication
248 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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:
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/2023, A5E03735815-AL 249
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
• Node type
Type of the OPC UA node. The type is specified by the companion specification that is
used.
In the following cases, STEP 7 marks a node type in the table in color:
– No definition is included for this in the imported XML file or
– The namespace in which the type was defined is not available in STEP 7.
In this case, create a server interface of the "Reference namespace" type for the missing
namespace or for each of the missing namespaces.
The missing namespaces can be found under "Namespaces" in the properties of the server
interface.
• Local data
STEP 7 displays the data block which is assigned to the OPC UA node: The CPU reads the
value of the OPC UA node from this data block.
If a data block is highlighted in color (e.g. after a consistency check), the specified data
block is not available in the CPU.
In this case, you have to create the missing data block in the CPU (of user program) and
supply it with values.
• 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.
Communication
250 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
After you have clicked the button or selected the shortcut menu, you must select in the
follow-up dialog box whether the local data should be created in a new DB or in an existing
DB.
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:
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/2023, A5E03735815-AL 251
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
252 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
7. Drag the OPC UA elements into the "<Add new>" line of the new server interface.
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:
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
Function Manual, 11/2023, A5E03735815-AL 253
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
254 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
When a row is selected, you can display the OPC UA attributes of the node in the Inspector
window ("OPC UA attributes" area), such as node ID, node class, node type, and description.
• BrowseName
The language neutral name of the user-defined server interface is at the top
(BrowseName). This name can be freely selected.
The names (BrowseNames) of the individual OPC UA nodes that have been added to the
server interface are under the name of the interface.
You cannot change the name of an OPC UA node in this dialog. The names come from the
STEP 7 project.
You can delete an OPC UA node from the table. This means that it no longer belongs to
the server interface and is no longer visible to OPC UA clients.
• DisplayName
Similar to BrowseName. However, the name can be translated and is displayed, if
available, in the corresponding language.
• Node ID
NodeId of the OPC UA node, e.g. http://Server-Node_1; i=1
• 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
Function Manual, 11/2023, A5E03735815-AL 255
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
After you have clicked the button or selected the shortcut menu, you must select in the
follow-up dialog box whether the local data should be created in a new DB or in an existing
DB.
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 339).
See also
Client accesses and local accesses to the OPC UA server (Page 205)
Communication
256 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 257
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
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.
Communication
258 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
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".
Communication
Function Manual, 11/2023, A5E03735815-AL 259
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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 258)
• OpcUa_LocalizedText (Page 258)
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
260 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 261
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
262 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 263
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".
If a companion specification uses additional namespaces, add a new server interface for each
namespace.
Add additional server interfaces for Euromap77
For Euromap 77, you still need the following namespaces:
• http://www.euromap.org/euromap83/
• http://www.euromap.org/euromap77/
First, add a server interface for the namespace "http://www.euromap.org/euromap83/".
This namespace contains basic definitions for Euromap 77, therefore it is required here first.
All definitions of this namespace are included in the XML file
"Opc_Ua.EUROMAP83NodeSet2.xml", which you can download from the Euromap website
(https://www.euromap.org/en/euromap83).
Then add a server interface for the namespace "http://www.euromap.org/euromap77". All
definitions of this namespace are included in the XML file
Communication
264 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
"Opc_Ua.EUROMAP77.NodeSet2.xml", which you can also download from the Euromap web
site (https://www.euromap.org/en/euromap77).
11.3.4.10 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/2023, A5E03735815-AL 265
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
266 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 267
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
268 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 269
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
270 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 271
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.
⑤ 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
272 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 273
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.
Communication
274 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an 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
Function Manual, 11/2023, A5E03735815-AL 275
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
276 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
it exited this state again, for example, entered RUN state. This information is displayed
with the states "incoming/outgoing".
Communication
Function Manual, 11/2023, A5E03735815-AL 277
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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 292).
Communication
278 Function Manual, 11/2023, A5E03735815-AL
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.
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/2023, A5E03735815-AL 279
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
SimaticEventType has all properties of BaseEventType as well as the special properties which
are an image of the field structure of SIMATIC alarms.
Communication
280 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
This assignment depends on the manufacturer. Different assignments may apply to other
devices.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 281
OPC UA communication
11.3 Using the S7-1500 as an 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.
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
282 Function Manual, 11/2023, A5E03735815-AL
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).
Communication
Function Manual, 11/2023, A5E03735815-AL 283
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
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 289).
You can find information on failed requests of a remote client in the section Request of a
remote client failed (Page 300).
Communication
284 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
Function Manual, 11/2023, A5E03735815-AL 285
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).
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>).
Communication
286 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
Function Manual, 11/2023, A5E03735815-AL 287
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
Communication
288 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 289
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
290 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 291
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.
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)
Communication
292 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
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
Function Manual, 11/2023, A5E03735815-AL 293
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
294 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 295
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
296 Function Manual, 11/2023, A5E03735815-AL
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).
3RZHURQ
)DLOHG
Communication
Function Manual, 11/2023, A5E03735815-AL 297
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.
Communication
298 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
&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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 299
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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
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
300 Function Manual, 11/2023, A5E03735815-AL
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 301
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
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.
&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
302 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 303
OPC UA communication
11.3 Using the S7-1500 as an OPC UA server
In this case, the CPU sends the status code "GoodOverload" (0x002F0000) per element, even
though the elements were not checked. The meaning of the status code according to IEC
61131-3 is as follows: "Sampling has slowed down due to resource limitations".
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 224).
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).
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
304 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 305
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 219).
Communication
306 Function Manual, 11/2023, A5E03735815-AL
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 312)").
2. Next, configure the connection to the OPC UA server (Second step (Page 325)).
3. Finally, use the configured connection for the OPC UA client instructions (Third step (Page
332)).
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
Function Manual, 11/2023, A5E03735815-AL 307
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
308 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 309
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_MethodRelease 4* 10* 40*
HandleList
OPC_UA_Disconnect 4* 10* 40*
OPC_UA_ConnectionGetStatus 4* 10* 40*
* maximum 1 per connection
Communication
310 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 311
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 310).
– 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.
Communication
312 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 313
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 168)
Communication
314 Function Manual, 11/2023, A5E03735815-AL
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.
The following figure shows the content of the method list:
Communication
Function Manual, 11/2023, A5E03735815-AL 315
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
316 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 317
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
318 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 319
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
320 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 321
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 168).
For information on how to create a client interface, refer to the section Creating client
interfaces (Page 312).
Communication
322 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 323
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
The UDTs apply the description text as comment according to the rules stated above. STEP 7
creates the comment in only one language, just like the texts in the OPC UA server interface
can only be displayed in one language.
Communication
324 Function Manual, 11/2023, A5E03735815-AL
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!
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 310).
The section "Create client interface (Page 312)" describes how to create a client interface.
Communication
Function Manual, 11/2023, A5E03735815-AL 325
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
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
326 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
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).
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
226)" 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
Function Manual, 11/2023, A5E03735815-AL 327
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
328 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
You have to import these certificates with the global certificate manager in STEP 7 and use
them for the respective CPU.
If you program an OPC UA client yourself, you can generate certificates through the program.
Alternatively, you can generate certificates with tools, for example with OpenSSL or the
certificate generator of the OPC Foundation:
• The procedure for OpenSSL is described here: "Generating PKI key pairs and certificates
yourself (Page 176)".
• Working with the certificate generator of the OPC Foundation is described here: "Creating
self-signed certificates (Page 176)".
Communication
Function Manual, 11/2023, A5E03735815-AL 329
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
330 Function Manual, 11/2023, A5E03735815-AL
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.
"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.
Communication
Function Manual, 11/2023, A5E03735815-AL 331
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
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 235).
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 312)").
• You have configured a connection to an OPC UA server (Second step (Page 325)).
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
332 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
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
Function Manual, 11/2023, A5E03735815-AL 333
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:
"ProductionLine" is the interface that the OPC UA client of the example (Page 310) 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:
Communication
334 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.4 Using the S7-1500 CPU as an OPC UA client
Communication
Function Manual, 11/2023, A5E03735815-AL 335
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.
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
336 Function Manual, 11/2023, A5E03735815-AL
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.
More information
For information on how to set the server for subscriptions, refer to the section Settings of the
server for subscriptions (Page 224).
Communication
Function Manual, 11/2023, A5E03735815-AL 337
OPC UA communication
11.5 Tips and recommendations
Communication
338 Function Manual, 11/2023, A5E03735815-AL
OPC UA communication
11.5 Tips and recommendations
4. In the "DB accessible from OPC UA" column, disable the accessibility from OPC UA for
individual objects.
Communication
Function Manual, 11/2023, A5E03735815-AL 339
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 251).
Communication
340 Function Manual, 11/2023, A5E03735815-AL
12
Addressing via DHCP
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 341
Addressing via DHCP
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).
'+&3VHUYHU
'16VHUYHU 173VHUYHU
5RXWHU
'+&3VHUYHU
GLVWULEXWHG
,3
173
'16
+RVW
'RPDLQ
1HWZRUN
3/&
3/& 3/&
352),1(7
Areas of application
• Use of the S7-1500 CPU in a managed IT environment
• Adding new devices in a modular manufacturing structure
Communication
342 Function Manual, 11/2023, A5E03735815-AL
Addressing via DHCP
12.1 Principle of address assignment via DHCP
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 349)
• 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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 343
Addressing via DHCP
12.1 Principle of address assignment 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 349).
Communication
344 Function Manual, 11/2023, A5E03735815-AL
Addressing via DHCP
12.2 DHCP with DNS
&OLHQW,'
+RVWQDPH
'RPDLQ
Communication
Function Manual, 11/2023, A5E03735815-AL 345
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
346 Function Manual, 11/2023, A5E03735815-AL
Addressing via DHCP
12.2 DHCP with DNS
&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/2023, A5E03735815-AL 347
Addressing via DHCP
12.2 DHCP with DNS
Only if you have configured the host and domain name in STEP 7, the full name is displayed
for "Full name:".
Communication
348 Function Manual, 11/2023, A5E03735815-AL
Addressing via DHCP
12.4 Configuring the client ID
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 349).
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 349
Addressing via DHCP
12.4 Configuring the client ID
Requirement
• You have activated address assignment via DHCP for the interface.
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.
Communication
350 Function Manual, 11/2023, A5E03735815-AL
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.
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
Function Manual, 11/2023, A5E03735815-AL 351
Addressing via DHCP
12.7 Obtain host and domain name via DHCP
Communication
352 Function Manual, 11/2023, A5E03735815-AL
13
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).
Communication
Function Manual, 11/2023, A5E03735815-AL 353
Routing
13.2 S7 routing
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
354 Function Manual, 11/2023, A5E03735815-AL
Routing
13.2 S7 routing
In the following figure, CPU 1 is the S7 router between S7 subnet 1 and S7 subnet 2.
&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
Function Manual, 11/2023, A5E03735815-AL 355
Routing
13.2 S7 routing
&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
356 Function Manual, 11/2023, A5E03735815-AL
Routing
13.2 S7 routing
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 374).
• 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
116).
• 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
Function Manual, 11/2023, A5E03735815-AL 357
Routing
13.3 IP forwarding
13.3 IP forwarding
,3VXEQHW$
;
&38ZLWK
DFWLYDWHG,3
IRUZDUGLQJ
;
,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
358 Function Manual, 11/2023, A5E03735815-AL
Routing
13.3 IP forwarding
• IP forwarding is enabled.
• Suitable standard gateways/routes are configured in each participating device along the
outgoing and return paths of the IP packets.
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
Function Manual, 11/2023, A5E03735815-AL 359
Routing
13.3 IP forwarding
3&
,3DGGUHVV
5RXWHU
;
,3URXWHU
;
;
&38ZLWK
DFWLYDWHG,3
IRUZDUGLQJ
; ;
,3SDFNHWV
; ;
,2GHYLFH +0,
Figure 13-8 Sample configuration
This example configuration results in the following IP routing table for the CPU.
Communication
360 Function Manual, 11/2023, A5E03735815-AL
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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 361
Routing
13.3 IP forwarding
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
;
,3VXEQHW'
5RXWHU
,3VXEQHW'
+0,
Figure 13-9 Unsupported IP router cascade
Communication
362 Function Manual, 11/2023, A5E03735815-AL
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&
5RXWHDGGPDVN
,3SDFNHWV
; &3831'30)3
ZLWKDFWLYDWHG,3IRUZDUGLQJ
&&5XQWLPH
'HIDXOW
5RXWHDGGQHWPDVNJZ
; ; ;
Communication
Function Manual, 11/2023, A5E03735815-AL 363
Routing
13.3 IP forwarding
The following figure shows how to protect your automation system against unauthorized
access.
3&
3&
,3VXEQHW$ ,3VXEQHW'
&3
6&$/$1&(6
&38ZLWK
DFWLYDWHG,3
: IRUZDUGLQJ
; ;
,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
364 Function Manual, 11/2023, A5E03735815-AL
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".
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).
Communication
Function Manual, 11/2023, A5E03735815-AL 365
Routing
13.5 Virtual interface for IP-based applications
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 374).
• You can find additional information on configuration with STEP 7 in the STEP 7 online
help.
Communication
366 Function Manual, 11/2023, A5E03735815-AL
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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 367
Routing
13.5 Virtual interface for IP-based applications
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
communications module. The corresponding connections and S7 communication (e.g. HMI
and BSEND, BRCV) are made via this interface. The OPC UA server does not allow selection of
a specific interface (selection via an IP address), it is only possible to select either all or none.
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
368 Function Manual, 11/2023, A5E03735815-AL
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 369
Routing
13.5 Virtual interface for IP-based applications
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
370 Function Manual, 11/2023, A5E03735815-AL
14
Connection resources
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
Function Manual, 11/2023, A5E03735815-AL 371
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
372 Function Manual, 11/2023, A5E03735815-AL
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.
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 396).
Communication
Function Manual, 11/2023, A5E03735815-AL 373
Connection resources
14.2 Allocation of connection resources
+0,
6 6
Communication
374 Function Manual, 11/2023, A5E03735815-AL
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
Function Manual, 11/2023, A5E03735815-AL 375
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
376 Function Manual, 11/2023, A5E03735815-AL
Connection resources
14.2 Allocation of connection resources
After using a configured connection for data transfer, the connection is not terminated.
The connection resource is permanently occupied. To release the connection resource
again, you need to delete the configured connection in STEP 7 and download the modified
configuration to the CPU.
• PG connection:
As soon as you have connected the PG to a CPU online in STEP 7, connection resources are
occupied.
• Web server:
As long as you have opened the Web server of the CPU in a browser, connection resources
are occupied in the CPU.
• OPC UA server
Each connection to the OPC UA server of the CPU occupies a connection resource in the
station. This connection resource is released immediately when the connection is
terminated.
• OPC UA client
Each connection that the OPC UA client of the CPU has established to an OPC UA server
occupies a connection resource in the station. When an OPC UA connection is established,
the OPC UA client temporarily occupies an additional connection resource. When an OPC
UA connection is terminated, the connection resource is not released again until after a
wait time of approx. 60 seconds in accordance with RFC 793.
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
Function Manual, 11/2023, A5E03735815-AL 377
Connection resources
14.3 Display of the connection resources
Figure 14-4 Example: Reserved and available connection resources (offline view)
Communication
378 Function Manual, 11/2023, A5E03735815-AL
Connection resources
14.3 Display of the connection resources
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 379
Connection resources
14.3 Display of the connection resources
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
380 Function Manual, 11/2023, A5E03735815-AL
15
Diagnostics and fault correction
After selecting the connection in the connections table, you obtain detailed diagnostic
information in the "Connection information" tab.
Communication
Function Manual, 11/2023, A5E03735815-AL 381
Diagnostics and fault correction
15.1 Connection diagnostics
Communication
382 Function Manual, 11/2023, A5E03735815-AL
Diagnostics and fault correction
15.1 Connection diagnostics
Communication
Function Manual, 11/2023, A5E03735815-AL 383
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
384 Function Manual, 11/2023, A5E03735815-AL
16
Communication with the redundant system
S7-1500R/H
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/2023, A5E03735815-AL 385
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
386 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 387
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
388 Function Manual, 11/2023, A5E03735815-AL
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/2023, A5E03735815-AL 389
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
390 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
If the CPUs of the S7‑1500R/H redundant system have two PROFINET interfaces (X1 and X2),
then you can use a system IP address for both PROFINET interfaces. The following describes
how to enable the system IP address for the X1 interface.
To activate the system IP address for your S7‑1500R/H redundant system, follow these steps:
1. In the network view of STEP 7, select the X1 interface of one of the two CPUs.
2. In the Inspector window, navigate to "Properties > General > Ethernet addresses" in the
"System IP address for switched communication" area.
3. Select the check box "Enable the system IP address for switched communication".
STEP 7 automatically creates a system IP address.
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 391
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
Communication
392 Function Manual, 11/2023, A5E03735815-AL
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
QSJNBSZ CBDLVQ
8 8
9 9 9 9
*0EFWJDF
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
Communication
Function Manual, 11/2023, A5E03735815-AL 393
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
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
394 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.2 System IP addresses for communications processors
Communication
Function Manual, 11/2023, A5E03735815-AL 395
Communication with the redundant system S7-1500R/H
16.5 Connection resources of the redundant system S7-1500R/H
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).
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
396 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.5 Connection resources of the redundant system S7-1500R/H
Figure 16-9 Display of the connection resources of the S7‑1500R/H redundant system in STEP 7
Communication
Function Manual, 11/2023, A5E03735815-AL 397
Communication with the redundant system S7-1500R/H
16.6 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
398 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.6 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/2023, A5E03735815-AL 399
Communication with the redundant system S7-1500R/H
16.7 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
16.7.1 Setting up the connection of the Open User Communication with the
redundant S7-1500R/H system
Communication
400 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.7 Open User Communication with the redundant system S7-1500R/H
You can set up the connections via the following IP addresses of the integrated PROFINET
interfaces:
• Device IP addresses:
In redundant mode, the redundant system can establish or terminate connections and
send or receive data via all device IP addresses of the redundant system.
If you set up the connection via a device IP address, communication is routed via the
associated CPU. If the CPU fails, then all communication through the device IP addresses of
that CPU fails.
• System IP addresses:
If you set up the connection via a system IP address, communication is always routed via
the primary CPU.
Decide how you want to set up the connections based on your use case.
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
Communication
Function Manual, 11/2023, A5E03735815-AL 401
Communication with the redundant system S7-1500R/H
16.7 Open User Communication with the redundant system S7-1500R/H
Communication
402 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.7 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/2023, A5E03735815-AL 403
Communication with the redundant system S7-1500R/H
16.7 Open User Communication with the redundant system S7-1500R/H
Communication
404 Function Manual, 11/2023, A5E03735815-AL
Communication with the redundant system S7-1500R/H
16.7 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).
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
Function Manual, 11/2023, A5E03735815-AL 405
Communication with the redundant system S7-1500R/H
16.8 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 57) section.
You can find information about Secure Open User Communication via a CP interface in the
Secure OUC via CP interface (Page 86) section.
Communication
406 Function Manual, 11/2023, A5E03735815-AL
17
Industrial Ethernet Security with CP 1543-1
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.
• 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.
Communication
Function Manual, 11/2023, A5E03735815-AL 407
Industrial Ethernet Security with CP 1543-1
17.2 Logging
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.
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.
Communication
408 Function Manual, 11/2023, A5E03735815-AL
Industrial Ethernet Security with CP 1543-1
17.4 SNMP
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.
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
106).
Communication
Function Manual, 11/2023, A5E03735815-AL 409
Industrial Ethernet Security with CP 1543-1
17.5 VPN
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
410 Function Manual, 11/2023, A5E03735815-AL
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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 411
Glossary
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).
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.
Communication
412 Function Manual, 11/2023, A5E03735815-AL
Glossary
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
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 413
Glossary
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.
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.
Communication
414 Function Manual, 11/2023, A5E03735815-AL
Glossary
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 415
Glossary
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.
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).
Communication
416 Function Manual, 11/2023, A5E03735815-AL
Glossary
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 417
Glossary
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".
TIA Portal V14 has such a root CA certificate:
If you configure the OPC UA server of an S7-1500 in the TIA Portal, the TIA Portal generates
an end-entity certificate for the OPC UA server and signs that certificate with its own private
key.
The signature of this end-entity certificate can be verified with the public key of the TIA
Portal. This key can be found in the root CA certificate of the TIA Portal.
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.
Communication
418 Function Manual, 11/2023, A5E03735815-AL
Glossary
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.
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.
Communication
Function Manual, 11/2023, A5E03735815-AL 419
Glossary
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
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.
Communication
420 Function Manual, 11/2023, A5E03735815-AL
Glossary
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.
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
Function Manual, 11/2023, A5E03735815-AL 421
Index
A Connection resources
Overview, 40
Advanced Encryption Algorithm, 52 Overview, 371
AES, 52 HMI communication, 375
Applicant, 54 S7 routing, 376
Data record routing, 376
Asymmetric encryption, 52 occupying, 376
Station specific, 378
B Module-specific, 379
C D
Certificate authorities, 54 Data consistency, 44
Communication
422 Function Manual, 11/2023, A5E03735815-AL
Index
H OPC UA
Introduction, 157
Handshake Protocol, 53 NodeId, 161
HMI communication, 32, 116 Namespace, 162
Identifier, 162
Security mechanisms, 171
I Signing and encryption, 173
IM, 31 X.509 certificates, 175
Industrial Ethernet Security, 407 Certificate generator, 176
OpenSSL, 176
Interface module, 31 Secure channel, 179
Interfaces for communication, 28 Secure connection, 179
Interfaces of communications modules Layer model, 180
Point-to-point connection, 30 GDS, 182
GDS, 186
Interfaces of communications processors, 29
Security settings, 201
IP address, emergency address (temporary), 384 End points, 201
IP forwarding, 358 PLC tags, 209
DB tags, 209
ISO, 32, 119
OPC UA client
ISO-on-TCP, 119, 127 Basics, 165
Certificate, 329
L Authentication, 331
OPC UA server
Logging, 408 Address space, 163
Basics, 199
M Write and read rights, 209
Performance, 216
Man-in-the-middle attack, 54 Performance increase, 216
Modbus protocol (RTU), 148 XML export file, 217
Modbus TCP, 120 Commissioning, 219
Application name, 219
Addressing, 220
N TCP port, 222
NTP, 32, 409 Subscription, 223
TCP port, 224
Publishing interval, 224
O Sampling interval, 225
Occupation of connection resources, 376 Generating a server certificate, 226
Security settings, 229
Customizing the server certificate, 232
Authentication, 234
Runtime licenses, 237
Runtime licenses, 239
Open communication
Connection configuration, 127
Setting up TCP, ISO-on-TCP, UDP , 127
Setting up e-mail, 135
Setting up FTP, 136
Communication
Function Manual, 11/2023, A5E03735815-AL 423
Index
Communication
424 Function Manual, 11/2023, A5E03735815-AL