ReferenceDriverOPC UARead Task

OPC UA read task

Learn how to acquire data from OPC UA servers with Synnax.

This task follows the standard task lifecycle.

Task configuration reference

Table

Parameter Type Required Default Description
device string Yes - Key of the OPC UA server device
sample_rate number No 50 Samples per second (Hz)
stream_rate number No 25 Rate data is streamed to Synnax (Hz), must be ≤ sample_rate. Used when array_mode=false
array_mode boolean No false Enable array sampling mode for high-rate tasks
array_size number No 1 Number of samples to read in bulk. Required when array_mode=true
channels array Yes - List of input channel configurations

Channel configuration reference

OPC UA Read Service Specification

Standard Mode (array_mode=false)

Reads scalar values from an OPC UA node at the specified sample rate. Suitable for most applications with standard data rates.

Table

Parameter Type Required Default Description
channel number Yes - Synnax channel key
node_id string Yes - OPC UA NodeId (e.g., ns=2;s=MyVariable)

NodeId Format Examples:

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

Array Mode (array_mode=true)

Reads array data from an OPC UA node in bulk. Designed for high-frequency data (>500 Hz) where the server writes samples into arrays.

When array_mode=true, the task reads multiple samples in bulk from the OPC UA server. This is more efficient for high-rate tasks but requires careful configuration to avoid undersampling or oversampling.

Table

Parameter Type Required Default Description
channel number Yes - Synnax channel key
node_id string Yes - OPC UA NodeId pointing to an array variable

Array Sampling Guidelines:

  • Set sample_rate to match the OPC UA server’s sample rate
  • Set array_size to an integer factor of the sample rate
  • Oversampling occurs when the server doesn’t fully replace array values between reads
  • Undersampling occurs when the server writes faster than Synnax reads

Server Timestamp Read

Reads timestamps directly from the OPC UA server for high-precision timing instead of using Synnax-generated timestamps.

Table

Parameter Type Required Default Description
channel number Yes - Synnax index channel key (must be TIMESTAMP data type)
node_id string Yes - OPC UA NodeId containing server timestamps

If timestamp channels are not added to the task, Synnax automatically generates timestamps with ~100 µs precision using software timing.

Important rules

  • Software timing -> Samples are timestamped in software with ~100 µs precision, which degrades under heavy load.
  • Array mode -> Use array mode only above 500 Hz. It needs tuning to avoid under- or oversampling.
  • Stream rate -> For sample rates under 50 Hz, set the stream rate equal to the sample rate. Above that, keep the stream rate under 50 Hz.

How-to