Modbus Register Addressing: 40001 vs Offset 0 Explained

The 4xxxx number is a documentation convention. The wire carries a zero-based offset, and the function code picks the table.

40001

Offset 0, FC03

40108

Offset 107, 0x006B

Tables

0x, 1x, 3x, 4x

On the wire

16-bit offset

Short answer: 40001 is offset 0

Is 40001 address 0 or 1? It is address 0. In 5-digit convention, 40001 is the first holding register, sent as address 0 with function code 03 (FC03). The leading 4 names the holding-register table and is never on the wire.

A meter, VFD, or PLC map that says 40108 is the same table, 107 places past the start. Subtract 40001. 40108 becomes 107, hexadecimal 0x006B. The Modbus Application Protocol FC03 example uses 0x006B for register 108. Those bytes are 107 decimal, not 108. Register 108 in that 1-based count is reference 40108, and the PDU address is 107.

If the client field says "address" and you type 40108, the request misses the point in the manual. You read the wrong value, or the device returns exception 02 because that address is not in its map. The worked frames later on this page paste straight into the Modbus RTU parser and the Modbus TCP parser.

Four data tables (0x/1x/3x/4x)

Modbus documentation sorts data into four tables. The familiar prefixes are 0x, 1x, 3x, and 4x. There is no 2x table in this convention. The prefix is a name printed in the manual. It tells you which function code to use. It is not a byte in the request.

Four Modbus data tablesThe prefix picks the function code. Only the zero-based offset is sent.0xCoilsFC 01Read/write bits00001is offset 0prefix not sent1xDiscreteFC 02Read-only bits10001is offset 0prefix not sent3xInput regsFC 04Read-only words30001is offset 0prefix not sent4xHoldingFC 03Read/write words40001is offset 0prefix not sentjustprotocols.com
0x, 1x, 3x, and 4x name four tables. Function codes 01, 02, 04, and 03 select them. The address field starts at 0 for each table.
PrefixTableRead functionWhat it holdsFirst reference is offset
0xCoils01 (0x01)Single bits, read and write0
1xDiscrete inputs02 (0x02)Single bits, read only0
3xInput registers04 (0x04)16-bit words, read only0
4xHolding registers03 (0x03)16-bit words, read and write0

Holding vs input, coils vs discrete

Holding registers (4x) and input registers (3x) are both 16-bit words. The difference on the wire is the function code, not a special address format. Holding uses FC03. Input uses FC04. Coils (0x) and discrete inputs (1x) are both single bits. Coils use FC01. Discrete inputs use FC02. The prefix picks the function code. Only the zero-based address is sent.

Offset 0 is not one shared place in the device. Offset 0 with FC03 is the first holding register, written 40001 in 5-digit notation. Offset 0 with FC04 is the first input register, written 30001. The same numeric offset can exist in more than one table. A manual entry of 30108 and a manual entry of 40108 both become offset 107, and the function code is what keeps them apart.

Reference vs PDU (prefix never sent)

The reference is the number in the manual, the spreadsheet, or the faceplate. The PDU address is the 16-bit field that follows the function code. Build the offset by subtracting the base for that table:

  • 0xxxx: subtract 1. The 6-digit base is 000001, and the offset is still reference minus 1.
  • 1xxxx: subtract 10001, or 100001 in 6-digit form.
  • 3xxxx: subtract 30001, or 300001 in 6-digit form.
  • 4xxxx: subtract 40001, or 400001 in 6-digit form.

40108 minus 40001 is 107. 107 in hexadecimal is 0x006B. You can confirm that step in the hex converter. The digit 4 does not appear as its own byte. If the client subtracts 40000 instead of 40001, 40001 becomes 1 and every later point is one high. That is the off-by-one.

