Blog

All Modbus Exception Codes (01–0B) and What to Do About Each

2026-11-07 · 13 min read Modbus errorsexception codestroubleshootinggateways

Short answer

A Modbus exception code is the one-byte reason a device sends back when it receives a request but refuses it; the reply has the function code plus 0x80 (03 becomes 0x83). The standard codes are 01 illegal function, 02 illegal data address, 03 illegal data value, 04 server device failure, 05 acknowledge, 06 server busy, 08 memory parity error, 0A gateway path unavailable and 0B gateway target failed to respond. An exception proves the link works, so check the request, not the wiring.

Your PLC, BMS or Modbus tool shows "exception 01", "0x83 / 2", "illegal data value" or "gateway target device failed to respond". Each of these is a Modbus exception code: a short, standard answer from the device that says why it refused your request.

This guide lists all Modbus exception codes from the official specification, explains each in plain English with the causes you meet on site, and shows a quick method to find the cause.


What is a Modbus exception response?

A Modbus exception response is the reply a device (server or "slave") sends when it received a valid request but cannot carry it out. It has two parts:

  1. The function code with its highest bit set. The device adds 0x80: 01 becomes 0x81, 03 becomes 0x83, 16 (0x10) becomes 0x90.
  2. One byte: the exception code, which says why.

A real Modbus RTU example. You ask unit 1 for one holding register at address 5, which does not exist:

Direction Bytes (hex) Meaning
Request 01 03 00 05 00 01 94 0B Unit 1, function 03, address 5, quantity 1, CRC
Exception response 01 83 02 C0 F1 Unit 1, function 0x83, exception code 02, CRC

On Modbus TCP the same 83 02 comes after the 7-byte MBAP header, with no CRC.

The MODBUS Application Protocol Specification V1.1b3 (free on modbus.org) is clear about what happens otherwise: if the device does not receive the request, or receives it with a communication error (parity, CRC), it sends nothing and the client times out. It only sends an exception when the request arrived intact but cannot be handled.

That is the key to troubleshooting: an exception proves the wiring, baud rate, parity and unit ID are working. Stop checking cables and look at the request.


Modbus exception codes list: the full table

These are all the codes in the current specification. Some tools show them in hex (0A, 0B), others in decimal (10, 11).

Code Name in the spec Plain meaning First thing to check
01 Illegal Function The device does not accept this function code Table (holding vs input), FC06 vs FC16
02 Illegal Data Address The address, or address + quantity, does not exist 40001 offset, gaps in the block
03 Illegal Data Value Something in the request is not allowed Quantity too large, refused write value
04 Server Device Failure Error inside the device while doing the request Device alarms, power cycle
05 Acknowledge Accepted, but it will take a long time Poll later (programming commands)
06 Server Device Busy Busy with a long command Slow down polling, retry
08 Memory Parity Error Extended file memory failed a check Only with functions 20/21
0A (10) Gateway Path Unavailable The gateway cannot route the request Gateway routing, unit ID config
0B (11) Gateway Target Device Failed to Respond Gateway got no answer from the serial device Unit ID, baud rate, RS-485 wiring

There is no 07 or 09 in the current specification (old Modicon documents listed 07 "Negative Acknowledge"; you will rarely see it).

Numbers like 129, 131 or 144 in a log are the exception function codes in decimal (0x81, 0x83, 0x90), not the reason. 131 = 0x83 = "a function 03 request failed"; the reason is in the next byte.


Exception vs timeout vs CRC error: which problem do you have?

Three different symptoms often get called "Modbus error". Sort them first.

Symptom What happened Where to look
Exception (01–0B) The device answered and refused The request: address, table, quantity, value
Timeout / no response Nothing came back in time Unit ID, wiring, baud rate, parity, IP, timeout
CRC / checksum error A reply came back corrupted Noise, termination, two masters, settings

Broadcast requests (unit ID 0) never get a reply, not even an exception. For the no-reply side, follow the Modbus timeout troubleshooting checklist.


Modbus exception code 01: Illegal Function

Exception code 01 means the device does not accept the function code you sent, or (per the spec) is not in a state to process it, for example not configured yet.

Causes on site:

  • Wrong table. Function 03 (holding) on a device that only has input registers (function 04), or the reverse. Some devices answer 01 here, others 02.
  • Function 06 not supported. Some devices only accept writes with function 16, even for one register.
  • No coils. Many meters have no coils or discrete inputs; functions 01, 02, 05 and 15 get 01.
  • Optional functions like 08 (diagnostics) or 43 (device identification) are often not implemented.

Fix: check the map ("3x"/"30001" = input registers, function 04; "4x"/"40001" = holding, function 03). For writes, try function 16.


Modbus exception code 02: Illegal Data Address

Exception code 02 means the start address, or the start address plus the quantity, is not valid on the device. It is the most common exception in the field.

The spec's example: a device with 100 registers accepts "start 96, quantity 4" but rejects "start 96, quantity 5", because address 100 does not exist. One missing register anywhere in the block is enough.

Usual causes: the off-by-one between 40001 and address 0 (see 40001 vs address 0), the wrong table, a SCADA block that crosses unused addresses, or a register missing in this firmware. Full step-by-step guide: Modbus exception code 2 (illegal data address).


