Skip to content

OPC-UA Simulator Guide

About

The OPC-UA simulator is an OPC-UA server which can be configured and modified via a Lua script. The Lua script allows for the creation of and interaction with various different OPC-UA Node types. An option to run a Local Discovery Server within the docker container is also provided.

Running

Download the Docker image

docker pull iotechsys/opc-ua-sim:1.2

Run the Docker image

docker run --rm --name opc-ua-sim -p 49947:49947 iotechsys/opc-ua-sim:1.2

This will not do much as there is no Lua script specified

Run the Docker image with a lua script

docker run --rm --name opc-ua-sim -p 49947:49947 iotechsys/opc-ua-sim:1.2 -l /example-scripts/simulation.lua

This will create various variable nodes that periodically change value.

Server Options

Option Shorthand Arguments Description Example
--discovery-url -d url - Address of the LDS Register the simulator with a Local Discovery Server --discovery-url=opc.tcp://localhost:4840
--certificate -c path - Path to the certificate Server Certificate --certificate=certificate.der
--private-key -p path - Path to the private key Private Key for the Local Discovery Server --private-key=private_key.der
--lua-script -l path - Path to the lua script Lua script to interact with the server and create nodes --lua-script=script.lua
--security-policy -s policy - One of: {None|Basic128Rsa15|Basic256Sha256} The security policy to use for the server. If this argument is not provided, the server will default to security policy: None. If using a policy other than none, --certificate and --private-key must be specified. --security-policy=Basic256Sha256
--security-mode -m policy - One of: {None|Sign|SignEncrypt} The security mode to use for the server. Defaults to None. --security-policy=SignEncrypt

Lua Scripting

To create and use your own Lua script. See Lua Scripting.

There are a number of example scripts provided within the docker container under the directory /example-scripts/. See Lua Scripting Examples.