When decoding a 32-bit IEEE 754 float carried over 2 consecutive Modbus registers, how many different byte-order combinations does a developer typically encounter in practice depending on the slave?
C — 4 (ABCD, DCBA, BADC, CDAB)
Four combinations are commonly seen: ABCD (standard Big Endian, the official Modbus order), DCBA (reversed Little Endian), BADC (Big Endian Byte Swap -- registers in the right order but inner bytes swapped) and CDAB (Little Endian Byte Swap -- registers swapped but inner bytes in normal order). A is wrong because, in practice, far more than one order is encountered. B is wrong because there are not just two orders; both byte-swap variants must be supported as well. D is wrong because, although eight permutations of four bytes exist mathematically, only those four are actually used by vendors. The root cause is that the original Modbus standard only specified byte order within a 16-bit register, not how to combine two registers for a 32-bit value, so each vendor made its own choice.
Configure your driver with the byte order as a parameter, not as a constant in the code: changing vendor or firmware version will eventually force you to switch convention without recompiling.
- A.1 (standard Big endian)
- B.2 (Big endian, Little endian)
- C.4 (ABCD, DCBA, BADC, CDAB)✓
- D.8 (all possible permutations)
Modbus bank in preparation
The full Modbus bank isn't available yet. Drop your email to get notified at launch and grab an early-bird discount.
Join the waitlist →See the 9 other Modbus practice questions
Related questions
- A Modbus RTU bus on RS-485 supports up to 32 nodes per segment (extendable with repeaters), requires 120 ohm termination resistors at both ends of the bus, and biasing resistors to define the idle state.3. Modbus RTU · RS-485 Multi-Drop
- Which Modbus function code is used to READ the Holding Registers (16-bit read/write registers) of a slave?4. Function codes · Lesen Coils/Register
- Function 0x06 "Write Single Register" writes a single 16-bit Holding Register on a Modbus slave, with both the address and the value encoded on 16 bits each in the request.4. Function codes · Write Single Register (0x06)
- To carry a 32-bit IEEE 754 floating-point value over Modbus (whose registers are 16 bits), two consecutive registers are typically used, with the byte order documented by the slave manufacturer.5. Data encoding · 32-Bit-Float
- Modpoll (focus-sw.com) and mbpoll (Linux/macOS) are free command-line tools used to query a Modbus slave from a PC, indispensable for Modbus diagnostics and integration commissioning.6. Practical · Modpoll / mbpoll