Reference vs wire: 40108MANUAL REFERENCE401084 names the table0108 is 1-based inside it40108 - 40001 = 1074 not sentPDU ADDRESS FIELD0300 6B00 01FC03offset 107quantity0x006B is register 108justprotocols.comThe digit 4 is never its own byte. Sending 40108 as the address field targets a different register.
Reference 40108 becomes PDU address 0x006B (107) with function code 03. The Modbus Application Protocol FC03 example uses 0x006B for register 108.

Worked example: 40108 to offset 107

The table digit in 40108 is 4, so the read function is 03 and the address field is 0x006B. The Modbus Application Protocol FC03 example uses 0x006B for register 108. Sending 108 (0x006C) reads the next register. Sending 40108 itself puts 0x9CAC in the address field.

This request reads one holding register at that offset from device address 1. The CRC-16 of 01 03 00 6B 00 01 is F5 D6, low byte first. Paste the full line into the RTU parser and the CRC checker.

Request (device 1, FC03, offset 107, quantity 1)

01 03 00 6B 00 01 F5 D6
01 = Device address 103 = Read Holding Registers00 6B = Offset 10700 01 = Read 1 registerF5 D6 = CRC-16, low byte first

A normal FC03 response echoes function 03, a byte count, and one 16-bit word per register. If the address or the span is not valid, the response uses function 0x83 and exception code 0x02. The Modbus RTU guide shows a full exception frame of that shape.

The same request over TCP

Modbus TCP carries the same PDU. An MBAP header sits in front, and there is no CRC, because TCP already checks the packet. The length field counts the unit id plus the PDU. Here that is 6 bytes. Transaction id 1 below is an example header, not part of the FC03 address example. Paste it into the Modbus TCP parser.

TCP request (MBAP transaction 1, unit 1, same PDU)

00 01 00 00 00 06 01 03 00 6B 00 01
00 01 = Transaction ID 100 00 = Protocol ID00 06 = 6 bytes follow01 = Unit ID 103 = Read Holding Registers00 6B = Offset 10700 01 = Quantity 1

5-digit vs 6-digit

5-digit references give each table numbers such as 00001 through 09999 and 40001 through 49999. The first number is offset 0, so 49999 is offset 9998. That span does not cover a full 16-bit address space.

6-digit references add a digit so the offset can run from 0 through 65535. The first holding register is 400001, not 40001. 400001 plus 107 is 400108, the same point as 5-digit 40108, and the wire address is still 0x006B. Subtract 400001. Subtracting 40001 from a 6-digit number produces an offset that does not fit in 16 bits.

Point5-digit6-digitOffsetHex
First holding register4000140000100x0000
Register 108 in the FC03 example401084001081070x006B
Last 5-digit holding reference4999940999999980x270E
Last 16-bit holding offsetnot in 5-digit form465536655350xFFFF

Mixing the widths is a large error, not an off-by-one. 40108 as a 6-digit reference sits below the 400001 base. 400108 minus 40001 is 360107, which does not fit in 16 bits. Read the width off the map before you subtract.

Off-by-one

Doc and client use different conventions (1-based vs 0-based). The manual counts the first holding register as 40001, or sometimes just calls it register 1 or register 108. The PDU counts the first one as 0. Adjust by one, or toggle the zero-based or offset setting, and confirm against a known value.

If the client field is a raw address, enter the offset: 0 for 40001, 107 for 40108. If the field is labeled as a 40001-style reference, enter 40108 and let that client subtract. Two subtractions, or none, are how a correct map still reads the neighbor. 0x006C is offset 108, one past the FC03 example's 0x006B.

What you seeWhat to check
The value is the neighbor of the point in the manual.1-based vs 0-based. 40108 is offset 107, not 108. Someone subtracted 40000, or sent the 1-based register number.
Exception 02, and the point is listed in the manual.The PDU may contain the reference. 40108 on the wire is 0x9CAC, not 0x006B. Or the quantity runs past the last register the device actually has.
Zeros, or a value from the wrong list in the map.Function code. Holding is FC03 (4x). Input is FC04 (3x). Coils are FC01. Discrete inputs are FC02.
A 32-bit number looks scrambled, while nearby 16-bit words look plausible.Byte or word order. That is separate from the 40001 offset. Fix the address first, then check order on a known 32-bit value.
The miss is huge, not one register.5-digit and 6-digit bases were mixed. 40108 and 400108 are the same offset only when you subtract the matching base.

