Modbus Data Types Reference: Floating-Point (Float32 / Float64), Integers & Strings
How Modbus encodes 32-bit and 64-bit IEEE 754 floating-point values, signed/unsigned integers, scaled registers and ASCII strings across 16-bit registers.
Quick Answer: Modbus natively stores data in 16-bit registers (2 bytes each). A 32-bit IEEE 754 floating-point number (FLOAT32 / REAL) spans 2 consecutive registers (4 bytes) and requires matching the device's byte/word order (ABCD Big-Endian, CDAB Word-Swapped, BADC, or DCBA). A 64-bit float (FLOAT64) spans 4 consecutive registers.
Why Modbus Needs Data Type Decoding
The Modbus protocol specification only defines two primitive storage elements: 1-bit coils/discrete inputs and 16-bit unsigned registers (2 bytes per register). Whenever a PLC, power meter, VFD, or solar inverter transmits a floating-point number (`FLOAT32` / `REAL` or `FLOAT64` / `LREAL`), a 32-bit signed integer (`INT32` / `DINT`), a 64-bit energy accumulator (`INT64` / `UINT64`), or an ASCII string, it splits that value across multiple consecutive 16-bit registers.
FLOAT32) always occupies 2 consecutive 16-bit Modbus registers (4 bytes / 32 bits). A 64-bit double-precision float (FLOAT64) occupies 4 consecutive 16-bit registers (8 bytes / 64 bits).
Complete Modbus Data Types Reference Table
| Data Type | PLC / IEC 61131-3 Name | Registers | Bits / Bytes | Value Range / Format |
|---|---|---|---|---|
UINT16 |
WORD / UINT |
1 register | 16 bits (2 B) | 0 to 65,535 |
INT16 |
INT |
1 register | 16 bits (2 B) | -32,768 to +32,767 (Two's complement) |
FLOAT32 (Floating Type) |
REAL / IEEE 754 Single |
2 registers | 32 bits (4 B) | ±1.18 × 10⁻³⁸ to ±3.40 × 10³⁸ (~7 decimal digits precision) |
FLOAT64 (Double Float) |
LREAL / IEEE 754 Double |
4 registers | 64 bits (8 B) | ±2.23 × 10⁻³⁰⁸ to ±1.80 × 10³⁰⁸ (~15–17 decimal digits) |
UINT32 |
DWORD / UDINT |
2 registers | 32 bits (4 B) | 0 to 4,294,967,295 |
INT32 |
DINT |
2 registers | 32 bits (4 B) | -2,147,483,648 to +2,147,483,647 |
UINT64 / INT64 |
ULINT / LINT |
4 registers | 64 bits (8 B) | 64-bit kWh counters & high-precision timestamps |
ASCII String |
STRING[n] |
N registers |
2 chars / reg | 2 ASCII characters packed per 16-bit register (HiByte, LoByte) |
Understanding Modbus Floating-Point Types (FLOAT32 & FLOAT64)
When engineers search for Modbus floating type, they are almost always dealing with IEEE 754 single-precision 32-bit floats (`FLOAT32`). In IEEE 754 format, 32 bits are divided into:
- 1 Sign bit (bit 31):
0for positive,1for negative. - 8 Exponent bits (bits 30–23): Biased by
127. - 23 Mantissa / Fraction bits (bits 22–0): Normalized binary fraction with an implicit leading
1.
For example, the AC line voltage 230.5 V is encoded in IEEE 754 hex as 0x43668000 (4 bytes: 43, 66, 80, 00). Because Modbus sends 16-bit registers, devices can order those 4 bytes in 4 different ways:
| Byte Order Code | Common Name | Register 1 (First) | Register 2 (Second) | Typical Vendors Using This Order |
|---|---|---|---|---|
ABCD |
Big-Endian (High Word First) | 0x4366 (17254) |
0x8000 (32768) |
Schneider Electric, Eastron SDM630, Siemens S7 (with swap), Carlo Gavazzi |
CDAB |
Word-Swapped (Low Word First) | 0x8000 (32768) |
0x4366 (17254) |
Modicon PLCs, Sungrow Inverters, many RTUs & flow computers |
BADC |
Byte-Swapped within Words | 0x6643 (26179) |
0x0080 (128) |
Legacy byte-swapped serial telemetry gateways |
DCBA |
Little-Endian (Full Reverse) | 0x0080 (128) |
0x6643 (26179) |
Little-endian x86/ARM memory dumps without network byte-order conversion |
Floating-Point vs. Scaled Integer Registers (Scale × Raw + Offset)
Many industrial instruments (such as Victron Energy GX devices, Huawei SUN2000 inverters, and compact temperature controllers) avoid IEEE 754 floats and instead store fractional numbers as scaled 16-bit or 32-bit integers:
Example: Raw INT16 = 2305, Scale = 0.1 → 230.5 V | Raw INT16 = 5002, Scale = 0.01 → 50.02 Hz
In ModbusBB 2.1, you can configure both native IEEE 754 FLOAT32/FLOAT64 decoding and per-row linear scaling (Scale, Offset, and Unit label) directly in the register grid.
Frequently Asked Questions
How many Modbus registers does a floating-point (Float32) value use?
A standard IEEE 754 single-precision floating-point value (FLOAT32 / REAL) uses 2 consecutive 16-bit Modbus registers (4 bytes / 32 bits total). Make sure your Modbus master polls an even count of registers starting at the exact start address of the float.
Why does my Modbus float read as a huge or tiny garbage number like 1.42e-41?
That happens when either (1) your word order is swapped (try switching between ABCD Big-Endian and CDAB Word-Swapped), or (2) your start address is off by 1 register (the 0-based vs 1-based addressing offset), causing your master to combine the low word of one float with the high word of the next float.
Which Modbus function code reads floating-point registers?
Modbus does not have a dedicated function code for floats. You read floating-point values using Function Code 03 (Read Holding Registers) or Function Code 04 (Read Input Registers) with a quantity of 2 registers per Float32 value, and your Modbus client software decodes the 4 returned bytes as IEEE 754.
Decode Float32, Float64 & Int32 Registers Live in ModbusBB
Poll holding and input registers with per-row data types, byte-order swap (`ABCD`, `CDAB`, `BADC`, `DCBA`), linear scaling (`Ax + B`) and engineering units.