OPC UA Configuration Example: Difference between revisions
mNo edit summary |
mNo edit summary |
||
Line 33: | Line 33: | ||
# In the OPC UA Servers block, insert the name of the server | # In the OPC UA Servers block, insert the name of the server | ||
# Click Add to create new instance[[File:OPC UA Configuration example adding server v1.png|border|class=tlt-border|1067x1067px]] | # Click Add to create new instance | ||
[[File:OPC UA Configuration example adding server v1.png|border|class=tlt-border|1067x1067px]] | |||
#Toggle Enable option to on | #Toggle Enable option to on | ||
#Insert the URL of the OPC UA Server | #Insert the URL of the OPC UA Server | ||
#Add new server node[[File:OPC UA Configuration example adding server node v1.png|border|class=tlt-border|1067x1067px]] | #Add new server node | ||
[[File:OPC UA Configuration example adding server node v1.png|border|class=tlt-border|1067x1067px]] | |||
#Enter the ID Namespace of the node | #Enter the ID Namespace of the node | ||
#Select ID type as String | #Select ID type as String | ||
#Enter ID of the node | #Enter ID of the node | ||
#Save & Apply settings[[File:OPC UA Configuration example configuring server node v1.png|border|class=tlt-border|1060x1060px]] | #Save & Apply settings | ||
[[File:OPC UA Configuration example configuring server node v1.png|border|class=tlt-border|1060x1060px]] | |||
#Optionally, add another node analogously | #Optionally, add another node analogously | ||
Line 50: | Line 53: | ||
#Insert the name of the Value Group | #Insert the name of the Value Group | ||
#Press Add to add new value group[[File:OPC UA Configuration example adding value group v1.png|border|class=tlt-border|1056x1056px]] | #Press Add to add new value group | ||
#Enable the group and leave the rest of the settings as default[[File:OPC UA Configuration example configuring value group v1.png|border|class=tlt-border|901x901px]] | [[File:OPC UA Configuration example adding value group v1.png|border|class=tlt-border|1056x1056px]] | ||
#Inside the OPC UA Group Values, add new instance with your preferred name[[File:OPC UA Configuration example adding value v1.png|border|class=tlt-border|1053x1053px]] | #Enable the group and leave the rest of the settings as default | ||
[[File:OPC UA Configuration example configuring value group v1.png|border|class=tlt-border|901x901px]] | |||
#Inside the OPC UA Group Values, add new instance with your preferred name | |||
[[File:OPC UA Configuration example adding value v1.png|border|class=tlt-border|1053x1053px]] | |||
#Enable the instance | #Enable the instance | ||
#Assign a server node from which the data will be retrieved | #Assign a server node from which the data will be retrieved | ||
#Save and apply settings[[File:OPC UA Configuration example configuring value v1.png|border|class=tlt-border|1049x1049px]] | #Save and apply settings | ||
[[File:OPC UA Configuration example configuring value v1.png|border|class=tlt-border|1049x1049px]] | |||
#Optionally configure the second value | #Optionally configure the second value | ||
[[File:OPC UA Configuration example configuring value second v1.png|border|class=tlt-border|1091x1091px]] | [[File:OPC UA Configuration example configuring value second v1.png|border|class=tlt-border|1091x1091px]] | ||
Line 68: | Line 75: | ||
The output should show requested data like so: | The output should show requested data like so: | ||
[[File:OPC UA Configuration example test response v1.png|border|class=tlt-border|670x670px]] | [[File:OPC UA Configuration example test response v1.png|border|class=tlt-border|670x670px]] |
Revision as of 12:06, 7 February 2023
Main Page > General Information > Configuration Examples > Router control and monitoring > OPC UA Configuration ExampleThe information in this page is updated in accordance with 00.07.03.3 firmware version. .
Introduction
OPC UA (OPC Unified Architecture) is an industrial communication protocol for secure and reliable transfer of real-time data and events between devices and applications in industrial automation and the Internet of Things (IoT).
This article will contain an example on how you can configure a Teltonika-Networks device as an OPC UA Client, that will gather and forward data from an UPC UA Server.
Note: OPC UA is additional software that can be installed from the Services → Package Manager page.
Configuration overview and prerequisites
For this example we will need:
- RUT or TRB series device (RUTX11 will be used in this example)
- OPC UA server
Note: If you're having trouble finding any page or some of the parameters described here on your device's WebUI, you should turn on "Advanced WebUI" mode. You can do that by clicking the "Basic" button under "Mode," which is located at the top-right corner of the WebUI.
A visual GIF on how to change from Basic to Advanced:
Configuration
Note: In this example, we will use a OPC UA C++ demo server, which has some predefined values simulated for us to request.
Required configurations are done inside Services → OPC UA
Defining Server and Nodes
- In the OPC UA Servers block, insert the name of the server
- Click Add to create new instance
- Toggle Enable option to on
- Insert the URL of the OPC UA Server
- Add new server node
- Enter the ID Namespace of the node
- Select ID type as String
- Enter ID of the node
- Save & Apply settings
- Optionally, add another node analogously
Defining Value Groups and Values
- Insert the name of the Value Group
- Press Add to add new value group
- Enable the group and leave the rest of the settings as default
- Inside the OPC UA Group Values, add new instance with your preferred name
- Enable the instance
- Assign a server node from which the data will be retrieved
- Save and apply settings
- Optionally configure the second value
Testing Data Retrieval
Once we have our configuration finished, we can run some integrated tests in order to make sure we are able to retrieve the data from OPC UA server. In order to do so, we can press the "Test" button under OPC UA Value Groups:
The output should show requested data like so:
Sending Data to a Server
Once we made sure we are able to read the values correctly using the test we did before, let us use "Data to server" to send this data to an HTTP server. For testing purposes, we will listen on defined port locally using Hercules software.
In order to do so navigate to Services → Data to Server and create a new data sender:
- Enable the instance
- Select Data source: OPC UA
- Select Protocol: HTTP(S)
- Adjust the JSON format to include the data
- Define HTTP server IP
After saving these settings, we can start listening on "555" port using Hercules and see the data flow: