-

OPC UA PubSub Communication

Note
This help topic describes the configuration of a publisher-subscriber communication in PLCnext Engineer. For details on the technical background please refer to the specification/documentation published by the OPC UA foundation.

PLCnext Technology controllers with a firmware version 22.0 or newer support the OPC UA PubSub (publisher/subscriber) communication model according to Part 14 of the OPC Unified Architecture specification.

Note
OPC UA PubSub is a paid feature for which you can purchase a separate license in the PLCnext Store. For test purposes, a four-hour trial period is available after starting the controller. After the trial period the controller stops the PubSub communication until you have activated the feature for an unlimited period by entering the purchased license.

This topic contains the following sections:

General information on OPC UA PubSub

In general, the OPC UA PubSub (publish-subscribe) communication model complements the client-server communication pattern (which PLCnext Technology controllers also support by the integrated OPC UA server).

OPC UA PubSub as implemented in the PLCnext context supports, for example, the controller-to-controller communication (which is more performant as, for example, controller-to-cloud communication) as well as other use cases. The communication is handled via UDP (User Datagram Protocol) mechanisms over a standard IP network.

This way, PubSub enables the distribution (publishing) of data from an OPC UA information source available in a controller to all appropriately configured subscribers within the device network addressed in the PubSub configuration. Generally, the PubSub communication is independent of any OPC UA server configuration or operation. It requires the configuration of a publisher (if data should be distributed into the network) and as data receiver(s) one or several subscribers.

Note
OPC UA PubSub communication requires IGMP-capable switches in the controller network.
IGMP (Internet Group Management Protocol) is a communication protocol of the TCP/IP protocol family. It is necessary for the organization of multicast receiver groups in IPv4 networks. IGMP enables a publisher to send data streams to entire groups of recipients in a targeted manner, making optimal use of transport and routing capacities.

The OPC UA PubSub communication is independent of the OPC UA client-server communication. However, a publisher or subscriber as described here can be an OPC UA server or client at the same time.

PubSub configuration

The OPC UA PubSub configuration is located on the 'OPC UA' PLANT node. The configuration for the current controller is done in the 'OPC UA PubSub' editor.

Initially, a new configuration only contains the empty 'Published data sets' category. After defining groups of publishers (writers) and subscribers as well as data sets to be published, the tree can be used to navigate through the configuration and open the parameters in the editor.

The elements in this hierarchical configuration structure apply to the PubSub standard defined by the OPC UA foundation.

The compiler checks the entered configuration values for validity such as multiple IDs, an invalid network multicast address etc. (based on a OPC UA-conform schema). The applicable rules are explained in the respective configuration steps.

Binary configuration file

For an error-free configuration, the compilation results in a binary output file according to the OPC UA standard. The output file named pcwe.opcua.pubsub.uabinary is stored in the 'Binaries location' set in the 'Options' dialog and it is included into the project image. When writing the project to the controller, this binary file is there stored under
/opt/plcnext/projects/PCWE/Services/OpcUA/PubSubConfig.

What do you want to do?

The steps to configure a publisher/subscriber and to define the data sets to be published are described in separate subtopics. When defining an initial configuration we recommend to perform these procedures in the order mentioned below.

Note
Although controllers can act as both publisher and subscriber, they will not want to subscribe to the data sets they publish themselves. Consequently, publisher and subscribers of a given data set are to be defined in different PLCnext Engineer projects.