Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the...

41
http://support.automation.siemens.com/WW/view/en/99923489 Application Description 10/2014 IE S7 OPC Redundancy OPC UA, WinCC Runtime Advanced

Transcript of Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the...

Page 1: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

http://support.automation.siemens.com/WW/view/en/99923489

Application Description 10/2014

IE S7 OPC Redundancy OPC UA, WinCC Runtime Advanced

Page 2: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

Warranty and Liability

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Warranty and Liability

Note The Application Examples are not binding and do not claim to be complete regarding the circuits shown, equipping and any eventuality. The Application Examples do not represent customer-specific solutions. They are only intended to provide support for typical applications. You are responsible for ensuring that the described products are used correctly. These Application Examples do not relieve you of the responsibility to use sound practices in application, installation, operation and maintenance. When using these Application Examples, you recognize that we cannot be made liable for any damage/claims beyond the liability clause described. We reserve the right to make changes to these Application Examples at any time and without prior notice. If there are any deviations between the recommendations provided in these Application Examples and other Siemens publications – e.g. Catalogs – the contents of the other documents have priority.

We do not accept any liability for the information contained in this document. Any claims against us – based on whatever legal reason – resulting from the use of the examples, information, programs, engineering and performance data etc., described in this Application Example shall be excluded. Such an exclusion shall not apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life, body or health, guarantee for the quality of a product, fraudulent concealment of a deficiency or breach of a condition which goes to the root of the contract (“wesentliche Vertragspflichten”). The damages for a breach of a substantial contractual obligation are, however, limited to the foreseeable damage, typical for the type of contract, except in the event of intent or gross negligence or injury to life, body or health. The above provisions do not imply a change of the burden of proof to your detriment. Any form of duplication or distribution of these Application Examples or excerpts hereof is prohibited without the expressed consent of Siemens Industry Sector.

Security informa-

tion

Siemens provides products and solutions with industrial security functions that support the secure operation of plants, solutions, machines, equipment and/or networks. They are important components in a holistic industrial security concept. With this in mind, Siemens’ products and solutions undergo continuous development. Siemens recommends strongly that you regularly check for product updates.

For the secure operation of Siemens products and solutions, it is necessary to take suitable preventive action (e.g. cell protection concept) and integrate each component into a holistic, state-of-the-art industrial security concept. Third-party products that may be in use should also be considered. For more information about industrial security, visit http://www.siemens.com/industrialsecurity.

To stay informed about product updates as they occur, sign up for a product-specific newsletter. For more information, visit http://support.automation.siemens.com.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 2

Page 3: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

Table of Contents

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Table of Contents Warranty and Liability ................................................................................................. 2

1 Task ..................................................................................................................... 4 2 Solution............................................................................................................... 5

2.1 Overview............................................................................................... 5 2.2 WinCC application as OPC UA client ................................................... 6 2.3 Hardware and software components ................................................... 7 2.3.1 Validity .................................................................................................. 7 2.3.2 Components used ................................................................................ 7

3 Basics of IE S7 OPC Redundancy ................................................................. 10

3.1 Network Load Balancing (NLB) .......................................................... 10 3.2 S7 OPC Redundancy ......................................................................... 11 3.2.1 General ............................................................................................... 11 3.2.2 Reconnect process after server failure .............................................. 12 3.2.3 Data synchronization between redundant OPC UA servers .............. 13

4 Functional Principle ........................................................................................ 14

4.1 General overview ............................................................................... 14 4.2 Configurations in the S7 CPU ............................................................ 15 4.3 Redundant OPC servers .................................................................... 16 4.4 OPC client: WinCC Runtime Advanced ............................................. 17

5 Configuration and Settings of S7 OPC Redundancy ................................... 18

5.1 Planning.............................................................................................. 18 5.2 Installing SIMATIC NET and STEP 7 ................................................. 19 5.3 Installing and setting up Network Load Balancing (NLB) in

Windows ............................................................................................. 19 5.4 Configuring and setting in STEP 7 ..................................................... 24 5.4.1 Configuring the S7 CPU ..................................................................... 24 5.4.2 Redundant OPC UA servers .............................................................. 25 5.4.3 Connecting to WinCC Advanced ........................................................ 30 5.5 Downloading the configuration ........................................................... 33 5.5.1 Downloading to the S7 CPU .............................................................. 33 5.5.2 Downloading to the Station Configuration Editor ............................... 34

6 Installation and Commissioning .................................................................... 36

6.1 Installation of the hardware ................................................................ 36 6.2 Installation of the software.................................................................. 37 6.3 Commissioning ................................................................................... 37

