The register map says Supply temperature: 40011. You type 40011 into your tool and get an error. You type 11 and get a number that looks almost right but drifts strangely. You type 10 and it finally matches the display. Welcome to the most common confusion in Modbus: the Modbus 40001 address versus address 0.
This guide explains what 40001 really means, how to convert any register number into the address sent on the wire, and how to tell whether a map counts from 0 or from 1. The method section uses real screenshots of ModLens and the free ModLens Sim.
What does the Modbus 40001 address mean?
40001 is not an address. It is a label that says "holding register number 1". The first digit names the table, the other digits count registers starting at 1. The Modbus frame itself only carries a function code and a zero-based address from 0 to 65535, so 40001 is sent as function code 03, address 0.
This notation comes from the original Modicon PLCs, where Modbus was born: one number gave both the memory area and the position. Most register maps and PLC manuals still use it, while most libraries and tools ask for the raw address.
The Modbus specification describes both worlds. In the MODBUS Application Protocol Specification (modbus.org), the data model has four blocks whose elements are "numbered from 1 to n", while "in a MODBUS PDU each data is addressed from 0 to 65535". The spec then sums it up: a data item numbered X is addressed in the PDU as X-1.
The spec's own examples show the shift:
| Spec example | Number used in the text | Address sent in the request |
|---|---|---|
| Read holding registers (03) | registers 108 to 110 | 0x006B = 107 |
| Read input registers (04) | input register 9 | 0x0008 = 8 |
| Write single register (06) | register 2 | 0x0001 = 1 |
| Read coils (01) | outputs 20 to 38 | 0x0013 = 19 |
So the off-by-one is not a bug: it is built into how Modbus has always been documented.
The four tables and their reference numbers
Each register type has its own prefix and its own function codes. Subtract the first reference of the table to get the wire address.
| Table | 5-digit reference | 6-digit reference | Read function | Write function | Wire address |
|---|---|---|---|---|---|
| Coils (read/write bits) | 00001–09999 | 000001–065536 | 01 | 05, 15 | reference − 1 |
| Discrete inputs (read-only bits) | 10001–19999 | 100001–165536 | 02 | none | reference − 10001 |
| Input registers (read-only 16-bit) | 30001–39999 | 300001–365536 | 04 | none | reference − 30001 |
| Holding registers (read/write 16-bit) | 40001–49999 | 400001–465536 | 03 | 06, 16 | reference − 40001 |
Two important details:
- The prefix is not sent. The 4 in 40001 only tells you to use function 03 (or 06/16 to write). Nothing in the frame says "4".
- The 5-digit style stops at 9999 registers per table. A device with registers above address 9998 cannot be described with 5 digits, so many vendors use the 6-digit style: 400001 is holding address 0 and 465536 is holding address 65535. If a map shows 6-digit numbers, subtract 400001, not 40001.
Worked conversions
| Number in the manual | Table | Calculation | Address (decimal) | Address (hex) |
|---|---|---|---|---|
| 40001 | Holding | 40001 − 40001 | 0 | 0x0000 |
| 40011 | Holding | 40011 − 40001 | 10 | 0x000A |
| 40108 | Holding | 40108 − 40001 | 107 | 0x006B |
| 41001 | Holding | 41001 − 40001 | 1000 | 0x03E8 |
| 30001 | Input | 30001 − 30001 | 0 | 0x0000 |
| 30013 | Input | 30013 − 30001 | 12 | 0x000C |
| 10005 | Discrete input | 10005 − 10001 | 4 | 0x0004 |
| 00017 | Coil | 17 − 1 | 16 | 0x0010 |
| 401025 | Holding (6-digit) | 401025 − 400001 | 1024 | 0x0400 |
For a whole register map, the free Modbus register converter does this in the browser, and it also decodes the hex and float values you read back.
What does 40001 look like on the wire?
A read of 40001 on unit 1 is the request 01 03 00 00 00 01 84 0A on Modbus RTU. Byte by byte:
| Bytes | Field | Value |
|---|---|---|
01 |
Unit ID (slave address) | 1 |
03 |
Function code | Read holding registers |
00 00 |
Starting address | 0, which is 40001 |
00 01 |
Quantity | 1 register |
84 0A |
CRC | Checksum of the five fields above |
On Modbus TCP, the same request starts with the 7-byte MBAP header (transaction ID, protocol ID 0, length, unit ID) and has no CRC: 00 01 00 00 00 06 01 03 00 00 00 01. The address field is the same 00 00.
If a Wireshark or serial capture shows 00 0A in the address field, the master is asking for address 10, which most manuals call 40011. When the integrator and the PLC programmer disagree, look at the bytes.
How do I know if my register map is 0-based or 1-based?
If the map uses 30001/40001-style numbers, it is 1-based: subtract. If it lists hex addresses or starts at 0, it is almost always the wire address already: use it as-is. The hard case is a map with plain decimal numbers starting at 1 and no prefix.
Clues to look for in the register map:
| What the map shows | Most likely meaning | What to type in a 0-based tool |
|---|---|---|
| 40001, 40002… or 4x0001 | 1-based reference, holding table | number − 40001 |
| 400001, 400002… | 1-based 6-digit reference | number − 400001 |
| 0x0000, 0x0001… (hex) | Wire address | the hex value converted to decimal |
| "Address 0", first row = 0 | Wire address | as listed |
| "Register 1", first row = 1, no prefix | Unclear: could be either | test both (see the method below) |
| "Offset" column next to a "Register" column | Offset = wire address | the offset |
Then check what your software expects. Most libraries (pymodbus, libmodbus, the Node-RED Modbus nodes, Home Assistant's Modbus integration) take the wire address. Some PC tools offer a "base 1" or "PLC address" option, and some drivers such as Kepware or TOP Server have a "zero-based addressing" setting that subtracts 1 for you. When that setting does not match the device, the same tag reads the register next door. Know which mode your tool is in before you trust a value.
PLC tags add a third layer. On many Schneider PLCs, word %MW0 is read at holding address 0 (40001), but other brands map their memory differently, and some add their own offset. Always check the PLC's Modbus server mapping page rather than guessing.
Step by step: finding the right address in ModLens
ModLens always asks for the wire address starting at 0 plus the table, and says so right under the read form. Here is the full method, using the ModLens Sim example device (unit 1, an AHU controller) as the "unknown" device. The simulator is free, so you can repeat every step on your own PC: see the Modbus simulator page.
Step 1: Read a block starting at address 0
Open Explorer, pick the device, set Unit ID 1, Table "Holding registers (4x)", Start address 0 and Count 12, then click Read. Reading a block instead of a single register is the key: you see the neighbours, so a one-register shift becomes obvious.

The screenshot shows what a real device looks like. Address 0 holds raw 144 (the supply air temperature ×10, so 14.4 °C). Address 1 decodes as a float32 ABCD of 22.14737 °C, the return air temperature. Addresses 5 to 9 are marked "doesn't exist on this device", and addresses 10 and 11 hold 65 and 140. In manual terms, these are 40001, 40002, 40011 and 40012.
Note the line under the form, outlined in red: "Addresses start at 0 (register 40001 = holding address 0, 30001 = input address 0)". The Start address help button gives the same rule and a tip for shifted values:

Step 2: Match one register you are sure about
Pick a point you can check without doubt, such as a setpoint or a fan speed command. Suppose the manual says Fan speed command = 40011 (%) and Supply temp setpoint = 40012 (°C ×10), and the controller display shows 65 % and 14.0 °C.
Set Start address 10, Count 2 and click Read:

Address 10 shows 65 and address 11 shows 140 (14.0 with scale 0.1). Both match the display, so the map is 1-based and wire address = reference − 40001 for this device. Now imagine you had typed 11 for the fan speed: you would read 140 and report a fan running at "140 %". No error, just a wrong value. That is why the off-by-one is dangerous.
Step 3: Check the input registers too
Some devices mix tables, and the input-register map can use a different rule from the holding map. Switch to unit 2 (the simulated power meter), Table "Input registers (3x)", Start address 0, Count 4:

The meter's voltage is a float32 in CDAB (word swapped) order at input address 0, which a manual would call 30001: it reads 230 V. The current reads 10 A at address 2 (30003).
Look closely at address 1: the float32 ABCD column also shows 230. That is a trap. Address 1 combined with address 2 happens to form the same float because the low word of both values is zero right now. If you had used address 1 with ABCD, the reading would look perfect today and go wrong the moment the voltage had decimals. More on this in the mistakes section, and in the float byte order guide.
Step 4: No map, or a map you don't trust? Search for the value
If you cannot find a register you are sure about, use Find a value. Type the value shown on the device display (here, the return air temperature 22.2 °C) and click Search. ModLens reads the range, tries every common format, byte order and scale, and lists the registers that decode to that value:

Two candidates come back: holding address 1, float32 ABCD = 22.21378 and holding address 0, float32 CDAB = 22.12528. The first is the real register (40002 in manual terms). The second is a "ghost" created by reading one register too early with the words swapped. Wait for the value to change (or change a setpoint), enter the new value and click Re-check candidates: only the real register keeps matching. The full search method is in how to find a Modbus register address.
Then click Make tag to save the register with its table, type and byte order.
Common mistakes with Modbus 40001 addressing
Most addressing faults fall into five patterns. Each has a clear symptom.
1. Typing 40001 into a field that wants the wire address
The tool sends address 40001 (0x9C41). Most devices answer exception code 02, illegal data address; a device with a large map may return a real register from far away, which is worse. Fix: subtract 40001. If you keep getting exception 02, the full checklist is in Modbus exception code 2 (illegal data address).
2. Subtracting twice
The map lists wire addresses (0, 1, 2…) but someone "corrects" them by subtracting 1 again, or the driver has a base-1 option switched on and the user typed the converted value. Symptom: every value is shifted by one, in the other direction. Fix: decide who does the conversion (the person or the software), never both.
3. A one-register shift that still looks right
16-bit values shifted by one show a neighbour's value, which is often plausible (a setpoint instead of a temperature). 32-bit values are trickier: as Steps 3 and 4 showed, a float read one register off with the opposite word order shares its high word with the real value, so it decodes to almost the same number. Symptom: the value is close to the display but lags, jumps or never quite matches. Fix: read a block, confirm with a value you can change, and re-check.
4. Using the holding prefix for an input register
The map says 30005, the integrator puts 40005 (or uses function 03 at address 4). Some devices mirror input registers into the holding table and it works; others answer exception 02 or return a different value. Fix: the prefix decides the function code. 3xxxx means function 04.
5. Mixing 5-digit and 6-digit references
A 6-digit reference like 400101 converted with the 5-digit rule gives 400101 − 40001 = 360100, which is not a valid address at all (the maximum is 65535). Fix: count the digits first. Six digits, subtract 400001.
Quick troubleshooting table
| Symptom | Most likely cause | First thing to try |
|---|---|---|
| Exception 02 on every read | Reference number typed as address | Subtract 40001 / 30001 |
| Values belong to the neighbour register | Off-by-one | Try address −1, then +1 |
| Float close to the display but not exact | One-register shift plus wrong byte order | Read a block, test all byte orders |
| Reads OK in one tool, shifted in another | Base-0 vs base-1 setting differs | Compare the tools' address options |
| Holding reads fine, inputs fail | Wrong function code for 3xxxx | Use function 04 |
| Huge address (over 65535) after conversion | 6-digit reference with 5-digit rule | Subtract 400001 |
A quick on-site routine
When you connect to a new device, this takes two or three minutes and saves hours:
- Read the map's notation: 5-digit, 6-digit, hex or plain numbers.
- Read a block of 10 to 20 registers starting at the converted address of the first point.
- Find one point you can verify on the display and one you can change (a setpoint).
- Change the setpoint on the device and confirm which address moves.
- Write the rule at the top of your integration sheet: "map is 1-based, wire = ref − 40001".
- Only then build all the points, and save them as tags so the rule is applied once.
For more on reading maps, scaling and data types, see how to read a Modbus register map. If you want to test the routine before site, the free 14-day ModLens trial has every feature, ModLens Lite stays free for basic reading and writing afterwards, and the ModLens Sim simulator is free too.
FAQ
Is Modbus register 40001 address 0 or address 1?
On the wire, 40001 is address 0 in the holding register table, read with function code 03. The Modbus specification numbers data items from 1 but addresses them in the frame from 0, so item X is sent as X−1. A few devices document their registers starting at 40001 but actually use the reference minus 40000; if values look shifted by one, test both.
How do I convert 40001 to a Modbus address?
Subtract 40001 from the reference number to get the holding register address. For example, 40108 becomes 107 (0x006B). Use 30001 for input registers, 10001 for discrete inputs and 1 for coils. For 6-digit references such as 400101, subtract 400001.
What is the difference between 40001 and 400001?
Both mean the first holding register, address 0. The 5-digit style can only count up to 9999 registers per table, so vendors with larger maps use the 6-digit style, which reaches 465536 (address 65535). Count the digits before you convert.
Why does my Modbus value look shifted by one register?
The map counts from 1 and your tool counts from 0, or the other way round, or a "base 1" option is converting a number that was already converted. Read a block of registers around the point and compare with a value you can see on the device display. If the right value sits one row away, adjust every address in your list by the same amount.
Does the 4 in 40001 get sent in the Modbus message?
No. The 4 only tells you which table to use, and that becomes the function code: 03 to read holding registers, 06 or 16 to write them. The frame carries the function code and a 16-bit address from 0 to 65535, nothing else.
What address do I type for 30001?
Type 0 and choose the input register table, which uses function code 04. 30002 is address 1, 30013 is address 12, and so on. If you read 30001 with function 03 instead, you are reading a holding register, which is a different table on most devices.
Why do I get illegal data address when reading 40001?
Your tool is probably sending 40001 as the address instead of 0, and the device has no register at 40001. Enter 0 with the holding register table instead. If you still get exception 02 at address 0, the device may not start its map at 0: read a small block at the first address listed in the manual.