Modbus byte and word order for float and 32-bit values
A Modbus register holds 16 bits. Floats and 32-bit integers use two registers, and devices disagree on which comes first. This page shows the four orders and how to find yours.
Why the value looks wrong
Modbus defines how the bytes inside one 16-bit register are sent (high byte first). It does not define how a 32-bit or 64-bit value is split over several registers, so every manufacturer picked its own order. If you read a float with the wrong order you get a huge number, a tiny number or nan, not a small error.
The four orders
Call the four bytes of a 32-bit value A B C D, with A the most significant. Two registers carry them in one of four ways. The example is the float 123.456, which is 42 F6 E9 79 in IEEE 754 single precision.
| Order | Name in Busscope | First register | Second register |
|---|---|---|---|
| ABCD | Big-endian (AB CD) | 42F6 | E979 |
| CDAB | Little-endian byte swap (CD AB) | E979 | 42F6 |
| BADC | Big-endian byte swap (BA DC) | F642 | 79E9 |
| DCBA | Little-endian (DC BA) | 79E9 | F642 |
Word swap (CDAB) is the most common difference you meet in the field: the registers are the right way round inside, but the low word comes first.
How to find the right order
- Read the two registers as Hex and write them down.
- Find a value you know. Many devices show the same quantity on a display or in their own software, or you can use a setpoint you wrote yourself.
- Switch the order until the decoded value matches. Only one of the four gives a sensible number for a given value.
- Write down the order for the device model. All values of one device normally share it.
Sixteen-bit values (Signed, Unsigned, Hex, Binary, ASCII) are not affected. The order only matters for formats that use two or four registers: Long, Long Unsigned, Long Hex, Float, Double, Int64 and UInt64.
Set it in Busscope
Busscope has 12 display formats and a byte and word order setting with the four orders above. You pick the format and the order for the whole poll window or for the selected cells, and the same setting is used when you write a value from the table. The raw registers stay visible as Hex, so you can compare what the device sent with the decoded number.
A value that spans registers must also be aligned: if a float starts at the wrong register you decode half of one value and half of the next. Check the start address first (see Modbus register addresses), then the order.
Related guides
Try Busscope
Install Busscope and run it without a license key to see whether it fits your work. Evaluation mode is for trying the tool, not for production or commercial use.