Modbus Address 40001 vs 0: Register Numbering Explained

Your meter's manual lists voltage at 40001, your software asks for an address, and the value you get belongs to the register next door. Here is what the numbers mean and how to get the right one first time.

Updated · Gixtronix Technologies

The short answer

40001 is holding register number 1, which is protocol address 0. The leading 4 is not part of the address; it tells you which table to read (holding registers, function code 03). To get the address a Modbus client sends on the wire, subtract 40001 from a holding register reference, 30001 from an input register, 10001 from a discrete input and 1 from a coil.

So 40001 is address 0, 40013 is address 12 and 30101 is input register address 100.

Why there are two numbering schemes

The Modbus specification numbers the items in each table from 1, but addresses them from 0 in the actual request: item number N is sent as address N − 1. Modicon, who created Modbus, also put the table in front as a digit, which gave the familiar 0xxxx, 1xxxx, 3xxxx and 4xxxx references. Device manuals still use that notation; most Modbus software asks for the 0-based protocol address and a separate register type.

Manual referenceTableFunction codeContentsProtocol address
00001–09999Coils01Read/write bits0–9998
10001–19999Discrete inputs02Read-only bits0–9998
30001–39999Input registers04Read-only 16-bit words0–9998
40001–49999Holding registers03Read/write 16-bit words0–9998

Six-digit references such as 400001–465536 mean the same thing with room for all 65,536 addresses: 400001 is holding register address 0.

How to tell which scheme your manual uses

  • Addresses like 40001, 30001 or 400001: 1-based references. Subtract the table's base.
  • "Holding register 0", "HR 100" or hex such as 0x0064: usually already the protocol address. Enter it as is.
  • A bare "register 1" with no prefix: ambiguous. Read address 1 and address 0 and see which one matches the value on the device's display.
  • Some manuals print both, often as "Address (Decimal)" and "Register". Use the 0-based column.

Symptoms of an off-by-one

  • The value is plausible but belongs to the neighbouring parameter, such as current where you expected voltage.
  • A 32-bit value reads as nonsense because you are reading its second half.
  • The last register in the map returns exception code 02 (Illegal Data Address), because you asked for one past the end.

The fastest check is to compare a live value against the device's own display. If the address one lower matches, your manual is 1-based.

The address is right but the number looks wrong

A holding register is a 16-bit word. Devices fit real-world values into it in a few standard ways, and each one has a quick fix:

  • Scaled integers: 2345 means 234.5 V because the manual says "× 0.1". Multiply by the factor the manual gives.
  • Signed values: a temperature of −10 arrives as 65,526, because the register holds a signed 16-bit number and the client reads it unsigned. Subtract 65,536 from anything above 32,767.
  • 32-bit floats and long integers: these span two consecutive registers, and vendors disagree on which word comes first. Read both halves and combine them in the documented word order.
  • Text such as a serial number: packed two ASCII characters per register across several consecutive registers.

Doing it in SignalStream Studio

In Studio's Modbus wizard, pick the register type (Holding, Input, Coil or Discrete Input) and type the 0-based protocol address: 40013 becomes Holding, address 12. Test Poll reads the device live before you can save, so a shifted address shows up immediately.

For a scaled value, set Scaling m to the manual's factor, such as 0.1. For a signed value, put this in the Formula field:

x - 65536 if x > 32767 else x

Text spread across registers is read with the String value type and a register count. Studio currently reads one 16-bit register per numeric input, so 32-bit floats that span two registers are not supported yet.

Frequently asked questions

Is Modbus address 40001 the same as 0?

Yes, for holding registers. 40001 is the 1-based reference used in device manuals; the request a client sends uses address 0 with function code 03.

What is the difference between 40001 and 400001?

None in meaning. The six-digit form leaves room for all 65,536 addresses in a table. 400001 and 40001 both refer to holding register address 0.

Why does my device return exception code 02?

Exception 02 is Illegal Data Address: the device does not implement the register you asked for. The usual causes are an off-by-one at the end of the map, the wrong register type, or a gap in the device's register map.

Should I use holding or input registers?

Whichever table the manual lists the value in. Input registers (3xxxx) are read-only measurements; holding registers (4xxxx) are read/write and often hold both settings and measurements. Reading the wrong table usually returns exception 02 or an unrelated value.

Does the unit ID change the address?

No. The unit (slave) ID picks which device answers on a serial line or gateway. The register address is the same on every unit.

See your Modbus values live in minutes.

SignalStream Studio is free forever on one Windows PC and only reads, so it is safe on production. How the Modbus connector works →