Address and offset converter

The converter turns a reference into an offset, or an offset back into a reference, and builds a read request for the parsers. It starts on the worked example: holding, 5-digit, 40108, device 1, quantity 1. Change the table for 0x, 1x, or 3x, and the width for 400001. The RTU line includes CRC-16. The TCP line reuses the PDU behind an example MBAP header, transaction id 1.

Notation

Convert

Reference
40108
Offset
107 (0x006B)
Read function
FC 03 Read Holding Registers

RTU request (paste into the parser)

01 03 00 6B 00 01 F5 D6

CRC-16 is the last two bytes, low byte first. Transaction bytes are not part of RTU.

TCP request (example MBAP transaction 1)

00 01 00 00 00 06 01 03 00 6B 00 01

Same PDU as the RTU frame. The 7-byte MBAP header replaces the CRC. Length counts the unit id plus the PDU.

Checklist before blaming the device

  1. Read the map's numbering. 5-digit bases are 00001, 10001, 30001, and 40001. 6-digit bases are 000001, 100001, 300001, and 400001.
  2. Subtract that base. The result is the only address that goes in the PDU. Do not send the prefix.
  3. Pick the function code from the prefix. A 3xxxx reference is an input register (FC04), not an FC03 read.
  4. Set any zero-based or offset toggle so a known reference leaves as the offset you calculated.
  5. Check the quantity. An off-by-one at the end of a short map makes the range illegal and returns exception 02 even when the start point exists.
  6. Paste the request into the RTU parser or the TCP parser, and confirm an RTU CRC in the CRC checker, before you call the device failed. The map number and the wire number are different by design.

FAQ

Is 40001 the same as register 0?

Yes. In 5-digit convention, 40001 is the first holding register, sent as address 0 with FC03. The leading 4 names the table and is never on the wire. Subtract 40001 from the reference (40108 → 107 / 0x006B).

Why off by one?

Doc and client use different conventions (1-based vs 0-based). Adjust by one or toggle zero-based/offset setting; confirm against a known value.

What do 0x/1x/3x/4x mean?

Prefixes for coils, discrete inputs, input registers, holding registers. Prefix picks FC (01/02/04/03); only zero-based address is sent.

What does 6-digit 400001 mean?

400001 is the 6-digit form of the first holding register. It is still offset 0 with FC03. The extra digit covers offsets past the 5-digit span, through 65535. Subtract 400001, not 40001. 400108 is the 6-digit name for the same point as 40108, offset 107, address 0x006B.

Why exception 02 when the register is in the manual?

Exception 02 means the address, or the range starting there, is not valid on that device. A common cause is placing the documentation number in the PDU. 40108 on the wire is address 0x9CAC, not offset 107 (0x006B). The same exception appears when the quantity runs past the last register, which an off-by-one at the end of the map will do. The function code has to match the table too: FC03 reads holding registers, and FC04 reads input registers.

Try it in the parsers

Copy 01 03 00 6B 00 01 F5 D6 into the RTU parser and the CRC checker. The starting address should show 107 (006B). Copy 00 01 00 00 00 06 01 03 00 6B 00 01 into the TCP parser and look for that same address after the MBAP header. If those bytes match what you send and the device still returns exception 02, the point is outside that map or the quantity is too long.

Open a frame in a tool

The starting-address field should read 107. The CRC checker recomputes the RTU checksum. The hex converter shows 107 as 0x006B.

Related protocols

  • Modbus RTU: serial framing, the holding-register example at address 0, and exception 02.
  • Modbus TCP: the same PDU with an MBAP header, including an illegal-address error on Ethernet.