Using the MQTT Driver With Sparkplug B

VTScada will generate a Sparkplug B SCADA Host ID automatically. This ID value is common to all instances of the MQTT Client Driver in an application. The SCADA Host ID should be entered into the EoN configuration of the remote device, if supported by that device.

There are various ways that VTScada can receive information from a remote device using the Sparkplug B protocol:

  1. Hardware sending a BIRTH message after receiving the "ONLINE" State message from VTScada as described in the protocol.
  2. Hardware sending a BIRTH upon connecting to a broker in which VTScada is already communicating, as per the protocol.
  3. VTScada sending Node Control / Rebirth commands upon receipt of a DATA message for which it has no BIRTH information.
  4. If a device is online but has no current data to send, then to get a BIRTH message set up a digital IO tag with a Write Address as follows:
spBv1.0/GroupID/NCMD/EoNID++Node Control/Rebirth

Where GroupID and EoNID are unique strings for each piece of hardware publishing to the MQTT Broker. Sending a value of 1 (one) will tell the device to send VTScada a BIRTH message if it supports the Node Control / Rebirth feature, as published in the protocol documentation, but marked as optional.

Support for the Node Control / Rebirth command is listed in the protocol specification as optional, so there may be pieces of hardware for which options 3 and 4 will not work.

DataSet as a data type is not currently supported in the Sparkplug B implementation. As an alternative, publish the metric multiple times in the same message in order to fill the history in a way that can be used in VTScada.

When in Sparkplug B mode, you can Import Tags from PLCs rather than create and configure them one at a time. Refer to MQTT Client Addressing.

History Addresses and Sparkplug B

If all of the following are true:

You are using the MQTT driver to read from a Sparkplug B device.

You are configuring I/O addresses yourself rather than letting the driver read them automatically.

The device sends messages that contain arrays of historical data.

Then...

Configure the History Address parameter of your I/O and Calculations tags to append the characters, $$History$$

If an array of data is sent to the Read address of an input tag (including legacy Status tags as well as the I/O and Calculations tag) then only the first value is read and the rest discarded. You must use the History address in order for the tag to process the full array.

Note also that the Read address and the History address must not be identical.

Example:

Read Address : spBv1.0/PT/DDATA/PTGateway/ET_EFB107_H_002++ACC00

History Address: spBv1.0/PT/DDATA/PTGateway/ET_EFB107_H_002++ACC00$$History$$