Watchdog for each metric

Hi all,
is there a way to add a watchdog (number counting up for each new value for individual metric) to each metric in SparkPlug B (Transmission Module).
We require something to be sure, that we don’t miss any data.

Thank you,
André

This is not a feature of Sparkplug. However, you could potentially implement something yourself by using a more complex datatype (like a Template). But, Sparkplug has built in mechanisms to ensure there is no data loss. This webinar from a while back explains in detail: https://www.youtube.com/watch?v=3syYeTg6RBc

HI @wes.johnson,

thank you for your response. So there is no way to monitor data integrity with OOB functionalities of SparkPlugB (Transmisison Module) without writing our own code.

Thank you,
André

Sparkplug itself and the architecture ensure data integrity. If a message is missed, that will be handled by the modules via Sparkplug mechanisms and result in a rebirth request to renew the session.

Understood, but there is no way for a end-user to verify the data integrity or how does Sparplug itself check the integrity of a message?

  1. There is seq. number for each message
  2. A seq. number for metric is not available
  3. A checksum for the whole message is not available

All of those statements are true. But keep in mind MQTT sits on top of TCP/IP which does have a checksum. Also as I mentioned, a seq number could be added to each metric via a template.

Thank you Wes :slight_smile:

Can you give me a hint where I can find how templates can be created in the Ignition Transmission Module? Should this be done via UDTs or is there another mechanism?

Yes - UDTs in Ignition get converted to Sparkplug Templates via Transmission. See here for a starting point: User Defined Types (UDTs) within Transmission - MQTT Modules for Ignition 8.x - Confluence

1 Like

Hi @wes.johnson
do you know any plans to add a checksum to a MQTT message or is there a way to add this as a feature request :slight_smile:

There are no plans for this. TCP has packet level checksums to ensure data integrity. MQTT sits on top of TCP and Sparkplug sits on top of MQTT. Is there a reason for another checksum on top of what TCP is already doing?

TCP error detection using checksums is highly reliable (around 99.99% packet integrity) but not completely foolproof. Since an MQTT message may consist of multiple packets, the overall data integrity can decrease.
A research paper (see sigcomm2000-9-1.pdf) recommends adding an extra checksum at the data level (a CRC over the entire message) for critical data. Although the paper is dated, there haven’t been any fundamental changes in this area, in my opinion.

We generally implement this for all types of transmitted data, and the request is whether it is possible to add this as an optional feature to MQTT/SparkPlug B.
It should be feasible to implement this on our own in Ignition (I guess it is), but it would be preferable if it were already built in.

This is not present now. I’ve added an issue to our backlog for this. I suspect it would be some time before we are able to prioritize this.