7 Operation of the Application .......................................................................... 39

Scenario: Failure of the active OPC UA server ................................................. 39 8 References ....................................................................................................... 40

9 History............................................................................................................... 41

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 3

Page 4: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

1 Task

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

1 Task Introduction

For monitoring and analyzing the state of a heterogeneous plant, a direct connection of the HMI to the field PLCs is often not reasonable or hardly possible, also due to the very large amounts of data. It is therefore necessary to create a uniform interface from the field and control level to the management level. OPC UA provides such a manufacturer-independent interface. To ensure increased availability of the SCADA system connected to a (or several) OPC server(s), a redundant version of the OPC servers is advantageous.

Overview of the automation task The figure below gives an overview of the automation task. Figure 1-1

Field and control level

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 4

Page 5: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

2 Solution 2.1 Overview

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

2 Solution 2.1 Overview

OPC servers To ensure increased availability of the OPC servers, the S7 OPC Redundancy product is available from SIMATIC NET DVD V8.1 on. S7 OPC Redundancy serves for setting up redundant OPC UA servers with transparent switchover mechanisms to OPC UA clients. On the OPC client side, no additional software is required for that.

Schematic layout The scheme below shows the most important components of the solution: Figure 2-1

Industrial Ethernet

PROFINET IE

htC servers

Redundancy group

S7-300

C client

S7-400

Restricted:S7-1200/S7-1500

Advantages The application example provides one consistent project from the S7 CPU to the OPC client via a redundant server connection: • Step-by-step instructions for installing S7 OPC Redundancy

– Setting up Network Load Balancing (NLB) – Creating the configuration in STEP 7 V13 – Configuring and connecting an OPC client using the example of WinCC

Runtime Advanced – Setting and configuring the S7-300 CPU

• Sample project for adjusting and comprehending the configuration

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 5

Page 6: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

2 Solution 2.2 WinCC application as OPC UA client

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Delimitation This application does not include any • description of the Engineering Frameworks TIA Portal, • code for the implementation of an OPC client. Basic knowledge of these topics is assumed.

2.2 WinCC application as OPC UA client

The WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently possible, • which OPC server is currently active for the OPC client. Figure 2-2 WinCC screen

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 6

Page 7: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

2 Solution 2.3 Hardware and software components

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

2.3 Hardware and software components

2.3.1 Validity

Usage This application is valid for: • WinCC RT Advanced from V13 on • STEP 7 from V13 on • S7-300/S7-400 CPUs • SIMATIC NET from V8.1 on • Windows Server 2008 R2 This application is valid with restrictions for S7-1200/S7-1500 CPUs.

Restrictions for S7-1200/S7-1500 It is not possible to establish redundant connections to the S7-1200/S7-1500 CPUs with the OPC server V12. Remedy: • Using the OPC server less or equal to Version 8.2. • Deactivating the optimized data blocks in areas accessed by the OPC server

(this affects the performance of the S7-PLC).

2.3.2 Components used

The application was generated with the following components:

Hardware components Table 2-1

Component No. Article number Note

SIMATIC IPC647C 2 6AG4104-2CP21-0BX0 You can also use different server PCs with a Windows Server 2008 R2 operating system.

Field PG M4 1 6ES7716-.....-0... Serves as engineering station; WinCC Runtime runs on the field PG; you can also use any other PC with the corresponding hardware and software requirements.

CPU 315-2PN/DP 1 6ES7315-2EH14-0AB0 You can also use a different S7 CPU with Ethernet interface.

SCALANCE X208 1 6GK5208-0BA10-2AA3 You can also use a different switch for linking the components.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 7

Page 8: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

2 Solution 2.3 Hardware and software components

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Alternative hardware components The hardware components listed above do not allow any separation between automation and office network. To realize such a separation and a setup as shown in Figure 2-1, the following components are required: Table 2-2

Component No. Article number Note

SIMATIC IPC647C 2 6AG4104-2CP21-0BX0 You can also use different server PCs with a Windows Server 2008 R2 operating system.

CP 1628 communication processor

2 6GK1162-8AA00 The CP1628 can serve as an interface to the automation network.

Field PG M4 1 6ES7716-.....-0... Serves as engineering station; WinCC Runtime runs on the field PG; you can also use any other PC with the corresponding hardware and software requirements.

CPU 315-2PN/DP 1 6ES7315-2EH14-0AB0 You can also use a different S7 CPU with Ethernet interface.

SCALANCE X208 2 6GK5208-0BA10-2AA3 You can also use a different switch for linking the components.

