MQTT and Sparkplug: a shared contract for industrial data
MQTT carries messages but does not define a data model. Sparkplug fills that gap by standardizing topic names and payload structure.
A number read over Modbus is not an engineering value until address base, scale and word order are verified.
Modbus defines four data tables: coils, discrete inputs, input registers and holding registers. An address such as “40001” in a device manual usually names the holding-register table with one-based numbering, while the address on the wire starts at zero. That difference produces an off-by-one register and the wrong variable being read.
A register carries a 16-bit integer. A temperature arriving as “253” can mean the device defines a decimal scale, for example 25.3. The scale, unit, signed or unsigned interpretation and valid range should be written in the map. The layer that interprets the number should read this from a table, not from code.
A 32-bit value spans two consecutive registers. Byte order and word order can differ between devices. Test the correct order against a known reference value. A wrong order often gives absurdly large or meaningless numbers, but it can also yield a plausible and wrong number.
Store the register map with the device model and firmware version. When commissioning a device, compare three known values: a fixed setting, a simulated value and a hand measurement. This is a suggested verification step; the register layout of a specific device is defined by the manufacturer’s documentation.
Take scale, unit, signed or unsigned interpretation and valid range from the device documentation and write them into the map. The layer that interprets the number should read this from a table, not from code. Store the map with the device model and firmware version, and compare three known values when commissioning.
A 32-bit value spans two consecutive registers, and byte order and word order can differ between devices. Test the order against a known reference value. A wrong order often gives absurdly large or meaningless numbers, but it can also produce a plausible and wrong number.
Pilot steps in this guide are proposed engineering workflows. Examples do not constitute measured field performance.