Warranty and Liability
OPC Client 1500
Entry ID: 109737901, V1.0, 10/2016
2
Siemens AG 2016 All rights reserved
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 safe 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 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 the Siemens AG.
Security
informa-
tion
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 only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.
Table of Contents
OPC Client 1500
Entry ID: 109737901, V1.0, 10/2016
3
Siemens AG 2016 All rights reserved
Table of Contents
Warranty and Liability ................................................................................................. 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Mode of operation ................................................................................ 5
1.3 Components used ................................................................................ 7
2 Engineering ........................................................................................................ 8
2.1 Planning the OPC UA server of the S7-1500 ....................................... 8
2.1.1 Enabling OPC UA Server ..................................................................... 8
2.1.2 Enabling global security settings ........................................................ 10
2.1.3 Configuring OPC UA security policies (server endpoints) ................. 11
2.1.4 Security via certificate management (optional) .................................. 12
2.1.5 Enabling tags for the OPC UA communication .................................. 14
2.2 Programming the OPC UA client example ......................................... 15
2.2.1 OPC UA Client S7-1500 ..................................................................... 15
2.2.2 UAClientHelperAPI ............................................................................. 18
2.2.3 Sequence diagrams of the client example ......................................... 19
2.3 Operation ............................................................................................ 24
2.3.1 Description of the user interface ........................................................ 24
2.3.2 Commissioning OPC UA server of the S7-1500 ................................ 27
2.3.3 Commissioning OPC UA Client S7-1500 ........................................... 28
2.3.4 Creating, exporting and loading client certificate into the S7-
1500 (optional) ................................................................................... 28
2.3.5 Establishing connection to the OPC UA server ................................. 32
2.3.6 Browsing address space of the OPC UA server ................................ 34
2.3.7 Read/write tags .................................................................................. 34
2.3.8 Subscriptions ...................................................................................... 36
3 Valuable Information ....................................................................................... 37
3.1 Basics ................................................................................................. 37
3.1.1 General OPC UA information ............................................................. 37
3.1.2 OPC UA address space ..................................................................... 38
3.1.3 OPC UA Security ................................................................................ 41
3.1.4 OPC UA server of the S7-1500 .......................................................... 43
3.2 TIA Portal project details .................................................................... 44
3.2.1 S7-1500 and OPC UA configuration .................................................. 44
3.2.2 S7 program ......................................................................................... 44
4 Appendix .......................................................................................................... 45
4.1 Siemens services ............................................................................... 45
4.2 Links and Literature ............................................................................ 46
4.3 Change documentation ...................................................................... 46
1 Introduction
OPC Client 1500
Entry ID: 109737901, V1.0, 10/2016
4
Siemens AG 2016 All rights reserved
1 Introduction
1.1 Overview
OPC UA (Open Platform Communications Unified Architecture) is an M2M
communication protocol adopted in 2009 that was specified by the OPC
foundation. The OPC specification has been developed to create an interoperable,
secure and reliable communication protocol. Based on these properties OPC UA
increasingly prevails as standard in the industrial environment.
With the current firmware of SIMATIC S7-1500 an integrated OPC UA Server has
been added to the control system. This enables an additional option of direct
process data exchange of the SIMATIC S7-1500 with a wide variety of other
systems that support OPC UA.
Content of this application example
In order to exchange data with the server of the SIMATIC S7-1500 via OPC UA,
this application example will show you how you can create a simple client in .Net.
Furthermore, the configuration of the OPC UA server of the SIMATIC S7-1500 is
explained step by step.
Figure 1-1
SIMATIC S7-1500Windows PC/PG
OPC UA Client Example OPC UA Server
OPC UA
Advantages of the application example
This application example offers you the following advantages:
Expandable TIA project with preconfigured OPC UA server for a SIMATIC S7-
1500.
A simple and expandable OPC UA client, created in .NET.
A commented C# class that summarizes the OPC UA client basic functions
and guarantees an easy implementation.
1 Introduction
OPC Client 1500
Entry ID: 109737901, V1.0, 10/2016
5
Siemens AG 2016 All rights reserved
Assumed knowledge
The following basic knowledge is required by the user:
Basics of programming in C#/.NET
Basics of configuring in the TIA Portal
Basics of OPC
Basics in software security and certificate handling
1.2 Mode of operation
Below, you will find an explanation of what components, functions and mode of
operations are used in the application example.
General function description
The following figure shows the most important components of this application
example:
Figure 1-2
SIMATIC S7-1500Windows PC/PG
Industrial Ethernet
OPC UA Client Example OPC UA Server
OPC UA
UAClientHelperAPI
OPC UA .NET Stack
A simple OPC UA .NET client for Windows PCs/PGs communicates with the OPC
UA server of a SIMATIC S7-1500.
The client supports the following OPC UA service sets:
Searching and finding server: Discovery Service Set (FindServers,
GetEndpoints)
Creating and ending sessions: Sessions Service Set (CreateSession,
CloseSession)
Navigating in the address space: View Service Set (Browse, RegisterNodes,
UnregisterNodes)
Reading and writing tags and attributes: Attribute Service Set (Read, Write)
Subscribing tags: Subscription Service Set (CreateSubscription,
DeleteSubscribtion); MonitoredItem Service Set (CreateMonitoredItem,
DeleteMonitoredItem)