PubSub, MQTT and the UNS
Client-server does not fan out. This course covers OPC UA PubSub (the Part 14 model, UADP and JSON encodings, the UDP, Ethernet and MQTT mappings) and how it relates to a unified namespace, Sparkplug B and the determinism work in UAFX.
| Lessons | 11 |
|---|---|
| Time | about 88 minutes |
| Prerequisites | A4 |
| Cost | Free: written lessons open, video and labs need a free account |
What you will be able to do
- You can choose between client-server and PubSub for a given flow.
- You can configure a publisher and subscriber and read the wire format.
- You can design an MQTT topic structure that survives a second machine.
- You can explain why non-reversible JSON silently loses type information.
- You can say what UAFX and TSN are for without overselling them.
Syllabus
-
1
Decide whether you need PubSub at all7 min
Most plants do not. The honest test, and the cost of adding it when you did not need to.
Asset A decision table over eight real data flows with the reasoning for each
-
2
Learn the Part 14 model9 min
PublishedDataSet, DataSetWriter, WriterGroup, DataSetReader. Four objects that account for most of the confusion.
Asset A configured publisher and subscriber with every object named in the config
-
3
Choose UADP or JSON7 min
Binary efficiency against human readability, and where each belongs.
Asset The same dataset on the wire in UADP and in JSON, byte counts included
-
4
Avoid the non-reversible JSON trap8 min
Non-reversible JSON loses type information and cannot be round-tripped. Also: Good is 0 and is omitted, so a missing status means Good, not missing data.
Asset The same DataValue in reversible and non-reversible JSON, with what is lost marked
-
5
Publish over MQTT9 min
The broker mapping, topic naming, retained messages and QoS: the configuration most people actually deploy.
Asset A publisher to Mosquitto with the messages captured in MQTT Explorer
-
6
Publish over UDP multicast and Ethernet8 min
Local real-time fan-out, the multicast address, and when raw Ethernet earns its complexity.
Asset A UDP multicast publisher captured in Wireshark with the UADP header decoded
-
7
Understand key frames and delta frames7 min
Sending only what changed, and the reason a subscriber that joins late sees nothing until the next key frame.
Asset A capture showing key and delta frames, with a late subscriber's blank period
-
8
Secure PubSub with a key service7 min
PubSub has no session, so key distribution works differently. What the SKS does.
Asset A secured PubSub group with the key exchange traced
-
9
Build a topic structure that scales9 min
Deriving topics from browse paths, and the naming decisions that hurt at machine number two rather than machine number one.
Asset A topic tree for a 40-machine plant, with the three naming mistakes it avoids
-
10
Compare with Sparkplug B9 min
Where Sparkplug overlaps, where it does not, and why the two coexist in real plants.
Asset The same machine published as OPC UA PubSub and as Sparkplug B, both payloads shown
-
11
Know what UAFX and TSN are for8 min
Controller-to-controller communication and deterministic Ethernet. What is released, what is not, and why this is not what your OEE project needs.
Asset The released UAFX nodesets with their versions and publication dates, and what each covers
Lab
Free account required
Publish two values to a local Mosquitto broker as OPC UA PubSub over MQTT, inspect the payload in MQTT Explorer, then switch the encoding to non-reversible JSON and identify what disappeared.
Unlock the lab →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.