Free engineering calculators and unit convertersceo@instrumentationblog.in
Communication Protocols · Free Tool

Modbus Register Address Calculator

Convert between Modbus reference numbers (40001, 30001, 10001, 00001) and the zero based address that actually goes in the message, with the matching function codes.

40001 to 0Function codes5 and 6 digitHex address
Zero based address (in the message)107
Address in hex0x006B
5 digit reference40108
6 digit reference400108
TableHolding register (16 bit, read and write)
Read withFC 03 Read Holding Registers
Write withFC 06 Write Single Register, FC 16 Write Multiple Registers
How this result was calculated
  1. The first digit selects the table; the rest is the 1 based register number.
  2. Address in the message = register number − 1 = 107
Advertisement

Modbus Reference Numbers

0xxxx coils · 1xxxx discrete inputs · 3xxxx input registers · 4xxxx holding registers
Address in the message = reference − table offset − 1 (40108 → 107)

The leading digit is a documentation convention, not part of the message. The message carries only the function code and the zero based address.

Worked example

Holding register 40108 is read with function code 03 at address 107 (0x006B).

Key insight: most "wrong value" problems on a new Modbus link are an off by one address. If every value looks shifted by one register, try address ± 1 before anything else.
Advertisement

Frequently Asked Questions

What is the difference between 40001 and address 0?

They are the same register. 40001 is the 1 based reference used in documentation; the message carries address 0 with function code 03.

When are 6 digit references used?

When a device has more than 9999 registers in a table: 400001 to 465536.

Which function code reads input registers?

Function code 04 reads input registers (3xxxx); 03 reads holding registers (4xxxx).

You May Also Like

Learn more on the blog

Modbus function codes explained

A practical, field focused guide on instrumentationblog.in that explains the theory behind this tool and how engineers apply it on real plants.

Read Full Article

More Communication Protocols

More Instrumentation Tools