Free engineering calculators and unit convertersceo@instrumentationblog.in
Communication Protocols · Free Tool

Modbus Float Converter (IEEE 754, Two Registers)

Turn two Modbus registers into a 32 bit floating point value, and see the result for every byte and word order at once, so you can spot the right one immediately.

IEEE 754ABCD, CDABWord swapFloat to hex
Float value123.456
As unsigned 32 bit1123477881
As signed 32 bit1123477881
How this result was calculated
  1. Bytes in order ABCD are assembled into a big endian 32 bit word, then read as IEEE 754 single precision.

Same registers in every byte order

OrderFloatUnsigned 32 bit
ABCD123.4561123477881
CDAB−1.883367 × 10^+253917038326
BADC−9.861115 × 10^+324131551721
DCBA1.518500 × 10^+352045376066
Advertisement

How a Float Fits in Two Registers

32 bit IEEE 754 float = 4 bytes A B C D (sign, 8 bit exponent, 23 bit mantissa)
ABCD: register 1 = A B, register 2 = C D · CDAB: register 1 = C D, register 2 = A B

Modbus defines 16 bit registers only, so each manufacturer chooses how to place the 4 bytes of a float. Word swapped (CDAB) is very common in PLCs and meters.

Worked example

123.456 is 0x42F6E979. In ABCD order register 1 = 0x42F6 and register 2 = 0xE979; a CDAB device sends 0xE979 first.

Key insight: if a value reads as a huge number or a tiny fraction such as 1.2 × 10^−38, the byte order is wrong; the table shows all four so the sensible one stands out.
Advertisement

Frequently Asked Questions

What is CDAB byte order?

Word swapped: the low word is sent in the first register and the high word in the second.

Why does my Modbus float show a strange value?

Usually the word or byte order is wrong, or the two registers are not aligned (reading from an odd address).

How many registers does a float use?

Two 16 bit registers for a 32 bit float; four for a 64 bit double.

You May Also Like

Learn more on the blog

Modbus protocol explained: RTU vs TCP

A practical, field focused guide on instrumentationblog.in that explains the theory behind this tool and how engineers apply it on real plants.

Read Full Article

More Communication Protocols

More Instrumentation Tools