Protocol simulator

OPC UA Simulator

Give your OPC UA client a virtual server to connect to. Browse nodes, subscribe to live values and test writable controls without physical equipment.

Start in three steps

Subscribe to a virtual workcell’s state and progress, then observe repeated production cycles in your OPC UA client.

Before you start: Install SPX with the OPC UA package and SPX UI. Have UaExpert or another OPC UA client ready. This guide uses the library’s production workcell model.

1. Create a virtual workcell

Open Instances → New instance. Select Process.Workcell.OpcUa, or your imported registry name. Use an unused name, such as demo_opcua_workcell; keep the default endpoint. Choose Create, then Start instance. Confirm RUNNING and open Communication → opcua_server.

Model not listed?

Download the library YAML linked above. In Models → Load model from file, import it under a registry name of your choice. Select that name in New instance. The dotted name in our screenshots is a registry label, not the YAML filename.

Paused SPX workcell with opcua_server enabled, endpoint on port 4841 at /spx/workcell, and the configured namespace URI.
The adapter listens on 0.0.0.0:4841. Your client needs the reachable host address and published port. Open full size

2. Connect and start a cycle

Replace SPX_HOST below with the host address reachable from your client. For Docker, publish port 4841; if your host port differs, use it in the endpoint URL.

For this local demo, connect with Anonymous / NoSecurity. Subscribe to Objects → Workcell → State and Objects → Workcell → Cycle → Progress. Use the communication reference for browse paths and data types. In SPX Attributes, set target_cycle_time_s to 10 for this exercise (the default is 22). Select cycle_progress_percent and a 100 ms chart rate. Then, in Scenarios, click Start auto_cycle scenario. Let the 30-second scenario finish.

SPX Scenarios tab after the timed auto_cycle run has finished, with three completed progress ramps in the paused chart.
The 30-second auto_cycle run produces three cycles with a 10-second target. This paused history was captured after the scenario finished. Open full size

3. Verify live updates

Success: State changes from idle to running, and Progress repeatedly rises and resets. After the timed scenario, State returns to idle. Keep the subscription open for the full run to observe each rise and reset.

Inspect cycle_progress_percent on a shared % axis. Pause after the run and choose ALL to see the full cycle history.

Paused SPX workcell Attributes view with target_cycle_time_s 10, machine_state idle and three completed cycle-progress ramps.
Shared % axis covering 0–100; time in seconds, sampled every 100 ms. Three rising-and-resetting ramps show repeated workcell cycles. Open full size

Restore target_cycle_time_s to 22 when finished, then choose Stop instance.

Protocol communication

Use these settings and messages with the library’s production workcell model.

Client endpoint
opc.tcp://SPX_HOST:4841/spx/workcell
Namespace URI
urn:spx:examples:opcua:workcell
Local demo session
Anonymous; NoSecurity; browse under Objects

Replace host placeholders with reachable addresses and use your published ports.

Swipe the table to see requests and replies.

Addresses, requests and expected replies
Address / messageOperation / payloadExpected reply
Workcell / StateRead/subscribe; String; read-onlyidle initially; running during auto_cycle; idle after it finishes
Workcell / Cycle / ProgressRead/subscribe; Double; read-onlyProgress in %, rising and resetting during operation
Workcell / ModeRead/write; String; send manual or autoWrite status Good; read Value back → selected mode
Workcell / Motion / Robot / TargetPositionRead/write; Double; target in degreesWrite status Good; target readback matches the request
Workcell / Motion / Robot / ActualPositionRead/subscribe; Double; read-onlyActual position moves toward TargetPosition

Values describe this model’s nominal setup unless noted. Live measurements change as the simulation runs.

Example request and reply

Subscribe to State and Progress, then start auto_cycle in SPX. After the scenario finishes, set Mode to manual, read it back, then restore auto.

Connect: opc.tcp://SPX_HOST:4841/spx/workcell
Browse Objects → Workcell → Mode
Read Value → String "auto"
Write Value: String "manual" → Good
Read Value → String "manual"
Restore Value: String "auto" → Good
No reply or an unexpected value?
  • SPX_HOST and its published TCP port must be reachable from your client.
  • Paths are relative to Objects. Resolve namespace indexes and NodeIds by browsing the server; do not copy a numeric ns= index from another session.
  • Write a String to Mode and a Double to TargetPosition. Stop overriding scenarios before a manual write/readback check. NoSecurity is this model’s local-demo configuration.

What you can test next

  • Browse the rest of the workcell’s address space.
  • Write to Workcell → Mode and read the value back.
  • Observe client behavior during other workcell scenarios and alarms.
Using an AI agent?

Give your agent this page and the linked YAML. Resolve the registry name and reachable endpoint from your environment. Browse by namespace URI and node path; discover namespace indexes and NodeIds at runtime. Set target_cycle_time_s=10 for this exercise and restore 22 afterward. Subscribe before starting the 30-second scenario. Report the observed State and Progress updates. The model attributes are machine_state and cycle_progress_percent.

See the OPC UA adapter guide for binding and endpoint settings.