Glossary · PubSub

DataSetReader

In OPC UA PubSub, a DataSetReader is the subscriber-side counterpart of a DataSetWriter. It filters arriving NetworkMessages by PublisherId, WriterGroupId and DataSetWriterId, decodes the matching DataSetMessages against a configured DataSetMetaData, and writes the decoded fields into the address space through a SubscribedDataSet.

Filtering is by identifier, and it is exact

The reader accepts a message only if the PublisherId, WriterGroupId and DataSetWriterId all match its configuration. PublisherId is the one that catches people out, because it is a union that can be a Byte, UInt16, UInt32, UInt64, String or Guid: a publisher sending UInt16 17 and a reader configured for String 17 never match, and neither side reports anything. Leaving a filter unset generally means accept any, which is useful for bring-up and wrong for production.

You supply the schema, or you discover it

The reader needs a DataSetMetaData that matches the publisher's field list in order and type. Either you configure it locally, usually by exporting it from the publisher, or you let the reader pick up DataSetMetaData messages, which on MQTT arrive on a separate metadata topic at their own rate. The ConfigurationVersion is compared: a major-version difference means the layout has changed and the reader should stop decoding rather than guess.

Two ways to land the data

TargetVariables maps each field index onto an existing NodeId and attribute in your address space, which is what you want when the subscriber is a controller or a server with an existing model. SubscribedDataSetMirror instead creates a mirror of the dataset as new nodes under a folder, which is what you want for a gateway or a dashboard that has no model of its own and just needs the values to appear.

MessageReceiveTimeout is your only liveness signal

Because there is no session, nothing tells you the publisher has stopped. MessageReceiveTimeout on the reader declares the data stale when no message arrives within the window; set it to a small multiple of the publisher's PublishingInterval plus KeepAliveTime. Without it, a stopped publisher leaves the last values sitting in the address space with Good status forever, which is the classic PubSub silent failure.

Example

A reader that matches the publisher in the WriterGroup example, and the one field that usually breaks it

PubSubConnection  opc.udp://239.0.0.1:4840
  ReaderGroup "Cell3"
    DataSetReader "Press"
       PublisherId            17  as UInt16      # data type must match, not just the value
       WriterGroupId          1
       DataSetWriterId        1
       DataSetMetaData        Force:Double, Position:Double, CycleCount:UInt32
       MessageReceiveTimeout  500 ms             # 100 ms interval -> flag stale fast
       SubscribedDataSet      TargetVariables -> ns=2;s=Cell3.Press.*
The mistake people make: Debugging a silent reader from the subscriber configuration alone. PubSub returns no error to anyone, so prove the frames arrive first - a capture with the Wireshark OPC UA dissector for UDP or Ethernet, MQTT Explorer for a broker - then compare PublisherId including its data type, then the ids, and only then the metadata.

Defined in: Part 14 - PubSub, DataSetReader and SubscribedDataSet.

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login