0x00004248 as an IEEE 754 32-bit single precision float is 2.3777e-41.
Tip:If a meter reads a sensible number in one word order and nonsense in the others, that order is the device’s. Registers 4120 0000 read 10 in ABCD order and 2.3e-41 in CDAB.
An IEEE 754 single-precision float stores a number in 32 bits: 1 sign bit, 8 exponent bits and 23 fraction bits. 230.5 is stored as 0x43668000. Energy meters, power analysers and PLCs use this format for readings such as voltage, power and frequency, and send it over Modbus as two 16-bit registers.
The register values a device returns are the raw bits. Reading them as integers gives nonsense, so the bits have to be decoded as a float, in the right word order.
The value of a stored float
x = (−1)s × 1.f × 2e − 127
s is the sign bit, e the 8-bit exponent field and f the 23 fraction bits read as a binary fraction. The leading 1 is implied, so it is not stored. For 64-bit doubles the exponent has 11 bits and a bias of 1023, and the fraction has 52 bits.
Decimal to hex
Find e and f so that 1.f × 2e − 127 is the nearest value to x
Most decimals have no exact binary form, so the float stores the nearest one. 0.1 becomes 0.100000001490116, stored as 0x3DCCCCCD. The calculator shows the value actually stored and the rounding error.
Special values
e = 0: zero or subnormal; e = 255: infinity or NaN
An exponent field of all zeros holds zero and the subnormal numbers below 1.18 × 10−38. All ones holds infinity (fraction zero) or NaN, “not a number”. Many meters send NaN, often 0x7FC00000, for a reading they cannot make.
Modbus defines only 16-bit registers, sent high byte first, so a 32-bit float takes two. The standard says nothing about which register comes first. Many devices send the high word first (ABCD), many others the low word first (CDAB), and a few swap the bytes inside each register as well (BADC, DCBA). The device’s register map should say; when it does not, the order that gives a plausible reading is the right one.
IEEE 754 float examples
A frequency of 50 Hz
50 is 1.5625 × 25, so the sign bit is 0, the exponent field is 5 + 127 = 132 and the fraction holds 0.5625. The result is 0x42480000, sent over Modbus as the registers 4248 0000 in ABCD order.
If a meter sends the low word first and the software reads it high word first, 50 Hz arrives as 0000 4248. Read as ABCD that is 2.3777e‑41, a subnormal number close to zero. A reading that is tiny, huge or NaN where a normal value belongs is the usual sign of a word-order mismatch.
In binary, 0.1 repeats for ever, like 1/3 in decimal. The nearest 32-bit float is 0.100000001490116, stored as 0x3DCCCCCD. The error is about 1.5 × 10−9, far below any meter’s accuracy, but it is why a float compared with 0.1 for exact equality can fail.
About 7 significant decimal digits. Above 16,777,216 (224) not every whole number can be stored, which matters for energy counters: a kWh total held as a 32-bit float stops counting in single units once it passes about 16.8 million. Meters that keep large totals use 64-bit floats or integers for this reason.
What are ABCD, CDAB, BADC and DCBA?
The four byte orders a device can use for a 32-bit value in two registers. A is the most significant byte. ABCD sends the high register first with big-endian bytes, as Modbus does for single registers. CDAB swaps the two registers; BADC swaps the bytes in each register; DCBA does both.
Is the hex the same as what the meter sends?
In ABCD order, yes: the hex is the four bytes in the order they appear on the wire. For other orders, use the register words the calculator lists for that order. The Modbus register decoder starts from the registers and shows every order at once.
Why does a meter report NaN?
NaN means the value is not available: a phase with no voltage, a power factor at zero current, or a register the device does not implement. Treat it as a missing reading rather than zero.
Limits of this result
Modbus defines 16-bit registers only. How a device packs a float into registers is set by its own register map, not by the protocol.
A NaN has many bit patterns; this tool shows the one entered or the platform’s default.
Decimal input is read as a 64-bit number first, so digits beyond about 17 significant figures are ignored.
Read Modbus devices on the Gateway
Edge reads Modbus meters over TCP and RTU and decodes each register by the type and word order in its device template. A ZMB connects an RS-485 meter to the Gateway wirelessly.