Note The reason for the different hardware requirements for a separation of the networks is the quantity structures of SIMATIC NET with regard to the Ethernet interfaces.

Software components Table 2-3

Component No. Article number Note

WinCC Runtime Advanced V13

1 6AV2104-0BA03-0AA0

SIMATIC STEP 7 Professional V13

1 6ES7822-1AA03-0YA5 For CPU configuration

SOFTNET-IE S7 Lean license

2 6GK1704-1LW12-0AA0 For connecting the S7 CPU with an S7 connection

IE S7 OPC REDUNDANCY license

1 6GK1706-1CW12-0AA0 For redundant S7 OPC UA servers

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 8

Page 9: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

2 Solution 2.3 Hardware and software components

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Sample files and projects The following list includes all files and projects that are used in this example. Table 2-4

Component Note

99923489_OPC_Redundancy_CODE_v1_0.zip This zip file contains the STEP 7 project.

99923489_S7_OPC_UA_Redundancy_DOKU_v1_0_de.pdf This document.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 9

Page 10: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

3 Basics of IE S7 OPC Redundancy 3.1 Network Load Balancing (NLB)

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

3 Basics of IE S7 OPC Redundancy 3.1 Network Load Balancing (NLB)

Function The Network Load Balancing (NLB) feature provided by Windows serves for increasing the server reliability and for scaling the server performance. With Network Load Balancing, several computers are assembled in a cluster (see also \4\). This feature makes for a distribution of the load to all servers of a cluster. If a server fails, the load will be distributed to the remaining servers. For S7 OPC Redundancy, a cluster with the size of two servers max. is approved.

Windows Server The Windows Network Load Balancing (NLB) feature is a prerequisite for transparent OPC UA redundancy. Since NLB is only available with Windows Server operating systems, a Windows Server operating system is a minimum requirement. From SIMATIC NET PC Software V8.1 on, "Windows Server 2008 R2 64 Bit" is required for that.

Client For OPC client applications, the servers are addressed under a cluster IP address. If a server fails or goes offline, the switchover will be effected completely transparently for the client. Upon reconnection, the client – provided that it is programmed correctly – will connect with an already known session of the yet active server (about client programming, see also \3\, chapter 4.5.5).

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 10

Page 11: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

3 Basics of IE S7 OPC Redundancy 3.2 S7 OPC Redundancy

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

3.2 S7 OPC Redundancy

3.2.1 General

Function The OPC UA servers work on the basis of Network Load Balancing. If one of the redundant OPC UA servers fails, the communication performance will be completely taken over by the remaining servers, if possible. Figure 3-1

C client

htC UA Server II

Precondition To use S7 OPC Redundancy, the following requirements must be met: Table 3-1

Requirement for Type

Operating system (server) Windows Server 2008 R2 64bit Operating system (client) No restrictions OPC server

OPC UA Two redundant servers max.

OPC client OPC UA standard-compliant behavior(see \3\, chapter 4.5.5) Items must be polled to promptly get server status changes.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 11

Page 12: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

3 Basics of IE S7 OPC Redundancy 3.2 S7 OPC Redundancy

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

3.2.2 Reconnect process after server failure

Failure The failure of an OPC server must be detected by the following components (cf. Figure 3-1): • Network Load Balancing (NLB) • OPC UA client

Figure 3-2 Reconnect process

Detection and reconnection Figure 3-1 shows the detection of a server failure and the reconnect process: 1. Failure of the active server. 2. The Network Load Balancing feature detects after approx. 10 seconds the

failure of the OPC UA server; it then redirects the client to the available second OPC UA server.

3. The period of time until the OPC UA client detects the failure of the OPC UA server depends on the configuration and programming of the client. For the OPC client of WinCC Runtime Advanced, it is not possible to make any such settings.

4. Activation of the session. – A new "SecureChannel" is created. – The already existing session is activated via ActivateSession with

assignment of the SecureChannel. Normal transparent continuation of the client subscriptions (see also \3\, chapter 4.5.4.)

5. Sending of the "data change event" from the OPC UA server to the clients. The clients are thus requested to recall their data.

An OPC client must realize steps 4 and 5 (see also \3\, chapter 4.5.4.) after a disconnection in order to support a transparent switchover.

Detection of the server failure The table below gives an overview of the factors playing a role in the detection of the server failure:

1

2

3

4

5

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 12

Page 13: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

3 Basics of IE S7 OPC Redundancy 3.2 S7 OPC Redundancy

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Table 3-2

Method in the OPC client Parameters

Cyclic reading of the server status

