Skip to content

Sparkplug

You can also establish the connection to your devices via Sparkplug B. logiccloud Control implements the Sparkplug B 2.2 specification (Eclipse Sparkplug), an MQTT-based payload and session-management standard for industrial data.

To create a Sparkplug connection against the integrated broker, add a new Sparkplug connection that uses the logiccloud broker.

The reconnect period specifies how quickly a new connection is attempted if the connection is lost. Clean means that a clean session is started for each new connection without accessing previous value changes in the broker.

Protocol, host name and port are generated automatically and can be used for the connection to the broker. Once you have created the connection, select it in the structure tree. You will see the generated user name and password. You can use these to log in your devices.

The procedure is the same as when using the logiccloud MQTT broker. Click on the Add custom MQTT connection icon and fill in all the information. However, the protocol, host name, port and authentication via user name, password and any certificates for encryption must also be entered.

The client ID should always be unique for each connection and each device, as otherwise the broker may terminate the connection.

Sparkplug B defines a session lifecycle around birth and death certificates so that subscribers always know whether a publisher is online and which metrics it exposes:

  • NBIRTH / NDEATH — node-level birth and death certificates. On connect, the edge node publishes an NBIRTH announcing the node and its full metric set; the broker is configured with a NDEATH will message that is delivered if the node drops unexpectedly.
  • DBIRTH / DDEATH — device-level birth and death certificates for devices that sit underneath an edge node.
  • NDATA / DDATA — incremental node/device metric updates published after the birth certificate.

As a publisher (Owner namespace), logiccloud Control emits NBIRTH and DBIRTH certificates on connect, NDATA / DDATA for incremental metric updates, and DDEATH / NDEATH (the latter as the broker will message) when a device or node goes offline. As a subscriber (Consumer namespace) it subscribes to the full set — NBIRTH, NDEATH, NDATA, DBIRTH, DDEATH and DDATA — for the configured group/node/device.

A new namespace named Owner is automatically defined for each new connection. Sparkplug distinguishes between command and data namespaces.

Right-click on Owner to see the defined Group Id, Node Id and Device Id (in the Sparkplug specification the Node Id is the Edge Node ID). These identify the Sparkplug topic namespace (spBv1.0/<Group Id>/<message type>/<Node Id>/<Device Id>) and cannot be customized. Other Sparkplug participants can subscribe to these topics and receive the data.

In Sparkplug Mapping, you can map the access variables from the program with their data type. By default a metric is published under the access-variable name, but a mapping may also set an explicit tag name to publish under a different metric name.

To receive data from any Sparkplug participants and subscribe to their topics, you must add a custom Sparkplug connection and enter the broker information.

You can then right-click to create a new namespace. This can be given any name, for example Consumer. The variables can be mapped again in the Sparkplug mapping. So that you can receive data from other Sparkplug participants, you must create access variables with exactly the same name as the published variables.