Modbus exception code 03: Illegal Data Value

Exception code 03 means a value in the request is not allowed. In the specification it is about the structure of the request: quantity out of range, or a byte count that does not match. The spec says it does not mean a written value is outside what the application expects, but in practice many devices also use 03 for a refused write value. Treat both as possible.

Limits from the specification:

Function What it does Allowed quantity
01 / 02 Read coils / discrete inputs 1 to 2000
03 / 04 Read holding / input registers 1 to 125
05 Write single coil value 0xFF00 (ON) or 0x0000 (OFF) only
15 Write multiple coils 1 to 1968
16 Write multiple registers 1 to 123

Example: 01 03 00 00 00 7E C5 EA asks for 126 registers (0x7E), one too many. The answer is 01 83 03 01 31: exception 03.

Causes on site:

  • Block too large for this device. Many devices accept fewer than 125 registers per read (32, 64 or 100 are common).
  • Refused write value (device-specific): setpoint out of limits, an option number that does not exist, a 32-bit value written as one register.
  • Coil written with 0x0001 instead of 0xFF00 for ON.

Fix: read 10 registers first. If that works, find the device's maximum block size in its manual. For writes, check the range and data type in the map.


Modbus exception code 04: Server Device Failure

Exception code 04 means an unrecoverable error happened inside the device while it carried out a valid request.

It can be a real internal fault (memory, sensor module, option card), but some devices use 04 as a catch-all, for example for a write refused in local mode. Check the device alarms, try another register, power cycle if allowed, and read the manual's write conditions (remote mode, password, lock).


Exception codes 05 and 06: Acknowledge and Server Busy

Code 05 (Acknowledge) means the device accepted the request but needs a long time; the spec ties it to programming commands and sends it so the client does not time out. Code 06 (Server Device Busy) means the device is busy with a long command and the client should retry later.

You see them with PLCs during program downloads or slow controllers polled too fast. Fix: slower polling, a pause between requests, and retries.


Exception code 08: Memory Parity Error

Code 08 means the device found a consistency error in its extended file memory. It is only used with functions 20 and 21 (file records); the spec says retry, but the device may need service. A normal register read should never return 08, so if your BMS shows it on holding registers, check how the driver decodes replies.


Exception codes 0A and 0B: Gateway errors

These two come from a gateway (Modbus TCP to RTU converter, serial server, PLC routing requests), not from the end device.

Code 0A (10), Gateway Path Unavailable: the gateway cannot set up a path from its input port to its output port. Usually a misconfigured or overloaded gateway: no route for that unit ID, serial port disabled, too many connections.

Code 0B (11), Gateway Target Device Failed to Respond: the gateway sent your request on the serial side and got nothing back. Usual causes:

  • No device at that unit ID on the RS-485 bus.
  • Baud rate, parity or stop bits in the gateway do not match the device.
  • RS-485 wiring: A/B swapped, no common, missing termination, broken chain.
  • Device off, or gateway serial timeout too short for a slow device.

Timing tip: your client timeout must be longer than the gateway's serial timeout, or your client gives up before the 0B arrives and you see a plain timeout. Some gateways never send 0A/0B and simply stay silent. More in Modbus RTU over TCP vs Modbus TCP gateways and Modbus unit ID explained.


Step-by-step: find the cause of a Modbus exception with ModLens

The method works with any Modbus client. We show it in ModLens because it turns each exception into a plain sentence with a "What to try" list and re-reads a failing block address by address. The screenshots come from ModLens connected to the free ModLens Sim simulator, which answers like a real device: unknown addresses return 02, oversized requests return 03, unknown unit IDs stay silent.

The simulated main power meter is unit ID 2. Like many real meters, it has input registers only: voltage at address 0, current at 2, active power at 4 (float32, CDAB word order) and power factor at 6 (uint16, ×0.001).

Step 1: Read one register and read the exception text

Start with a single register: it removes block size and gaps from the picture. In the Explorer, choose unit ID 2, Holding registers (4x), start address 0, count 1, and click Read.

ModLens Explorer reading holding register 0 on unit 2: red box "Illegal data address: this register doesn't exist on the device" with a What to try list

The meter answers exception 02: "Illegal data address: this register doesn't exist on the device", with four checks below it: the 40001 offset, a smaller block, Scanner → Find registers, and the right table (holding 4x vs input 3x). Since a single register at address 0 fails, block size is not the cause: the offset or the table is.

Step 2: Change the table and read the block

Switch to Input registers (3x) and read 8 registers from address 0.

ModLens Explorer reading 8 input registers on unit 2: voltage 230 and current 10 in the float32 CDAB column, address 7 marked doesn't exist, status says 1 address(es) don't exist

The values are there. In the float32 CDAB column: 230 at address 0 (voltage), 10 at address 2 (current), 6.9 at address 4 (kW). Address 6 reads a raw 900: power factor 0.900 with the ×0.001 scale.

