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

Environment Variables

Option Expected Values Description
RUN_LDS true/false If set to true, a Local Discovery Server will be started on port 4840

Download the Docker image

docker pull iotechsys/opc-ua-sim:1.0 
Run the Docker image
docker run --rm --name opc-ua-sim -p 49947:49947 iotechsys/opc-ua-sim:1.0
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.0 -l /example-scripts/prosys.lua
This will create various variable nodes that periodically change value.

Run the Docker image with a LDS

docker run --rm --name opc-ua-sim -p 49947:49947 p 4840:4840 -e RUN_LDS=true iotechsys/opc-ua-sim:1.0

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

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.

Back to top