Access To A Wincc V7.4 Opc Ua Server Using Excel Client
Access To A Wincc V7.4 Opc Ua Server Using Excel Client
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
Siemens AG 2018 All rights reserved
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 Siemens provides products and solutions with industrial security functions that support the
informa- secure operation of plants, systems, machines and networks.
tion 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
Warranty and Liability ................................................................................................. 2
1 Introduction ........................................................................................................ 4
1.1 Overview............................................................................................... 4
1.2 Mode of operation and hardware configuration ................................... 5
1.3 Components used ................................................................................ 5
2 Engineering ........................................................................................................ 6
2.1 Installation ............................................................................................ 6
2.2 Integrating the WinCC example project ............................................... 6
2.3 Project setup and functioning ............................................................... 7
2.3.1 The “Home screen” .............................................................................. 7
2.3.2 Process screen: “Heating Tank” ........................................................... 8
2.4 Installing the OPC UA Client Library .................................................. 10
2.5 Customizing the host file .................................................................... 12
2.6 OPC UA Excel client .......................................................................... 13
2.6.1 Description of the user interface ........................................................ 13
2.6.2 Reading and writing of values ............................................................ 16
2.7 Certificate exchange of encrypted communication ............................ 17
3 Appendix .......................................................................................................... 18
3.1 Service and Support ........................................................................... 18
3.2 Links and literature ............................................................................. 19
Siemens AG 2018 All rights reserved
1 Introduction
1.1 Overview
Motivation
A separate OPC UA server is included together with the connectivity pack for
WinCC V7.4 SP1. This server makes it possible to access tag values of SCADA
projects from different systems and programs that also provide this communication
channel.
Task
The requirement is to set up a connection between a WinCC OPC UA server and
the OPC UA Excel client provided. The Excel client can then be expanded or
changed, depending on requirement.
The server and the client are located on separate PC stations.
Applicative implementation
Together with this document you receive instructions that show you how to
establish a connection between WinCC OPC UA server and the Excel client.
The download on the entry page provides you with the Excel client, the Excel OPC
UA library as well as an example project that explains the work steps.
This is how you are guided through the required configurations step by step.
Siemens AG 2018 All rights reserved
Assumed knowledge
Basic knowledge of WinCC V7 is assumed.
Note Basics are explained in the SITRAIN course “SIMATIC WinCC, System Course”.
SIMATIC WinCC, Systemkurs (de)
SIMATIC WinCC, System Course (en)
Communication channel
The OPC UA Client Library internally uses the C# class “UAClientHelperAPI”. This
class summarizes the basic functions of the .NET stack of the OPC Foundation.
Siemens AG 2018 All rights reserved
The OPC UA Excel client communicates with the OPC UA server of a WinCC V7.4
SP1.
The WinCC OPC UA server is integrated in V7.4 and active when the Connectivity
Pack option package was installed for WinCC and a valid license is on the system.
Client and server are connected via Ethernet and communicate through OPC UA
via TCP/IP.
Note The OPC UA client library is not suitable for performance-oriented applications
such as the real-time exchange of large data volumes.
Table 1-1
Components Number Article number
WinCC V7.4 SP1 Update 2 1 6AV63.1-....7-4...
WinCC V7.4 SP1 Update 2 1 6AV6371-1HR07-4AX0
Connectivity Pack
Microsoft Office 2010 1
OPC UA .NET Stack 4.6.1 1
2 Engineering
2.1 Installation
Microsoft Office Installation
A licensed Excel version has to be installed on the computer on which the client is
to be run. Office version 2010 is used in this application example.
Figure 2-1
Result:
You have now successfully opened the project on your computer and you can start
Runtime.
Siemens AG 2018 All rights reserved
Description
The “Home screen” is the start screen of the example project. The control elements
and displays have the functions described below.
Control elements
Table 2-1
No. Designation Description
1 Date/time This output field gives information about the current time,
including date and time in English format.
2 Back button Using the back button you get back from a subordinate to a
higher level screen.
3 Home button Using the home button you get back to the “Home screen”.
4 Plant overview In the plant overview the user interface is arranged in a way
that you can go to the different plant screens.
5 Finish button Runtime can be properly finished by using the finish button.
6 Process screen When calling a process screen the graphic displayed here can
window be exchanged with the process screen selected.
Figure 2-2
2
3
4 6
Control elements
Table 2-2
No. Designation Function
1 Filling Starts the filling process and fills the boiler up to maximum
carrying capacity.
2 Emptying Starts the draining process. The boiler is fully drained.
3 Heating The content of the boiler is heated to a maximum of 100 degrees
Celsius.
4 Stop All processes are currently ended. After repeated actuation of the
appropriate button, the processes can be restarted.
Note Each button resets the current processing step and starts the new one. Only one
of the three processes can be active at the same time.
Actuators
Table 2-3
No. Designation Description
5 Supply valve The supply valve (top left) is used to visualize the filling process
for the user. It is highlighted in green during the filling process.
6 Drain valve The drain valve (bottom right) is used to visualize the draining
process for the user. It is highlighted in green during the draining
process.
7 Flow heater The flow heater (within the tank) is used to visualize the heating
process for the user. It is highlighted in green during the draining
process.
Process values
There are two relevant process values in this example. The filling level “Level” and
the temperature “Temp”. Both are realized as internal tags and can, after being set
up, be monitored and changed via the OPC UA Excel client.
For the visualization of the “Level” process level a bar chart (10) was inserted in the
Siemens AG 2018 All rights reserved
boiler. An I/O field (9) on the right specifies the filling level in numeric form
(percentage).
The current temperature value “Temp” is output in an I/O field (8) that is located
next to a symbolically placed measuring device on the top right corner of the boiler.
Figure 2-3
8
5
10
7
9 6
1 2
3 4
Figure 2-4
Siemens AG 2018 All rights reserved
Note Make sure that the commands /tlb and /codebase are separated from the path
entry and from each other and are preceded by a slash.
For easier path entry, use the browse function of the command application that is
executed with the tab button. This is how you can check the correctness of the
paths.
Figure 2-5
Result:
You have now successfully registered the library for the OPC UA client on the
computer and you can use it.
Siemens AG 2018 All rights reserved
Note For further information on the operation of WinCC in Windows networks, please
refer to the following entry:
https://support.industry.siemens.com/cs/en/en/view/868014
Figure 2-6
Siemens AG 2018 All rights reserved
Result:
Now you have introduced the client to the server. You can call the endpoints via
the OPC UA Excel client.
Note This example creates an OPC UA client certificate for the current user with the
common name (CN) CN = UA Client 1500
If you want to change this setting, you need to adjust it in the .NET SourceCode.
The user interface of the “OPC UA Excel Client” example client is divided in three
Siemens AG 2018 All rights reserved
“Connect”
The following figure shows the “Connect” interface:
Figure 2-7
1 2
The following table describes the interface functions of the previous figure:
Table 2-4
No. Description
1. Text field to enter an OPC UA server URL.
2. Button to search OPC UA endpoints with the URL (1).
3. List of the OPC UA endpoints found.
4. Settings for user authentication.
5. Establishing a connection to a selected endpoint of the list (3) and disconnection.
“ReadWrite”
The following figure shows the “Read/Write” interface:
Figure 2-8
1 2 3
4 5 6
Siemens AG 2018 All rights reserved
7 8 9 10
11
12
13 14
The following table describes the interface functions of the previous figure:
Table 2-5
No. Description
1. Button to read an entered node ID from (2).
2. Text field to enter a node ID to be read.
3. Output of the value of the read node ID from (2).
4. Button to write an entered node ID from (5).
5. Text field to enter a node ID to be written.
6. Text field to enter the value of the node ID to be written from (5).
7. Button to register an entered node ID from (9).
8. Button to cancel a registration of an entered node ID from (9).
9. Text field to enter a node ID to be registered.
10. Text field to output a registered node ID.
11. Button to read a registered node ID.
No. Description
12. Output of the value of the read, registered node ID from text field.
13. Button to write a registered node ID.
14. Text field to enter the value of the registered node ID to be written.
"Subscribe"
The following figure shows the “Subscribe” interface:
Figure 2-9
1 2
4
Siemens AG 2018 All rights reserved
The following table describes the interface functions of the previous figure:
Table 2-6
No. Description
1. Button to start a subscription on an OPC UA server and to create a
MonitoredItem via the node ID from text field (3).
2. Button to end a subscription and to delete the MonitoredItem.
3. Text field to enter a node ID that is added to the subscription as MonitoredItem.
4. Text field to output the value of the MonitoredItem of the subscription with time
stamp and status.
To be able to read/write tags from WinCC using the Excel client, you will find a brief
step-by-step instruction in this section. It is important that Runtime remains active.
1. Enter the IP address and the port of the server behind the access command
“opc:tcp://” in the “OPC Server” field.
Example: “opc:tcp://172.16.42.13:4862”
Note The port with the number “4862” is used as default port for the WinCC UA
server, it can be adjusted in the XML file using the note mentioned here.
Note For the first connection establishment the unencrypted transmission (none)
should be selected, since the encrypted connection only works after certificate
exchange that is still to follow.
Siemens AG 2018 All rights reserved
If your operating system does not permit unencrypted connections, this endpoint
cannot be shown. First of all, continue with chapter “2.7 Certificate exchange” in
order to configure a data exchange via a certified connection.
Note In WinCC, the node ID parameters for the UA server are automatically assigned
for the tags. The NamespaceIndex is 1, the IdentifierType is a string and the
Identifier is made up of “t|” + “tag name”.
Example: For the process value prompt level: ns=1; s=t|Level
6. You can carry out the different actions, after entering the Node ID and
confirming the appropriate buttons.
Result
You have successfully managed to read out and change values of WinCC Runtime
via the Excel client.
Note After the first connection attempt the certificate is created on server via an
encrypted endpoint of the client and is stored in the rejected\cert folder.
8. Cut out the certificate with the name “UA Client 1500[…]”.
9. Add the certificate in the folder in which WinCC stores the trustworthy
certificates. They are located in the path “C:\Program Files
(x86)\Siemens\WinCC\opc\UAServer\PKI\CA\certs”
Note The manual exchange of certificates guarantees that only trustworthy clients can
exchange data with the server.
Result:
You have successfully performed the certificate transfer and you can now access
the WinCC server from the encrypted connections of the Excel client.
3 Appendix
3.1 Service and Support
Industry Online Support
Do you have any questions or need support?
Siemens Industry Online Support offers access to our entire service and support
know-how as well as to our services.
Siemens Industry Online Support is the central address for information on our
products, solutions and services.
Product information, manuals, downloads, FAQs and application examples – all
information is accessible with just a few mouse clicks at
https://support.industry.siemens.com
Technical Support
Siemens Industry's Technical Support offers quick and competent support
regarding all technical queries with numerous tailor-made offers
– from basic support right up to individual support contracts.
Please address your requests to the Technical Support via the web form:
www.siemens.en/industry/supportrequest
With our globally available training courses for our products and solutions and
using innovative teaching methods, we help you achieve your goals.
More information on the training courses offered as well as on locations and dates
is available at:
www.siemens.en/sitrain
Note Basics are explained in the SITRAIN course “SIMATIC WinCC, System Course”.
SIMATIC WinCC, Systemkurs (de)
SIMATIC WinCC, System Course (en)
Topics on communication and OPC using WinCC V7 as well as many other
topics are explained in the course “SIMATIC WinCC, advanced course”.
SIMATIC WinCC, Aufbaukurs (de)
SIMATIC WinCC, advanced course (en)
Service offer
Our service offer comprises, among other things, the following services:
Product Training
Plant Data Services
Spare Parts Services
Repair Services
On Site and Maintenance Services
Retrofit and Modernization Services
Service Programs and Agreements
3.2
Links and literature
Table 3-1
No. Topic
\1\ Siemens Industry Online Support
https://support.industry.siemens.com
\2\ Link to the entry page of the application example
https://support.industry.siemens.com/cs/ww/en/view/109752976
\3\ Compatibility tool
https://www.siemens.en/compatool
\4\ SIMATIC WinCC, Systemkurs
https://www.sitrain-
Siemens AG 2018 All rights reserved
learning.siemens.com/DE/de/product/chapter/QAJ857V/course/4102607/description
.do?hash=70ed32afecd3c67038578705e4f37c1c
\5\ OPC UA .NET Client for the SIMATIC S7-1500 OPC UA Server
https://support.industry.siemens.com/cs/ww/en/view/109737901
\6\ SIMATIC WinCC, System Course
https://www.sitrain-
learning.siemens.com/DE/en/product/chapter/QAJ857V/course/4102608/description
.do?hash=edfd73c2d6d9671c5c03b013f7fde363
\7\ SIMATIC WinCC, Aufbaukurs
https://www.sitrain-
learning.siemens.com/DE/de/product/chapter/QAJ857V/course/4102612/description
.do?hash=9e224570ae6603baa50da8cbb5b1a9ab
\8\ SIMATIC WinCC, advanced course
https://www.sitrain-
learning.siemens.com/DE/en/product/chapter/QAJ857V/course/4102613/description
.do?hash=03ddf8bfcd25d620b76bfb1b7069ca5f
\9\ System manual: WinCC V7.4 SP1: General information and installation
https://support.industry.siemens.com/cs/ww/en/view/109746335
\10\ System manual:
WinCC V7.4 SP1: Communication
https://support.industry.siemens.com/cs/ww/en/view/109746339