Node-RED integration
Node-RED is a low-code programming tool for event-driven applications. To integrate data points of the NETx Server we suggest to use the OPC UA server interface.
- 1 Installation
- 2 Configuration
- 3 Example
- 3.1 Node-RED setup
- 3.2 Read
- 3.3 Write
- 3.4 Subscribe
Installation
Follow installation instructions of Node-RED to install the tool.
Follow installation instruction of OPC UA to allow data access by Node-RED.
Configuration
After the installation, restart the Core Studio and activate the driver in Modules > OPCUA > Server configuration:
Restart the NETx Server and monitor the log messages for the OPC UA endpoints:
Example
The attached is a Node-RED flow that contains examples to
actively read a server item
write a server item
subscribe to a server item.
The related server item is always NETx\VAR\Numeric\Item001.
Node-RED setup
In the Node-RED UI, import the flow:
Double-click the read node. In the OpcUa-Client node configuration, click the Edit button of the Endpoint field:
Set the correct endpoint URL and provide credentials of a Web Manager user (default is admin / changeme).
Click the Deploy button on the upper right.
Open the debug console and clear all messages:
Read
Switch to the Core Studio and set the value of server item NETx\VAR\Numeric\Item001 to 123.
Back in Node-RED, click the Test node beneath the active read note: The data point is actively read from the server and its value is logged:
Write
Click any of the nodes beneath the write note and watch the data point in the Core Studio as it assumes the respective values of 100 and 200.
Subscribe
Click the Test node beneath the subscribe note to subscribe to value changes.
Change the value of the server item in the Core Studio and monitor the Node-RED debug console for receiving the respective values: