Sparkplug B is a data standard authored by Cirrus Link Solutions. Details on the Sparkplug B standard can be found online. This standard applies metadata to values to give them some context. This additional context is useful in downstream applications and allows for advanced functionality in applications that support the Sparkplug standard. For example, using Inductive Automation's Ignition SCADA platform, and Cirrus Link's MQTT Engine, completely automated tag generation is possible.
The Sparkplug B data format should only be used to connect to brokers that understand the Sparkplug B format. The format itself uses binary encoding and is not human readable.
Tutorials on how to use Cirrus' MQTT Engine with Ignition can be found online:
Sparkplug B topics are organized as: namespace/group_id/message_type/edge_node_id/[device_id]
For the MQTT application, the 'group_id' value is the Topic Prefix and the 'edge_node_id' is the Client ID. The 'device_id' field is not used by the MQTT Application. All values from the MQTT application are published as Node values (NDATA).
Screen grabs from Ignition are shown below. Using Sparkplug allows for automatic tag generation, automatic tag naming, and also pushing the High Level and Low Level values to the EngHigh and EngLow tags in Ignition.
The screen grab below shows an example of tag generation in Ignition. The Properties folder is created automatically by the MQTT App and includes some interesting information about the App and the RTU. In this case, we have configured the Topic Prefix as 'Sparkplug B Devices' and the Client ID as 'C Edge Node 2'. This follows along with the naming convention used in the example documentation from Cirrus Link.
Ignition - App and RTU Properties
The screen grab below shows digital values. These have been organized into the 'dig' folder by naming all of the digital inputs starting with 'dig/'. For example, the first digital input has a name of 'dig/0123456789abc_dig31' in the MQTT application's configuration.
Ignition - Digital Values
If the Enable Subscribe option is selected in the MQTT Server Settings group, and an individual monitored value has its Enable Subscribe option enabled, then it is possible to write the value of the tag from Ignition. Incoming values will be rejected if the Enable Subscribe option on the target tag is not enabled.
When a value is written from MQTT the value is also written to the monitored value's underlying Modbus register. The new value is also published back out via MQTT, which verifies that the tag was actually updated. Depending on communications speed, this process might take a few seconds.
If the Enable Subscribe option is selected in the MQTT Server Settings group, then two additional node control tags will be created. These are 'Node Control/Rebirth' and 'Node Control/Next Server'. Writing to the Rebirth tag will cause the application to send a new Sparkplug B NBIRTH message. Writing the Next Server tag will cause the application to disconnect from the MQTT server and connect to the next enabled MQTT server.