• Cycle time for the read job • Timeout for the read job • Retry of the job in the event of a fault

Monitoring of the KeepAlive value of the subscription

• KeepAlive time • Waiting time until error message

3.2.3 Data synchronization between redundant OPC UA servers

OPC UA communication to the OPC clients During a server switchover it might happen that values are transmitted that are older than the values before the redundancy switchover. Therefore, when processing tags, the client must consider the respective time stamps when reading and monitoring values.

Communication between PLC and redundant OPC servers The following recommendations are to be observed for the programming of a CPU with a connected OPC UA server set: • BSEND/BRCV

The BSEND/BRCV connections must be programmed separately for each S7 connection. The function block call of one of the two S7 connections has to be acknowledged negatively or canceled. Even if the function block call is successful, data might be lost during a redundancy switchover. To work reliably with the BSEND/BRCV services, greater programming effort in the S7 CPU is necessary.

• PUT/GET For each of the S7 connections, the PUT/GET communication services must be programmed separately. Please note that the local data on the redundant servers are not synchronized with each other.

• Time synchronization To prevent unwanted time leaps, manual synchronization of the redundancy servers is recommended (e.g., NTP, …).

For further notes, also regarding the A&C services of the OPC server, please refer to manual \3\, chapters 4.5.4 to 4.5.9.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 13

Page 14: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

4 Functional Principle 4.1 General overview

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

4 Functional Principle This chapter describes the functional principle of the application example and is subdivided into the description of the • configuration in the S7 CPU • OPC server configuration • OPC client configuration (WinCC Runtime Advanced)

4.1 General overview

The screenshot below shows one of the HMI screens. Figure 4-1

Table 4-1

No. Meaning

1. 2.

Tabs for switching the screens between encrypted and not encrypted connection. Note: With regard to the function, both connection types are identical. For reasons of security, the use of encrypted connections is recommended in productive operation.

3. Indication of the clock memory in the subordinate S7 CPU. 4. Indication of the current server redundancy status:

0. None 1. Cold 2. Warm 3. Hot

1 2

3

4

5

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 14

Page 15: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

4 Functional Principle 4.2 Configurations in the S7 CPU

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Meaning 4. Transparent

5. Indication of the currently active redundant server. About the division of the IP addresses, see chapter 5.1.

4.2 Configurations in the S7 CPU

Field and control level The S7-300 CPU included in the project symbolizes the field and control level of an automation system.

S7 connections The S7-300 is connected to the two OPC servers via one separate S7 connection each. Using active and permanently established S7 connections is recommended. For the S7 CPU, the IE S7 OPC Redundancy is not transparent. The following recommendations are to be observed in order to allow switching between the servers in the event of a fault: • Block-oriented "BSEND/BRCV" services and the S7 connection itself must be

configured and programmed separately for each OPC UA server. The function block calls should preferably be made simultaneously in the program (i.e., directly one after the other with identical interconnection), with the call from the redundant server side being acknowledged negatively or having to be canceled by the user program.

• PUT/GET communication services must be configured separately for each S7 connection. Thus, every server gets data from the S7 CPU. Please note that no data synchronization takes place between the OPC UA servers. By considering the time stamps on the OPC UA client side, invalid values can be sorted out.

Clock memory To allow easy visual examination of the connection to the S7 CPU, the CPU's clock memory is activated. Figure 4-2 Clock memory

For symbolic access, each bit of the clock memory is assigned a symbolic name via the tag table.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 15

Page 16: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

4 Functional Principle 4.3 Redundant OPC servers

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Figure 4-3

4.3 Redundant OPC servers

Transition between control level and (process) management level The redundant OPC servers realize the transition from the control level to the (process) management level. The redundant connection to the management level allows increased availability.

Connection to the control level The connection of the redundant servers is effected via one S7 connection each to the S7-300. The establishment as "redundant S7 connection" is effected automatically after the OPC UA Redundancy has been activated on both servers. The procedure for configuring the redundant OPC servers is described in chapter 5.4.2.

Figure 4-4

Connection of the OPC UA client of WinCC Runtime Advanced The connection of the OPC UA client of WinCC Runtime Advanced to the redundant S7 OPC servers is effected via the cluster IP address and the configured port (cf. chapter 4.4).

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 16

Page 17: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

4 Functional Principle 4.4 OPC client: WinCC Runtime Advanced

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

4.4 OPC client: WinCC Runtime Advanced

(Process) management level WinCC Runtime visualizes the connection to the redundant OPC UA servers.

