Most industrial energy meters publish voltage, current, power and energy as 32-bit IEEE 754 floating-point numbers. Modbus, however, only knows 16-bit registers. Each value is therefore split across two consecutive registers, and the Modbus specification says nothing about which half comes first. Every manufacturer chooses, and they do not all choose the same way.
The symptom is always the same: communication works, the CRC is fine, the register address is right, and the number is nonsense. Usually it is extremely small, extremely large, or negative where it cannot be.
One value, four possible orders
Take a phase voltage of 230.5 V. As an IEEE 754 single-precision float it is the four bytes 43 66 80 00, written here most significant first and labelled A B C D. The meter sends them as two registers. The four orders you will meet in practice are:
| Name | Register 1 | Register 2 | Decoded as if it were ABCD |
|---|---|---|---|
| ABCD (big-endian) | 0x4366 | 0x8000 | 230.5 (correct) |
| CDAB (word-swapped) | 0x8000 | 0x4366 | -2.42 × 10⁻⁴¹ |
| BADC (byte-swapped) | 0x6643 | 0x0080 | 2.30 × 10²³ |
| DCBA (little-endian) | 0x0080 | 0x6643 | 1.18 × 10⁻³⁸ |
CDAB, the word-swapped order, is very common on panel meters sold in India, and it produces the most confusing result: a value so close to zero that a dashboard rounds it to 0.00 and the meter looks dead.
How to find the right order in five minutes
- Pick a register whose value you can see on the meter's own display, such as phase voltage. Note the display value.
- Read the two registers raw, as unsigned 16-bit integers, with any Modbus test tool.
- Combine them in each of the four orders and decode each as a float. Exactly one result will match the display.
- Set that order for the whole meter. Manufacturers use one order across a model's register map, so one check is enough per model.
function decode(r1, r2) {
const b = Buffer.alloc(4);
b.writeUInt16BE(r1, 0);
b.writeUInt16BE(r2, 2);
const [A, B, C, D] = b;
const f = (...x) => Buffer.from(x).readFloatBE(0);
return {
ABCD: f(A, B, C, D),
CDAB: f(C, D, A, B),
BADC: f(B, A, D, C),
DCBA: f(D, C, B, A)
};
}
decode(0x8000, 0x4366); // CDAB → 230.5Other mistakes that look like a word-order problem
- Off-by-one addressing. A datasheet that lists "30001" or "40001" usually means register offset 0 on the wire. If the value looks like half of one float and half of the next, shift the address by one.
- Wrong function code. Some meters expose measurements as input registers (function 04) and others as holding registers (function 03). The wrong one returns an exception or a different table.
- Reading one register instead of two. A FLOAT32 always needs a quantity of 2. Reading 1 returns only the high or low half.
- Scaled integers. Some meters publish integers with a fixed multiplier (for example voltage × 10). Those must not be decoded as floats at all. The register map says which format each value uses.
- Energy counters in two formats. Cumulative kWh is sometimes a FLOAT32 and sometimes a 32-bit or 64-bit integer, even on the same meter, and float counters lose resolution as they grow.
How we handle it
In our Energy Monitoring System every meter model has a register map that records the address, function code, data type and word order of each value. A new meter is checked once against its display at commissioning, and the map is reused for every meter of that model after that. Readings are stored as engineering values, so dashboards, alerts and reports never see raw register words.


