UaExpert  1.6.2 438
PubSub Config View

This document type is a specialized view for the OPC UA PubSub configuration.

PubSub Model Introduction

The OPC UA PubSub communication model provides an optimized Publish Subscribe model for use cases where the Client/Server Subscription does not fit. One use case is high speed and cyclic data communication, where reliability is not required. Another use case is offloading of data distribution to a large (unlimited) number of receivers.

In this model, the Publisher produces messages that are sent to a so called Message Oriented Middleware. This Message Oriented Middleware can be network infrastructure if UDP multi-cast is used as transport protocol or could be a message broker if MQTT is used as transport protocol. The Publisher sends the messages independent of the number of Subscribers. Therefore the role of a Subscriber receiving messages is independent of the application that configures what the Publisher is sending.

The content of the exchanged messages is called DataSet. The DataSetMetaData describes the layout of the messages and can provide additional meta-data like units for the fields in the DataSet.

The selection of the input for the DataSet messages is called PublishedDataSet. The selection can be a list of Variable Values or the fields on an EventType.

The following figure shows the configuration model for OPC UA PubSub.


A PubSub connection defines the used protocol and the network address for sending or receiving messages. In the case of a message broker, the address represents a TCP/IP connection to the broker endpoint. In the case of UDP, this could be an IP multi-cast group. The selected protocol defines also the protocol specific headers used for the sent messages.

A WriterGroup defines the timing and header settings for PubSub NetworkMessages sent by a Publisher. Such a NetworkMessage can contain one or more DataSetMessages for the DataSetWriters contained in the WriterGroup.

The DataSetWriter is linked to a PublishedDataSet that defines the source of the message content and the DataSetMetaData. In addition the DataSetWriter defines the header settings for the DataSetMessage.

The DataSetReader is the counterpart to a DataSetWriter on the Subscriber side. It defines the filter for the selection of the Publisher and DataSetWriter of interest. It also contains the SubscribedDataSet that defines the processing of the received data. The default processing is a mapping to target variables in the Subscriber address space.

OPC UA PubSub defines different transport protocol mappings like UDP and MQTT and different message mappings like UADP (UA Datagram Protocol) and JSON.

The different configuration objects have generic settings and typically also transport and message mapping specific settings.

PubSub Configuration

The plug-in is able to manage a list of PubSub configurations. A configuration can be loaded from or to a server, from a file or a new configuration can be created. The list of configurations contains the servers in the project that support the PubSub configuration file exchange.

A new configuration can be written to a server or can be stored in a local file. The extension for these OPC UA Binary files is *.uabinary. This file extension is defined by OPC UA.


In the configuration list, the current configuration can be updated from single servers or from a list of servers and configuration changes can be saved to single servers or to a list of servers. The single server actions can be executed with the buttons for a server. The list operations can be started with the tool bar buttons above the list. The servers can be selected in the dialog opened by the tool bar buttons.

It is also possible to add a server to the configuration, add a new configuration or to add an existing configuration from a *.uabinary file.

PubSub Configuration Network View

The Network View tab provides a view of the configuration with the focus on communication relations.

The first level is the type of protocol used for the communication. Currently UDP multi-cast and MQTT are supported as options. The second level is a communication domain e.g. a UDP multi-cast address or a MQTT broker address.

With a double click to '<Add udp="" multicast="" group>="">' a new network address for UDP communication can be added. With double click to '<Add ua="" application>="">' one of the servers in the project can be added to the PubSub communication domain.


If an application should send data via PubSub, a DataSet Writer can be added with double click to '<Add dataset="" writer>="">'. Variables for sending can be added with drag&drop from the address space browser.

The tool bar button 'Hide / unhide all dock widgets' can be used to expand the PubSub Config View to the complete UaExpert window. The expanded view shows an additional browser that shows always the address space of the selected application. This makes it easier to configure the variables for DataSet Writers and Readers.


If an application should receive data via PubSub, a DataSet Reader can be added with double click to '<Add dataset="" reader>="">'. The related DataSet Writer from the PubSub communication domain can be selected with the following dialog.


A DataSet Reader can only be configured if a related DataSet Writer is available in the project.

The added DataSet Reader shows the fields sent by the DataSet Writer. The target variables can be selected with drag&drop from the address space browser.

The configured communication relations can be shown by selecting the PubSub domain e.g. the UDP multi-cast group. The relations of one application with the readers and writers to other applications can be shown by selecting the application.


PubSub Configuration View

The Configuration View is disabled by default. It can be enabled with the configuration setting PubSubConfigPlugin.EnableConfigurationViewTab (Settings → Configure UaExpert...).

The Configuration View tab provides a configuration tree that starts from the configurations in the project and provides below the configuration hierarchy of one configuration as defined by OPC UA PubSub.

Inside a configuration the first level are PubSub connections. They define the transport protocol and the address used to communicate inside a PubSub domain e.g. a UDP multi-cast address.

The transport profile must be selected if a new connection is added. The transport profile defines the combination of transport protocol and message mapping.


A new connection is created with default settings.

Make sure the Publisher ID is unique in the scope of the address (e.g. multi-cast IP-address).

If you have more than one network interface, you need to configure the IP-address of the network adapter to use as setting for 'Address Network Interface'

The user interface hides enhanced settings. Check 'Expert Mode' to see all settings. This is the same for all configuration levels.

The PubSub connection has two children where WriterGroups and ReaderGroups are managed.

The main configuration parameter for the WriterGroup is the Publishing Interval which is used to send PubSub NetworkMessages.


The + on the WriterGroup is used to create a new DataSetWriter.

The variables to published must be added to the PublishedDataSet.

The variables can be added manually with the 'Add Variable' button.

If UaExpert is connected to the OPC UA server that contains the variables to be published, drag & drop of variables from the Address Space view to the Published DataSet list can be used to configure the variables.


At the ReaderGroups, the + button is used to add a new ReaderGroup to the PubSub connection.


The + on the ReaderGroup is used to create a new DataSetReader.

This requires that the configuration of the Publisher is loaded to select the corresponding DataSetWriter in the Publisher configuration.


Use the button 'Create Default Target Variables' to initialize the list of target variables based on the PublishedDataSet configured for the selected DataSetWriter.

If you are connected to the Subscriber OPC UA Server (e.g. C++ Demo Server), you can drag & drop the target variables into the list of target variables.

Otherwise the NodeId of the target variables must be entered manually.