In this repository you will find an example of OPC UA Server simulation where Node-RED act as OPC UA Server. Required nodes:
- OPC UA Server: https://flows.nodered.org/node/node-red-contrib-opcua-server
- Counter https://flows.nodered.org/node/node-red-contrib-counter
This respository is part of OPC UA Course published at ✅ https://codeandcompile.com/course/learn-opc-ua-with-node-red
- Simulating OPC UA Server using flow variables Testing 3rd party OPC
- UA client for read and write operations Creating a layer of OPC UA
- over non OPC UA devices like Arduino, relay based PLC etc.
- Read the controller (PLC or Arduino) using Serial or MODBUS TCP/IP communication.
- Store the information in the flow variables by replacing the timestamp (test values).
- That's it, your device is ready to be accessed via OPC UA client
OPC UA variables are defined in the following node. Open this node and check the Address space
to see the variable declaration
In this example, inject nodes with regular interval are used to inject random values to the flow variables which are used in the OPC UA input variable declaration.
In this example, random math function is used to write random values to the flow variables which are used in the OPC UA output variable declaration.
graph LR
A[Random values] --Write--> B[Node-RED flow variables] --Write Input variables--> C[OPC UA Server]
B --Write Output variables--> C
graph LR
A[Arduino I/Os] --Reads via Serial--> B[Node-RED flow variables] --Write to variables--> C[OPC UA Server]
graph LR
A[PLC I/Os] --Reads via MODBUS--> B[Node-RED flow variables] --Write to variables--> C[OPC UA Server]