Redundant connection to the OPC UA servers For the OPC client, the IE S7 OPC Redundancy switches completely transparently. Therefore, to set up a redundant connection from the client to the servers, the correct server end point has to be specified. The server end point is composed of the following: opc.tcp://[cluster IP address]:[configured port] The cluster IP address is configured in NLB (cf. chapter 5.3) as well as in STEP 7 (cf. chapter 5.4.2). The port is specified via the STEP 7 configuration (cf. chapter 5.4.2).

Visualization In WinCC Runtime, the clock memory of the S7 CPU and two status tags of the redundant OPC servers are visualized (cf. chapter 4.1).

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 17

Page 18: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.1 Planning

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

5 Configuration and Settings of S7 OPC Redundancy To set up S7 OPC Redundancy between two servers, the following steps must be taken: 1. Planning IP addresses and PC names 2. Installing SIMATIC NET (from V8.1 on) and STEP 7 3. Installing Network Load Balancing (NLB) and setting up the Windows

environment 4. Configuring and setting S7-CPU, S7 OPC Redundancy, and the connection to

the WinCC OPC UA client in STEP 7 5. Downloading the configuration to the Station Configuration Editor 6. Connecting an OPC client with the end point of the redundant OPC server

5.1 Planning

Before establishing a redundant OPC connection to the OPC clients, the following parameters must be defined: 1. Network settings (IP address, subnet masks, gateway) for

a. Server 1 b. Server 2 c. Computer with OPC client d. S7 CPU

2. Cluster IP address for NLB 3. PC station name The configuration shown in the following example works with the following parameters: Table 5-1

Type Function IP address Station name

S7-300 CPU

Simulation of process data

172.16.46.11 255.255.0.0

-

PC station

1st OPC server 172.16.46.111 255.255.0.0

Kalliope

PC station

2nd OPC server 172.16.46.112 255.255.0.0

Kalliope2

PC station

OPC client (WinCC)

172.16.46.199 255.255.0.0

SIMNETPCSTATION

NLB Cluster IP address

172.16.46.110 -

Note If you physically separate production and office network as recommended, of course, you will need two separate addresses each in different subnetworks for the PC stations of the OPC servers.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 18

Page 19: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.2 Installing SIMATIC NET and STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

5.2 Installing SIMATIC NET and STEP 7 Table 5-2

No. Action

1. Install STEP 7 V13 as described in manual \5\ on your engineering station. 2. Install WinCC Advanced V13 as described in manual \6\ on your engineering station. 3. Install SIMATIC NET V13 as described in manual \7\ on your server stations.

5.3 Installing and setting up Network Load Balancing (NLB) in Windows

Precondition From SIMATIC NET V8.1 on, Windows Server 2008 R2 64Bit is required as operating system for the use of S7 OPC Redundancy.

Installation Table 5-3

No. Action

1. Go to "Start > Control Panel > Administration > Server Manager > Features" to open the window with an overview of the currently active features.

2. Click on "Add Features". 3. Select the "Network Load Balancing" feature and click on "Install". 4. Follow the installation instructions.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 19

Page 20: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.3 Installing and setting up Network Load Balancing (NLB) in Windows

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

Configuration The table below shows how to configure Network Load Balancing with Windows Server 2008 R2.

Table 5-4

No. Action

1. Assign the relevant IP addresses to your servers via the Network and Sharing Center: • 172.16.46.111 • 172.16.46.112 Subnet mask: 255.255.0.0

2. Go to "Start > right-click on computer > Properties > Change settings > Change" to assign the agreed PC station name to your servers.

In this case: • Kalliope or • Kalliope2 Restart the server afterwards.

3. Go to "Start > Control Panel > Administration > Network Load Balancing Manager" to start the Network Load Balancing Manager.

4. Under "Options > Credentials", enter the login information for the remote server first.

1

2

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 20

Page 21: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.3 Installing and setting up Network Load Balancing (NLB) in Windows

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

5. Now open the wizard for setting up a cluster by right-clicking on "Network Load Balancing Cluster > New Cluster".

6. Enter the IP address of a server and click on "Connect". The available interfaces of the server

are provided for selection. Select the interface "172.16.46.111" (or "172.16.46.112") and click on "Next".

7. In the following dialog, directly click on "Next". 8. Enter the NLB cluster address.

In this case: 172.16.46.110.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 21

Page 22: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.3 Installing and setting up Network Load Balancing (NLB) in Windows

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

9. Enter a symbolic name for the cluster address, if desired. Using the "Multicast" or "IGMP-Multicast" setting is recommended. Click on "Next".

10. Now you can define the port rules for the load balancing. One port rule is already provided by

default. Please note that the definition of port rules might affect your application on the server. Close the wizard by clicking on "Finish".

The server is now configured for network load balancing.

11. Right-click on the cluster and click on "Add Host to Cluster".

12. Add the second server to the cluster analogously to the first server (cf. steps 6-11)

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 22

Page 23: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.3 Installing and setting up Network Load Balancing (NLB) in Windows

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

13. If your configuration has been successful, both servers are displayed with a green background in the Network Load Balancing Manager.

The cluster IP address is available from a PC in the network as long as one of the two servers is available.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 23

Page 24: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

5.4 Configuring and setting in STEP 7

This chapter describes step by step the procedure for setting a STEP 7 project with • one CPU 315-2 PN/DP • tow PC stations with a redundant OPC server • one PC station with WinCC Runtime Advanced as OPC client. First, create a new STEP 7 project.

5.4.1 Configuring the S7 CPU

The table below shows the procedure for adding a CPU 315-2 PN/DP to your STEP 7 project.

Table 5-5

No. Action

1. Add a new device to your STEP 7 project. Select the CPU 315-2 PN/DP.

2. In the "Network view", click on the Ethernet interface of the CPU, go to "Properties > Ethernet

addresses" and assign an IP address and a subnet mask: 172.16.46.11 255.255.0.0

3. In the project navigation, go to "[YOUR_PLC] > PLC variables > Show all variables" and add a

symbol so that it can later be displayed in WinCC Runtime. For example, MB0 as "MemoryByte":

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 24

Page 25: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

5.4.2 Redundant OPC UA servers

The table below shows exemplarily how to set up two PC stations as redundant S7 OPC server pair in STEP 7.

Table 5-6

No. Action

1. Add a new PC station to your STEP 7 project.

2. Go to the properties of the PC station by right-clicking > Properties in the project navigation.

Adjust the name of the PC station.

3. Check the "Generate XDB file" check box.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 25

Page 26: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

4. Open the device view of the PC station and add the OPC server V12 and the Ethernet interface "IE general" via the hardware catalog.

5. Go to the properties of the Ethernet card and set the IP address and subnet mask in the

inspector window.

6. Additionally define a unique PROFINET name for the Ethernet card.

Note: The names can be assigned freely, the names used here are only suggestions. There must not be two identical PROFINET names within one project.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 26

Page 27: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

7. Change to the properties of an OPC server. Go to "S7 > OPC tags". Check the "All" check box. Thus, you get symbolic access to the tags of the S7 CPUs connected with an S7 connection.

8. Change to the network view and copy the PC station.

9. Repeat steps 2-6 with adjusted names for the second PC station.

Result: You have two PC stations in your STEP 7 project that are identical except for their names.

10. Change to the properties of an OPC server. Navigate to "S7 > S7 UA redundancy".

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 27

Page 28: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

11. Check the "Enable redundancy" check box and set the parameters for S7 UA Redundancy: • IP address: 172.16.46.110 • Redundancy port: 4845 • Server-to-server port: 4846 • Server-to-server interface: 172.16.46.111

Note: You can also select a different free port. Port 4845 as redundancy port is preset as default value.

12. Change to the partner server and set the redundancy parameters there, too. If the configuration is correct, the entry at "Redundancy group" will change to 172.16.46.110.

Thus, the S7 OPC redundancy group is set in STEP 7.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 28

Page 29: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

13. Now add one S7 connection each between S7 CPU and the two OPC servers. Change to the network view, click on "Connections" and select "S7 connection" in the drop-down menu.

Add an S7 connection from each OPC server to the S7 CPU using drag & drop.

In the tabular area of the device view, the added connections are automatically named "Red_xxx".

14. Select an added S7 connection and navigate to "OPC". There, select "Maintain connection

permanently".

15. Repeat step 14 for the second S7 connection. 16. Now you have configured a redundant S7 UA server with access to the S7-300 CPU.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 29

Page 30: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

5.4.3 Connecting to WinCC Advanced

The table below describes step by step the procedure for connecting a WinCC Runtime Advanced application in STEP 7 to a redundant OPC server.

Table 5-7

No. Action

1. Set up the redundant OPC UA server by following the instructions in chapters 5.4.2 and 5.5.1. 2. Add another PC station to your STEP 7 project. 3. Open the device view of the PC station. Add a WinCC RT Advanced application from the

hardware catalog to the PC station.

4. In the project navigation, go to "PC Station > HMI_RT_1 > Connections".

Add a new OPC UA connection. 5. Set the connection parameters.

