Modbus defines a 16-bit register and says nothing about how to spread a 32-bit value across two of them. Every vendor made a choice, and all four possible choices are in the field.
The four orders
Label the four bytes of a 32-bit value A, B, C and D, with A the most significant. The two registers can carry them in four ways:
| Name | Register 1 | Register 2 | Also called |
|---|---|---|---|
| ABCD | AB | CD | Big-endian |
| CDAB | CD | AB | Big-endian byte swap, word swap |
| BADC | BA | DC | Little-endian byte swap |
| DCBA | DC | BA | Little-endian |
ABCD and CDAB are by far the most common. They differ only in which register holds the high word, which is why swapping words is the first thing to try when a float reads as nonsense.
What a wrong order looks like
It does not throw an error. It produces a number, and the number is usually obviously wrong in one of a few ways:
- Absurd magnitude — 1.7e38 or 3.4e-41 where you expected 230.5.
- A value near zero that never changes, while the real value is large.
- A number that moves when the process moves, but by the wrong amount and in a jumpy way.
230.5 = 0x436C8000
ABCD register 1 = 0x436C register 2 = 0x8000 -> 230.5 correct
CDAB register 1 = 0x8000 register 2 = 0x436C -> 2.7e-40 wrong
BADC register 1 = 0x6C43 register 2 = 0x0080 -> 9.5e26 wrong
DCBA register 1 = 0x0080 register 2 = 0x6C43 -> 1.2e-38 wrongFinding the right one without guessing blindly
The reliable method is to read a register pair whose true value you know or can estimate — a voltage near 230, a frequency near 50, a temperature near ambient — and reinterpret the same two registers in all four orders. Exactly one will be plausible.
The same applies to 32-bit integers and 64-bit values
Word order affects any multi-register value, not just floats. A 32-bit energy counter read with swapped words increments in large irregular jumps instead of counting smoothly — a good diagnostic in itself. 64-bit values span four registers and the same principle applies across all four.
Modbus Polling Tool
Poll, inspect and troubleshoot Modbus devices in real time.