
Modbus Values Look Wrong? 32-Bit Numbers, Floats and Byte Order
The power meter display shows 1234.5, yet the value read over Modbus is astronomically large. The data is fine; the two registers are just being combined in a different order from the one the device uses.
From registers to 32-bit values
Modbus returns registers, and hex makes their bytes easy to see. Using 1234.5 as the example, we go from one register to a 32-bit value, then look at the data types common in register maps.
One register = 16 bits = 2 bytes
8 bits make a byte. A register is 16 bits, or 2 bytes, written as 4 hex digits with 2 digits per byte: 449A is the high byte 44 followed by the low byte 9A.
32 bits take two consecutive registers
Floating-point numbers, and values that keep growing such as accumulated energy, don’t fit in 16 bits. They use 32 bits: two consecutive registers, or 4 bytes.
Common data types
The register map gives a data type for every point. It tells you how many registers to read and how to interpret the number.
| Type | Full name | Registers | Range |
|---|---|---|---|
| UInt16 | Unsigned 16-bit Integer | 1 | 0 to 65,535 |
| Int16 | Signed 16-bit Integer | 1 | −32,768 to 32,767 |
| UInt32 | Unsigned 32-bit Integer | 2 | 0 to 4,294,967,295 |
| Int32 | Signed 32-bit Integer | 2 | −2,147,483,648 to 2,147,483,647 |
| Float32 | 32-bit Floating Point (IEEE 754) | 2 | About ±3.4×10³⁸, with decimals, about 7 significant digits |
Byte order: Big and Little
The Modbus specification only fixes the order inside a register: high byte first. Which of the two registers holds the high-order word is up to each vendor. With the 4 bytes labeled A, B, C and D from high to low, the two common layouts are Big-endian (ABCD) and Little-endian (CDAB).
The two registers a device sends for 1234.5 (44 9A 50 00):
| Address | Value |
|---|---|
| 0x0000 | 44 A9A B |
| 0x0001 | 50 C00 D |
Big-endian (ABCD): high word first
Two other layouts exist: BADC (bytes swapped inside each register) and DCBA (fully reversed). Some software uses the name Little-endian for DCBA instead, so go by the byte layout when you configure. On CGate, Little means CDAB.
Paste what you read and find the byte order and type
Enter the register values in hex, in the order they were read (only the first one for a 16-bit point), then the number the device display showed at the same moment. Matching cells are highlighted.
Leave empty for a 16-bit point
| Byte order | Rearranged | Float | Unsigned | Signed |
|---|---|---|---|---|
| ABCD | 449A 5000 | 1234.5 Match | 1150963712 | 1150963712 |
| CDAB | 5000 449A | 8.607918e+9 | 1342194842 | 1342194842 |
Example: reading a power meter with CGate
Below is a sample register map, not from a specific brand; use the addresses and types in your own power meter’s manual. Select a point or one of its registers to see how that point is set up on our CGate gateway.
How many registers each point takes
Total active energy· UInt32
- Start address
- 0x0002
- Registers used
- 0x0002–0x0003 (2 registers)It occupies two registers, 0x0002 and 0x0003.
- Data type
- 32-bit unsigned integer, length 2, scale factor 0.01, unit kWh
- Set on CGate
- Data type32-bit unsigned integer
Models in this article
Full comparison on the product line page