These step-by-step instructions describe how to establish an encrypted OPC UA connection. Use the local server end point (cluster IP address) with the configured port number. In this case: opc.tcp://172.16.46.110:4845

6. In the project navigation, go to the "HMI tags" folder and open a tag table.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 30

Page 31: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

7. Add a new tag. Assign a tag name and select the just set up OPC UA connection as connection.

8. Now select the arrow for the drop-down menu. The internal OPC client of WinCC now tries to

browse the items of the OPC UA server. Since an encrypted connection was configured, the following error message is output:

9. Change to one of the redundant OPC servers and open the OPC communication settings

under "Start > All Programs > Siemens Automation > SIMATIC > SIMATIC NET > Communication Settings".

10. Open "SIMATIC NET configuration > OPC settings > OPC UA certificates". Right-click on the "Siemens OPC UA Client for WinCC" certificate and accept communication.

11. Return to the engineering station. In the project navigation of the STEP 7 project, navigate to

the "HMI tags" folder and open a tag table. 12. Now select in the tag added in step 7 the arrow for the drop-down menu at "Address". The

internal OPC client of WinCC now tries to browse the items of the OPC UA server. As access was accepted in step 10, you can now browse the tags of the OPC server.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 31

Page 32: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.4 Configuring and setting in STEP 7

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

13. Browse any item of the OPC server and add it to the WinCC tag management. The screenshot shows how to add the server item "CurrentServerId", which displays the currently active OPC UA server. Of course, you can also add tags of the S7 CPU, for example, the "MemoryByte" tag (cf. chapter 5.4.1).

14. Now add a new screen to your project under "Screens". Add an input/output field from the toolbox to the screen.

You can also create a second input/output field, for example, to have the "MemoryByte" tag displayed.

15. Connect the first input/output field with the tag added in step 11 on the "Properties" tab in the inspector window.

16. Make sure that the configuration has already been downloaded to the CPU and OPC server

(cf. chapter 5.5). 17. Start HMI Runtime. The WinCC OPC UA client tries to connect with the OPC server. 18. Now stop WinCC Runtime again. 19. Change to an OPC server and accept the certificate named "WinCC_RT_Advanced@xxxx" as

described in step 10, where 'xxxx' stands for the name of the PC station with OPC client.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 32

Page 33: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.5 Downloading the configuration

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

20. Open the following folder path on the PC with WinCC Runtime: C:\ProgramData\Siemens\CoRtHmiRTm\OPC\PKI\CA\default This path includes the following folders for the certificates of the OPC UA client:

Open the "rejected" folder. Cut the available certificate and paste it to the "certs" folder.

21. Now restart WinCC Runtime. The connection between the OPC UA server and OPC UA client is now established and you can read out and write the added items via the input/output field(s).

5.5 Downloading the configuration

5.5.1 Downloading to the S7 CPU

The table below shows the procedure for downloading the configuration to your S7-CPU.

Table 5-8

No. Action

1. Reset your CPU to the factory settings and format the memory card. 2. In STEP 7 V13, click on "Online > Extended download to device…".

3. Determine the interface to which the CPU is connected and start the search for the CPU.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 33

Page 34: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.5 Downloading the configuration

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

4. Click on "Download" and confirm the subsequent dialogs to download the project to the CPU.

5.5.2 Downloading to the Station Configuration Editor

The table below shows the procedure for downloading the configuration to the redundant OPC servers.

Table 5-9

No. Action

1. Compile the PC stations in the SIMATIC STEP 7 project. Based on the configuration in chapter 5.4.2, step 3, an XDB file is created at the specified storage location after successful compilation.

2. Transfer each XDB file to the server (using an USB stick, for example). 3. Open the Station Configuration Editor via the task bar on your server.

4. Click on "Import station" and confirm the appearing dialog with "OK".

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 34

Page 35: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

5 Configuration and Settings of S7 OPC Redundancy 5.5 Downloading the configuration

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action

5. Select the transferred XDB file and then confirm with "Open". A window is opened, which you confirm with "OK".

6. If station import has been successful, the Station Configuration Editor should look similar to

the following:

7. Remote downloading to the PC station using STEP 7 is alternatively possible.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 35

Page 36: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

6 Installation and Commissioning 6.1 Installation of the hardware

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

6 Installation and Commissioning This chapter describes the commissioning of the STEP 7 project.

6.1 Installation of the hardware

The figure below shows the hardware setup of the application. Figure 6-1

PROFINET IE

172.16.46.11

CtU315-2 tN/Dt ask:

.0