The status line says "1 address(es) don't exist". The block 0 to 7 included address 7, which the meter does not have, so the request came back with exception 02; ModLens then re-read address by address and marked only 7 as missing. In your SCADA, the fix is a block of 7 registers, not 8.

Green cells are a hint, not proof: 6.875429 (float32 ABCD, address 5) looks plausible but is half of the power value glued to the power-factor register. Compare with the meter display, or check a raw pair in the free Modbus register converter.

Step 3: Compare with a timeout

Change the unit ID to 9, where no device exists, and read again.

ModLens Explorer reading unit 9: red box "No response from unit 9 (timeout)" with a What to try list about unit IDs, single connection and timeout

No exception code this time: "No response from unit 9 (timeout)", and the suggestions are completely different (unit ID, another program holding the connection, timeout). An exception sends you to the register map; a timeout sends you to wiring and settings.

Step 4: Keep the meaning of each code at hand

Help → Troubleshooting in ModLens keeps the short version for site work: timeouts, codes 1, 2, 10 and 11, and the two "wrong value" problems that are not exceptions (wrong byte order, missing scale).

ModLens Help page, Troubleshooting card: timeout, illegal data address code 2, illegal function code 1, gateway errors codes 10 and 11, crazy values, values 10x too big, could not connect

Step 5: Adjust the device limits for codes 01, 03 and 06

When a device rejects big reads (03), function 06 writes (01) or fast polling (06), change the device limits once instead of every tag: Devices → Edit → Advanced: device limits.

ModLens Edit device window, Advanced device limits: Max registers per read 125, Max coils per read 2000, Pause between requests 0 ms, Always write with function 16 unchecked

The defaults follow the specification: 125 registers and 2000 coils per read. Lower "Max registers per read" to the manual's limit (ModLens then splits big reads), tick "Always write with function 16" for devices that answer 01 to function 06, and add a pause between requests for slow devices. Most SCADA and BMS drivers have the same settings under names like "block size". Every screen is described in the install and user guide.


Worked example: a meter behind a gateway

A technician polls an RS-485 energy meter through a Modbus TCP to RTU gateway. The BMS logs three different errors on the same day:

What the BMS shows Who sent it Conclusion
"Exception 0B" on every point Gateway Gateway reachable, meter silent on the serial side. Check unit ID, baud rate/parity in the gateway, A/B wiring.
After fixing the baud rate: "Exception 02" everywhere Meter Communication works. Points are holding registers; the meter uses input registers (30001 = input address 0).
After fixing the table: "Exception 03" on one group Meter The driver merged 60 registers into one request; this meter accepts fewer. Lower the block size.

Three codes, three layers: gateway, register map, block size. Reading the code first saved three wrong guesses.


Common mistakes with Modbus exception codes

  • Checking wiring for an exception. Any code from 01 to 06 means the device answered.
  • Reading 0x83 as the error. It only says "function 03 failed"; the reason is the next byte.
  • Mixing up 0B (11 decimal) and 0x11. 0x11 (17) is a function code (report server ID), not an exception.
  • Testing with large blocks first. One register at a known address tells you more than five failed 100-register reads.
  • Assuming every device follows the spec. Some return 02 where you expect 01, or 04 for everything. The device manual wins.

You can try every step on your laptop before going to site: install ModLens with the free 14-day trial key and run the free ModLens Sim, which produces real exceptions on demand. Licences are on the pricing page.


FAQ

What is a Modbus exception code?

A Modbus exception code is a one-byte number a device sends back when it received a request correctly but refuses to carry it out. The reply contains the original function code plus 0x80, then the exception code. The standard codes are 01, 02, 03, 04, 05, 06, 08, 0A and 0B.

What is the most common Modbus exception code?

Exception code 02, illegal data address. It usually comes from an off-by-one address (40001 sent as 1 instead of 0), the wrong register table, or a block that includes an address the device does not have. Read one register alone to find the cause quickly.

What does Modbus exception code 3 mean?

Exception code 03, illegal data value, means a value in the request is not allowed. Most often the quantity is too large (more than 125 registers, or more than the device's own limit), or a written value is refused. Read a smaller block and check the allowed range of the register you write.

What does Modbus exception code 4 mean?

Exception code 04, server device failure, means the device had an unrecoverable error while carrying out a valid request. Check its alarms and diagnostics, try another register, and power cycle it if allowed. Some devices also use 04 for writes refused because of local mode or a parameter lock.

What does Modbus exception code 11 (0B) mean?

Exception code 11 (0B hex), gateway target device failed to respond, means a gateway forwarded your request to its serial side and got no answer. The network link to the gateway is fine. Check the unit ID, the gateway's baud rate, parity and stop bits, the RS-485 wiring and the gateway serial timeout.

Is a Modbus exception a communication error?

No. An exception is a complete, valid reply, so the physical link and the unit ID are working. Communication errors show up as timeouts or CRC errors, because a device that receives a corrupted frame stays silent. With an exception, fix the request: address, table, quantity or value.

Why does my software show exception 131 or 0x83?

131 decimal is 0x83 hex, the exception function code for a function 03 request (03 + 0x80). It is not the reason for the failure. The real exception code is the byte that follows, for example 02 for illegal data address or 03 for illegal data value.