ReferenceDriverOPC UAWrite Task

OPC UA Write Task

Learn how to send commands to OPC UA servers with Synnax.

For task lifecycle management, see the Task Basics page.

How Commands Work

OPC UA write tasks use command channels to send values to the server:

  • Command channels: Write values here to send commands to the OPC UA server
  • Command time channels (_cmd_time): Index channels storing command timestamps

OPC UA write tasks do not create separate state channels. To read back the current state, configure a read task for the same node.

Task Configuration Reference

ParameterTypeRequiredDefaultDescription
namestringYes-Human-readable task name
devicestringYes-Key of the OPC UA server device
auto_startbooleanNofalseAutomatically start task after configuration
channelsarrayYes-List of output channel configurations

Channel Configuration Reference

OPC UA Write Service Specification

Scalar Values

Writes scalar values to an OPC UA node. Suitable for control setpoints, configuration parameters, and single-value commands.

ParameterTypeRequiredDefaultDescription
channelnumberYes-Synnax command channel key
node_idstringYes-OPC UA NodeId (e.g., ns=2;s=Setpoint)
enabledbooleanNotrueEnable or disable writing to this node

NodeId Format Examples:

  • Numeric: ns=2;i=1000
  • String: ns=2;s=ControlSetpoint
  • GUID: ns=2;g=12345678-1234-1234-1234-123456789012
  • Opaque: ns=2;b=aGVsbG8=

Note: Configuring a write task creates only command channels (_cmd and _cmd_time). If you need state feedback, configure a corresponding read task to monitor the same nodes.

Array Values

Writes array data to an OPC UA node in bulk. Used for batch control commands or multi-value setpoints.

ParameterTypeRequiredDefaultDescription
channelnumberYes-Synnax command channel key
node_idstringYes-OPC UA NodeId pointing to an array variable
enabledbooleanNotrueEnable or disable writing to this node

Note: The channel data type must match the array element type on the server.

Important Rules

  • Direct write: Commands are written directly to the OPC UA server without state feedback channels.
  • One running task per node: A node can only be controlled by one write task at a time.
  • Node permissions: The OPC UA server must allow write access to the specified nodes.
  • Data type matching: Ensure Synnax channel data types match the OPC UA node data types.

How-To

Console

Python

TypeScript