Note The installation guidelines for the SIMATIC components have to be observed.

Table 6-1

No. Action Remark

1. Connect • the CPU315-2 PN/DP • the Servers • the Engineering station over an Ethernet cable with the Scalance X. switch

2. Connect the individual components to a power

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 36

Page 37: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

6 Installation and Commissioning 6.2 Installation of the software

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No. Action Remark supply corresponding to the device's technical data.

NOTE This installation realizes no separating of the networks.

6.2 Installation of the software

This chapter describes the steps for the installation of the sample code.

Table 6-2

No. Action Remark

1. Follow the instructions in chapter 5.2 to install SIMATIC NET, STEP 7 and WinCC.

2. Follow the instructions in chapter 5.3 to install Network Load Balancing.

3. Download the STEP 7 sample application to your engineering station.

You can download the STEP 7 project from

http://support.automation.siemens.com/WW/view/en/99923489

6.3 Commissioning

Table 6-3

No.

Action

1. Set the network load balancing on the server PCs as described in chapter 5.3. 2. Unzip the STEP 7 project on your engineering station and open it with the TIA Portal. 3. Download the configuration as described in chapter 5.5 to

• the S7 CPU. • the server stations. • the engineering station.

4. Start WinCC Runtime. The WinCC OPC UA client tries to connect with the OPC server. The encrypted connection will not show any values, the not encrypted connection will show the value of the monitored tag.

5. Now stop WinCC Runtime again. 6. Change to one of the redundant OPC servers and open the OPC communication settings under

"Start > All Programs > Siemens Automation > SIMATIC > SIMATIC NET > Communication Settings".

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 37

Page 38: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

6 Installation and Commissioning 6.3 Commissioning

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

No.

Action

7. Open "SIMATIC NET configuration > OPC settings > OPC UA certificates". Right-click on the "WinCC_RT_Advanced@xxxx" certificate and accept communication.

8. Open the following folder path on the PC with WinCC Runtime:

C:\ProgramData\Siemens\CoRtHmiRTm\OPC\PKI\CA\default This path includes the following folders for the certificates of the OPC UA client:

Open the "rejected" folder. Cut the available certificate and paste it to the "certs" folder.

9. Now restart WinCC Runtime. The connection between the OPC UA server and OPC UA client is now established and you can read out and write the added items via the input/output field(s).

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 38

Page 39: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

7 Operation of the Application

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

7 Operation of the Application Scenario: Failure of the active OPC UA server

Table 7-1

No. Action

1. Commission the application as described in chapter 6. 2. Start WinCC Runtime and change to the application.

The screen should look as follows:

3. Remove the Ethernet cable from the active server.

Result: The visualized clock memory stops. 4. After successful switching, the "counting" of the clock memory is visible again.

A short time later, the displayed active server switches, too.

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 39

Page 40: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

8 S7-Redconnect

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

8 S7-Redconnect This application is concerned with the redundancy between OPC Client and OPC Server over two redundant OPC Servers. For the connection of an OPC Server with a redundant PLC, e.g. a S7-400 H-system, the option “S7-Redconnect” is necessary (see also \8\). Figure 8-1 example for the realizing of an redundancy with S7-Redconnect

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 40

Page 41: Application Description 10/2014 IE S7 OPC … WinCC connection allows a quick overview of the application's functionalities. It is shown • whether access to the S7 CPU is currently

9 References

S

iem

ens

AG 2

014

All r

ight

s re

serv

ed

9 References Table 9-1

Subject Title

\1\ Siemens Industry Online Support

http://support.automation.siemens.com

\2\ Download page of the entry

http://support.automation.siemens.com/WW/view/en/99923489

\3\ PC software Industrial communication with PG/PC Volume 2 - Interfaces

http://support.automation.siemens.com/WW/view/en/77378184

\4\ Overview of Network Load Balancing

http://technet.microsoft.com/en-us/library/cc725691.aspx

\5\ STEP 7 Professional V13

http://support.automation.siemens.com/WW/view/en/89515142

\6\ WinCC Advanced V13

http://support.automation.siemens.com/WW/view/en/91479053

\7\ SIMATIC NET PC software SIMATIC NET PC Software V12 Installation Manual

http://support.automation.siemens.com/WW/view/en/77377602

\8\ PC software Industrial Communication with PG/PC Volume 1 - Basics

http://support.automation.siemens.com/WW/view/en/77376110

10 History Table 10-1

Version Date Modifications

V1.0 10/2014 First version

S7 OPC UA Redundancy Entry ID: 99923489, V1.0, 10/2014 41