Modbus Data Types and Byte Order
Key Takeaway
How to handle 32-bit integers, IEEE 754 floats, and strings in Modbus registers — byte order (endianness) variations and how to determine the correct order.
Quick Answer
Modbus registers are 16-bit, but 32-bit values (integers and IEEE 754 floats) span two registers. The byte/word order varies by manufacturer — big-endian (ABCD), little-endian (DCBA), or byte-swapped variants. Incorrect byte order is the most common cause of wrong readings.
16-bit Values
Single register, straightforward. INT16 (-32768 to 32767) or UINT16 (0 to 65535).
32-bit Float (IEEE 754)
Two consecutive registers. Four possible byte orders:
| Format | Reg 1 | Reg 2 | Example (1.0) |
|---|---|---|---|
| ABCD (Big-Endian) | 3F80 | 0000 | Most common |
| DCBA (Little-Endian) | 0000 | 803F | Some devices |
| BADC (Byte-Swap Big) | 803F | 0000 | Some Schneider |
| CDAB (Byte-Swap Little) | 0000 | 3F80 | Some devices |
Determining Byte Order
Read a known value (e.g., write 1.0 to a setpoint register). Read raw hex values of both registers. Compare to the table above. Configure your SCADA driver accordingly.
For platform-specific byte order settings, see Modbus in Ignition and ABB Totalflow Modbus.
Frequently Asked Questions
Almost always a byte order mismatch between the device and SCADA driver. Read raw hex values of a known value and compare to expected IEEE 754 representation.
Read two consecutive holding registers with FC03, combine into 32-bit value, interpret as IEEE 754. The word order must match the device manufacturer's specification.