Code-and-Compile / OPC-UA-Server-Simulation

OPC UA Server simulation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OPC UA Server Simulation

About repository

In this repository you will find an example of OPC UA Server simulation where Node-RED act as OPC UA Server. Required node: https://flows.nodered.org/node/node-red-contrib-opcua-server

This respository is part of OPC UA Course published at ✅ https://codeandcompile.com/course/learn-opc-ua-with-node-red

What you can do with this repository?

  • 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.

How to use this repository with PLC or Arudino?

  • 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

Understanding flow:

OPC UA variable declaration

OPC UA variables are defined in the following node. Open this node and check the Address space to see the variable declaration

image

Write to OPC UA Input variables

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.

image

Write to OPC UA Output variables

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.

image

Data flow Case 1: Using random values

graph LR
A[Random values] --Write--> B[Node-RED flow variables] --Write Input variables--> C[OPC UA Server] 
B --Write Output variables--> C

Data flow Case 2: Using Arduino values

Read data

graph LR
A[Arduino I/Os] --Reads via Serial--> B[Node-RED flow variables] --Write to variables--> C[OPC UA Server] 

Data flow Case 3: Using PLC values

Read data

graph LR
A[PLC I/Os] --Reads via MODBUS--> B[Node-RED flow variables] --Write to variables--> C[OPC UA Server] 

Reading OPC UA variables using UaExpert

image

About

OPC UA Server simulation