Glossary · PubSub

WriterGroup

In OPC UA PubSub, a WriterGroup batches DataSetWriters into a single NetworkMessage and owns the timing: PublishingInterval, KeepAliveTime, priority, encoding and security group. It sits under a PubSubConnection, stamps a WriterGroupId into every message it sends, and is the level at which you enable, disable and secure publishing.

The publisher hierarchy in one line

PubSubConnection holds the transport and the PublisherId; a WriterGroup under it holds the timing and the encoding; DataSetWriters under the group each publish one PublishedDataSet. The subscriber side mirrors it exactly: PubSubConnection, then ReaderGroup, then DataSetReader with a SubscribedDataSet. Enable and disable cascade downward, so disabling a connection stops every group beneath it.

Publishing here is nothing like a subscription

The group PublishingInterval is a hard cyclic timer on the publisher. Nothing is requested, nothing is acknowledged and nothing is retransmitted, which is the opposite of a client-server Subscription where the server can only send in response to a queued Publish request. There is no back-pressure and no lifetime count: if no subscriber exists, the publisher keeps transmitting at full rate. KeepAliveTime governs keep-alive messages when a cycle produces no data change.

Batching, size limits and ordering

MaxNetworkMessageSize caps one NetworkMessage; if the enabled writers produce more than that, the group splits the payload across messages. NetworkMessageContentMask decides which optional headers appear, and DataSetOrdering states whether DataSetMessages arrive in a defined order. Batching several writers into one message cuts per-frame overhead considerably, at the cost of tying all of them to the same cadence.

Security and quality of service sit at group level

SecurityMode and SecurityGroupId are group properties, so the group is the unit of key distribution from a Security Key Service. On the datagram-v2 connection transport the group also exposes the QoS hooks that matter for TSN: QosCategory, which maps to the IPv4 or IPv6 DSCP bits, plus MessageRepeatCount and MessageRepeatDelay, where receivers deduplicate repeats on the sequence number rather than seeing them twice.

Example

The full publisher tree, showing which level owns which decision

PubSubConnection "Cell3"          opc.udp://239.0.0.1:4840   PublisherId 17 (UInt16)
  WriterGroup "Fast"              WriterGroupId 1
      PublishingInterval  100 ms                 <- timing lives here
      KeepAliveTime       1000 ms
      SecurityMode        SignAndEncrypt         <- keys live here
      SecurityGroupId     "sg-cell3"
      MaxNetworkMessageSize 1400                 <- keep under path MTU
    DataSetWriter "Press"     DataSetWriterId 1  <- content lives here
    DataSetWriter "Counters"  DataSetWriterId 2
The mistake people make: Leaving MaxNetworkMessageSize at a default above the path MTU. UDP will fragment, and a single lost fragment discards the whole NetworkMessage, so you lose every writer in the group at once. Keep the group under roughly 1400 bytes on a standard Ethernet path, or split the writers across groups.

Defined in: Part 14 - PubSub, WriterGroup and connection transport data types.

Status codes you will meet

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