OPC UA Client Node-Red V1.0
OPC UA Client Node-Red V1.0
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
Siemens AG 2016 All rights reserved
Security Siemens provides products and solutions with industrial security functions that
informa- support the 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 Task ..................................................................................................................... 4
1.1 Overview............................................................................................... 4
2 Application Example – Subscribe .................................................................... 5
2.1 Install node-red OPC UA node ............................................................. 5
2.2 Start node-red ...................................................................................... 6
2.3 Open node-red Web interface .............................................................. 6
2.4 Configure node-red program ................................................................ 7
3 Application Example – Write .......................................................................... 13
3.1 Configure the node-red program ........................................................ 13
4 Checklist ........................................................................................................... 18
5 Related links ..................................................................................................... 19
6 History............................................................................................................... 19
Siemens AG 2016 All rights reserved
1 Task
1.1 Overview
Introduction
This application example shows how to implement an OPC UA Client via node-red
on the IOT2000. As OPC UA Server a SIMATIC S7-1500 Software Controller V2.0
is used.
Goals
After working through this document you will know how to
Use the node-red OPC UA Client
Subscribing a value
Writing a value
Display the data on the node-red Dashboard
NOTICE Precondition!
Siemens AG 2016 All rights reserved
To use this sample it is required that the Initial Operation in the Document
“Setting up the SIMATIC IOT2000” has been executed once.
Table 2-2
No. Action
1. Type in node /usr/lib/node_modules/node-red/red & to start node-red
Siemens AG 2016 All rights reserved
Table 2-3
No. Action
1. Add the IP-Address of the IOT2000 and the port 1880 to a browser (i.e
http://192.168.200.1:1880)
4. Add a new Endpoint with IP address and port from the OPC UA Server and
click “Add”
No. Action
5. Choose Subscribe as Action, the required interval and give the node an
optional name. Click Done
Siemens AG 2016 All rights reserved
4. Choose String, add the NodeID of the required value to Topic and give the
node an optional name. Click Done
Configure Dashboard
Table 2-6
No. Action
1. Scroll the left bar to dashboard
2. Choose the “gauge” node and add it per Drag&Drop to the middle
3. Double-click on the node
4. Add a new ui_group
Siemens AG 2016 All rights reserved
No. Action
6. Give the ui_group a name
Table 2-7
No. Action
1. Wire the nodes via Drag&Drop
2. Click on Deploy to download the program
3. Inject the NodeID to the OPC UA Client by clicking on the left square of the
inject node
Siemens AG 2016 All rights reserved
Table 3-1
No. Action
1. Add the following nodes and wire them:
a. Dropdown
b. OPC UA Item
c. OPC UA Client
d. OPC UA Client
e. text
2. Configure the Dropdown node. Add a new UI Group and add the options to
write
Siemens AG 2016 All rights reserved
No. Action
3. Configure the OPC UA Item. Add the NodeID of the value to write to Item
and choose its datatype
4. Configure the OPC UA Client to write. Add the IP-Address and the Port of the
OPC UA Server to Endpoint and choose Write as Action
Siemens AG 2016 All rights reserved
5. Configure the OPC UA Client to subscribe. Add the IP-Address and the Port
of the OPC UA Server to Endpoint, choose Subscribe as Action and choose
the required Interval
No. Action
6. Configure the text output-node. Choose the UI Group created in the
Dropdown node and choose a Layout
Siemens AG 2016 All rights reserved
No. Action
9. The variable can be written to the OPC UA Server by choosing a value from
the dropdown menu
Siemens AG 2016 All rights reserved
4 Checklist
This chapter contains a Checklist which summarizes all important steps in this
application example.
Table 4-1
No. Action
1. Install OPC UA node
2. Start node-red
3. Open node-red Web interface
4. Configure node-red program for subscribing
5. Configure node-red program for writing
Siemens AG 2016 All rights reserved
5 Related links
Table 5-1
Topic
\1\ SIMATIC IOT2000 forum
www.siemens.com/iot2000-forum
\2\ SIMATIC IOT2000 Setting Up
https://support.industry.siemens.com/tf/ww/en/posts/155642/
\3\ SIMATIC IOT2000 Getting Started
https://support.industry.siemens.com/tf/ww/en/posts/155643/
6 History
Table 6-1
Version Date Modifications
V1.0 12/2016 First version
Siemens AG 2016 All rights reserved