Connect SIMATIC HMI to S7-1500R/H
Connect SIMATIC HMI to S7-1500R/H
Legal information
Use of application examples
Application examples illustrate the solution of automation tasks through an interaction of several
components in the form of text, graphics and/or software modules. The application examples are
a free service by Siemens AG and/or a subsidiary of Siemens AG (“Siemens”). They are non-
binding and make no claim to completeness or functionality regarding configuration and
equipment. The application examples merely offer help with typical tasks; they do not constitute
customer-specific solutions. You yourself are responsible for the proper and safe operation of the
products in accordance with applicable regulations and must also check the function of the
respective application example and customize it for your system.
Siemens grants you the non-exclusive, non-sublicensable and non-transferable right to have the
application examples used by technically trained personnel. Any change to the application
examples is your responsibility. Sharing the application examples with third parties or copying the
application examples or excerpts thereof is permitted only in combination with your own products.
The application examples are not required to undergo the customary tests and quality inspections
of a chargeable product; they may have functional and performance defects as well as errors. It is
your responsibility to use them in such a manner that any malfunctions that may occur do not
result in property damage or injury to persons.
Disclaimer of liability
Siemens shall not assume any liability, for any legal reason whatsoever, including, without
limitation, liability for the usability, availability, completeness and freedom from defects of the
application examples as well as for related information, configuration and performance data and
any damage caused thereby. This shall not apply in cases of mandatory liability, for example
under the German Product Liability Act, or in cases of intent, gross negligence, or culpable loss of
life, bodily injury or damage to health, non-compliance with a guarantee, fraudulent
non-disclosure of a defect, or culpable breach of material contractual obligations. Claims for
damages arising from a breach of material contractual obligations shall however be limited to the
© Siemens AG 2020 All rights reserved
foreseeable damage typical of the type of agreement, unless liability arises from intent or gross
negligence or is based on loss of life, bodily injury or damage to health. The foregoing provisions
do not imply any change in the burden of proof to your detriment. You shall indemnify Siemens
against existing or future claims of third parties in this connection except where Siemens is
mandatorily liable.
By using the application examples you acknowledge that Siemens cannot be held liable for any
damage beyond the liability provisions described.
Other information
Siemens reserves the right to make changes to the application examples at any time without
notice. In case of discrepancies between the suggestions in the application examples and other
Siemens publications such as catalogs, the content of the other documentation shall have
precedence.
The Siemens terms of use (https://support.industry.siemens.com) shall also apply.
Security information
Siemens provides products and solutions with industrial security functions that support the secure
operation of plants, systems, machines and networks.
In order to protect plants, systems, machines and networks against cyber threats, it is necessary
to implement – and continuously maintain – a holistic, state-of-the-art industrial security concept.
Siemens’ products and solutions constitute one element of such a concept.
Customers are responsible for preventing unauthorized access to their plants, systems, machines
and networks. Such systems, machines and components should only be connected to an
enterprise network or the Internet if and to the extent such a connection is necessary and only
when appropriate security measures (e.g. firewalls and/or network segmentation) are in place.
For additional information on industrial security measures that may be implemented, please visit
https://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them more secure.
Siemens strongly recommends that product updates are applied as soon as they are available
and that the latest product versions are used. Use of product versions that are no longer
supported, and failure to apply the latest updates may increase customer’s exposure to cyber
threats.
To stay informed about product updates, subscribe to the Siemens Industrial Security RSS Feed
at: https://www.siemens.com/industrialsecurity.
Table of contents
Legal information ......................................................................................................... 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Task ...................................................................................................... 4
1.3 Scope of the application example ........................................................ 4
1.4 Components used ................................................................................ 5
2 Redundantly linking a SIMATIC Panel to an S7-1500R/H controller ............ 6
2.1 Panel directly in the redundant PROFINET ring .................................. 6
2.2 Panel in redundant PROFINET ring via a switch ............................... 11
3 Linking a SIMATIC Panel to an S7-1500R/H controller ................................ 16
3.1 Creating connections .......................................................................... 17
3.2 Creating tags ...................................................................................... 21
3.3 Creating scripts .................................................................................. 23
3.4 Task scheduler ................................................................................... 24
3.5 "20_PlcMonitoring" screen ................................................................. 25
4 Evaluating the operating state of the connection ........................................ 26
4.1 Evaluating the PLC state .................................................................... 26
4.1.1 Parameterization of "R_H_Sys_Status" (FB3) ................................... 27
4.1.2 Parameterization of "plcStateEvaluation" (FB102)............................. 30
© Siemens AG 2020 All rights reserved
1 Introduction
1.1 Overview
Redundant system S7-1500R/H
In an S7-1500R/H redundant system, the CPUs are duplicated (i.e. redundantly
available). Both CPUs process the same project data and the same user program
in parallel. Both CPUs synchronize over two redundancy connections. If one CPU
fails, the other CPU maintains control over the process.
1.2 Task
© Siemens AG 2020 All rights reserved
Figure 1-1
Project_01 109781687_S7_1500H_Monitoring_MRP
Project_02 109781687_S7_1500H_ChangeConnection
Note The configuration for this chapter can be found in the project
"109781687_S7_1500H_Monitoring_MRP ".
Connection between panel ↔ PLC via the "X1 P1 R" and "X1 P2 R" PROFINET interfaces
The operator device is integrated in the redundant PROFINET ring of PLC modules
directly via the "X1 P1 R" and "X1 P2 R" PROFINET interfaces.
• The PROFINET ring is based on media redundancy (MRP).
Media redundancy is a function that ensures network and system availability.
• All PROFINET devices in this PROFINET ring must support media redundancy
(MRP). A detailed description of the "MRP" topic can be found here: \3\.
© Siemens AG 2020 All rights reserved
• The interface has the advantage that, in the event of an error (failure of a
CPU), the connection to the HMI operator device remains intact without
additional configuration effort.
Creating a connection
1. Use the Project tree to open the device configuration of the first PLC module
and then select "Topology view" (1).
The X1 PROFINET interface "Port_2 [X1 P2]" is already networked with both
PLC modules by default (2).
Figure 2-2
2. Network the "X1" PLC interfaces and the interfaces of the Comfort Panel such
that they form a closed ring.
Figure 2-3
Note You must network the devices on the hardware level exactly as you have
arranged them in the configuration.
3. Select the Comfort Panel (1) and open the "Media redundancy" menu item (2)
via the Properties.
(PROFINET interface [X1] > Advanced options > Media redundancy).
Use the drop-down list under "Media redundancy role" (3) to select the option
"Client".
Figure 2-4
3
© Siemens AG 2020 All rights reserved
4. Switch to the "Device view" (1). Select the "X1" PROFINET interface of the first
PLC (2) and specify an IP address (3) for the first PLC under the "Ethernet
addresses" menu.
Figure 2-5
5. In the section below, enable the option "Enable system IP address for switched
communication" and enter an IP address.
The HMI operator device will use this IP address to communicate with the PLC.
Make sure that the IP address is in the same IP range as the IP address
specified previously.
Figure 2-6
6. Click an "empty" field in the Device view and scroll to the second PLC module.
There, select the "Ethernet addresses" menu item and enter an IP address.
In the section below that, the configuration of the first PLC has already enabled
the option "Enable system IP address for switched communication".
Figure 2-7
2 3
Creating a connection
1. Use the Project tree to open the device configuration of the first PLC module
and then select "Topology view" (1).
By default, the PROFINET X1 interface is already networked (2) with both
PLC modules.
Add an MRP-capable switch from the catalog, in this case a SCALANCE X308-
2 (3).
Figure 2-11
2. Network the PLC interfaces and the SCALANCE X308 so that they form a
closed ring.
Note
© Siemens AG 2020 All rights reserved
Only the first two ports on the SCALANCE X308 are MRP-capable!
Figure 2-12
3. Select the SCALANCE X308 (1) and open "Media redundancy" via the
properties (2). ("PROFINET interface [X1] > Advanced options > Media
redundancy > MRP instance 1").
Use the drop-down list under "Media redundancy role" (3) to select the option
"Client".
Figure 2-13
3
2
© Siemens AG 2020 All rights reserved
4. Select the Comfort Panel (1) and open the "Media redundancy" menu item (2)
via the Properties (PROFINET interface [X1] > Advanced options > Media
redundancy).
Use the drop-down list under "Media redundancy role" (3) to select the option
"Client".
Figure 2-14
Figure 2-15
2
© Siemens AG 2020 All rights reserved
Figure 2-16
Frei verwendbar
6. Highlight the Comfort Panel (1) and select the menu item "Ethernet addresses"
via the properties. Enter an IP address (2).
Figure 2-17
2
© Siemens AG 2020 All rights reserved
Figure 2-18
2 3
Note The configuration for this chapter can be found in the project
"109781687_S7_1500H_ChangeConnection".
(Ethernet cable).
• The switch being used does not have to be MRP-capable.
Figure 3-1
1. Use the Project tree to open the device configuration and then select the
"Network view" (1).
Figure 3-2
2. Select the first PLC module and, in the Properties, open the menu "PROFINET
interface [X2] > Ethernet addresses" (1).
Specify an IP address (2) for the first PLC, in the example "192.168.0.100".
Then select the second PLC module (3) and enter another IP address under
"PROFINET interface [X2] > Ethernet addresses", in the example
© Siemens AG 2020 All rights reserved
"192.168.0.102".
Figure 3-3
3. Select the Comfort Panel and open the menu "PROFINET interface [X1] >
Ethernet addresses" in the Properties. Enter an IP address (1), in the example
"192.168.0.200".
Figure 3-4
1
© Siemens AG 2020 All rights reserved
4. In the Network view, select the "Connections" tab (1). Left-click to select the
"X2 interface" of the first PLC (2), then hold down the left mouse button and
drag a connection to the Ethernet interface of the HMI operator device.
A selection window opens.
Here, select "PLC_1" (3).
Figure 3-5
2 3
5. Left-click to select the "X2 interface" of the second PLC (2), then hold down the
left mouse button and drag a connection to the Ethernet interface of the
HMI operator device. A selection window opens.
Here, select "PLC_2" (3).
Figure 3-6
2 3
6. A third HMI connection is needed so that the connection to the HMI operator
device automatically switches over in the event of a fault (failure of a PLC). The
switchover is accomplished with scripts in the HMI configuration.
Via the Project tree, select the Comfort Panel and open the "Connection" (1).
You will see the two connections that you created earlier (2).
Manually add a third connection with "<Add new>" (3).
Figure 3-7
© Siemens AG 2020 All rights reserved
3
1
3
2
© Siemens AG 2020 All rights reserved
Table 3-1
Tag Type Connection
con_state_PLC1 Integer Internal tag
con_state_PLC2 Integer Internal tag
connected_to WString Internal tag
triggerBitPLC1 Bool HMI_Connection1
(Clock memory)
triggerBitPLC2 Bool HMI_Connection2
(Clock memory)
Figure 3-9
© Siemens AG 2020 All rights reserved
Figure 3-10
© Siemens AG 2020 All rights reserved
Note Default communication between the H CPU and the HMI operator device
happens over the connection "Connection12".
Script "connection_lost"
You do not need to modify this script for the application.
The script is called once every minute by the Task scheduler.
Script "connection_PLC1"
Modify the parameters to suit your application.
The script is called once a second via the tag "triggerBitPlc" (clock memory).
1. Call the script with "Project tree > Scripts > VB scripts >
ApplicationChangeConnection".
2. You have to adjust the parameters of the "ChangeConnection" function in line
40 (1) and line 55 (2).
– Connection name: The name must match the name stored under
© Siemens AG 2020 All rights reserved
Figure 3-11
3 4
Script "connection_PLC2"
Modify the parameters to suit your application.
The script is called once a second via the tag "triggerBitPlc2" (clock memory).
1. Call the script with "Project tree > Scripts > VB scripts >
ApplicationChangeConnection".
2. You have to adjust the parameters of the "ChangeConnection" function in line
41 (1) and line 55 (2).
– Connection name: The name must match the name stored under
"Connections". In this case, the name is "Connection12" (3).
– Modify the IP address as per the second connection (4).
Figure 3-12
1
© Siemens AG 2020 All rights reserved
3 4
1 1
© Siemens AG 2020 All rights reserved
2
1
Configured "FB3"
(1) Input parameters with the system constants
(2) You can navigate to the system constants using the button.
System constants in use (HW identifier)
Figure 4-3
– 65147 – PLC_1
– 65347 – PLC_2
– 34 – PLC_1
– 65164 – PLC_1
– 65364 – PLC_2
(3) Output parameters used for further evaluation.
Figure 4-4
© Siemens AG 2020 All rights reserved
• This FB evaluates the output signals from "FB3" and forwards them to the
HMI operator device.
• The function block is called via the OB "Main" (OB1).
• The input parameters of "FB102" (1) correspond to the output parameters of
the FB "R_H_Sys_Status" (FB3).
The individual PLC states are forwarded to the HMI operator device via the
output parameters (2). A faceplate is created for the display.
Figure 4-6
2
© Siemens AG 2020 All rights reserved
All blocks listed above can be found in the global library "MonitoringS7_1500".
(1) PLC program blocks
• If, for example, you select a "folder" and add it to your project, all blocks inside
that folder will also be added. This ensures that no blocks are forgotten.
• The numbers marked in "red" describe the order in which you should add the
folders (program elements) to your project.
Figure 4-7
1 1
© Siemens AG 2020 All rights reserved
3
2
4.2.1 Tags
The tags are located in the folder "TagsApplication_TP" (1); they are the output
parameters of the function block "FB102". These are passed to the faceplate and
its interface.
Figure 4-8
© Siemens AG 2020 All rights reserved
Tag "hmiDatatransferTP1200_plcStopMonitoring"
Two properties are assigned to the tags.
• Properties > Properties > Settings
– Acquisition mode: Cyclic continuous
– Acquisition cycle: 500 ms
• Properties > Events > Value change
– SetTag (see figure)
Figure 4-9
© Siemens AG 2020 All rights reserved
4.2.2 Faceplate
Principle of operation
• A fixed value of "200" for the tag "plcStopMonitoring" is passed via the
controller.
• This value is overwritten by the script once a minute with the value "zero".
• As long as there is a connection, the value reset by the script is in turn
overwritten with "200".
• If there is no connection, then the value remains "zero" and an alarm is output
via the HMI operator device after a delay period.
The "plcStopMonitoring" script is called once a minute with the Task scheduler.
The "20_PlcMonitoring" screen has been created for the evaluation. The screen
contains a faceplate which outputs the PLC status.
The faceplate is stored in the attached project and in the library.
Figure 4-11
© Siemens AG 2020 All rights reserved
5 Appendix
5.1 Service and support
Industry Online Support
Do you have any questions or need assistance?
Siemens Industry Online Support offers round the clock access to our entire
service and support know-how and portfolio.
The Industry Online Support is the central address for information about our
products, solutions and services.
Product information, manuals, downloads, FAQs, application examples and videos
– all information is accessible with just a few mouse clicks:
https://support.industry.siemens.com
Technical Support
The Technical Support of Siemens Industry provides you fast and competent
support regarding all technical queries with numerous tailor-made offers
– ranging from basic support to individual support contracts. Please send queries
to Technical Support via Web form:
www.siemens.com/industry/supportrequest
© Siemens AG 2020 All rights reserved
Service offer
Our range of services includes the following:
• Plant data services
• Spare parts services
• Repair services
• On-site and maintenance services
• Retrofitting and modernization services
• Service programs and contracts
You can find detailed information on our range of services in the service catalog
web page:
https://support.industry.siemens.com/cs/sc
https://support.industry.siemens.com/cs/ww/en/view/68014632