PLC Commissioning Tool
Modbus Register Calculator
Decode a value across two registers in any byte/word order, encode it back, and translate the 40001 address to the 0-based protocol address — with the right function codes.
A = most-significant byte, D = least-significant. If a device’s float reads as garbage, it’s almost always a different order — try CDAB (word swap) first.
The conventional 40001 and the protocol address 0 point to the same register — the data model is 1-based, the wire is 0-based. That off-by-one is the #1 cause of “reading the wrong register.”
Questions
Frequently Asked
Why does my Modbus float read as garbage?
Almost always byte/word order. A 32-bit float spans two 16-bit registers, and devices disagree on which word comes first and whether the bytes inside each word are swapped. There are four common layouts — ABCD (big-endian), CDAB (word-swapped), BADC (byte-swapped) and DCBA (little-endian). Paste your two registers into the decoder, then click through the four orders until the value looks right.
What does the 40001 vs 0 address thing mean?
Modbus has two ways of naming the same register. The conventional data model is 1-based and prefixes the type (4xxxx for holding registers), so the first holding register is 40001. The protocol address that actually travels on the wire is 0-based, so that same register is address 0. Holding register 40001 = protocol address 0, 40010 = protocol address 9, and so on. Mixing the two is the classic off-by-one bug.
Which function code do I use?
It depends on the object type. Coils: read FC01, write FC05 (single) or FC15 (multiple). Discrete inputs: read FC02 (read-only). Input registers: read FC04 (read-only). Holding registers: read FC03, write FC06 (single) or FC16 (multiple). The address panel shows the right codes for whatever type you select.
What are the four byte orders called?
Using A–D for the four bytes of a 32-bit value (A is the most significant): ABCD is standard big-endian, DCBA is little-endian, BADC swaps the bytes within each register, and CDAB swaps the two registers (word swap) while keeping bytes in order. Energy meters and many drives use CDAB, which is why it’s the first thing to try when a float looks wrong.
Does this handle signed integers and 32-bit ints too?
Yes. The decoder supports INT16, UINT16, INT32, UINT32 and FLOAT32, with the same byte/word order options applied to the multi-register types. Signed values use standard two’s-complement, so -1 in a single register shows as 0xFFFF.
Is anything sent to a server?
No. All conversion runs in your browser — no register values, addresses or device data leave your machine.
