Modbus Exception Codes & Error Handling Reference

Complete reference for Modbus exception codes (01–0A), error response format, diagnostic function codes, and troubleshooting guide for common exception scenarios in RTU and TCP integrations.

Categories:

Overview

When a Modbus device cannot process a request, it returns an exception response instead of the expected data. The exception response contains an error code that identifies what went wrong — but only if you know how to read it.

Exception responses are the Modbus protocol’s only error reporting mechanism. Understanding them is essential for diagnosing addressing errors, unsupported function codes, and device-specific limitations during gateway configuration and commissioning.

This guide covers all standard exception codes, the response frame format, and practical troubleshooting for each error condition.

Exception Response Format

A normal Modbus response echoes the function code from the request. An exception response modifies the function code by setting the high bit (adding 0x80), then appends a one-byte exception code:

Modbus RTU Exception Frame

FieldSizeNormal ResponseException Response
Slave Address1 byte0x010x01
Function Code1 byte0x03 (Read Holding Registers)0x83 (0x03 + 0x80)
DataN bytesRegister valuesException code (1 byte)
CRC2 bytesCRC-16CRC-16

Modbus TCP Exception Frame

FieldSizeNormal ResponseException Response
MBAP Header7 bytesTransaction ID + Protocol + Length + Unit IDSame
Function Code1 byte0x030x83
DataN bytesRegister valuesException code (1 byte)

[!TIP] When viewing a Modbus packet capture, look for function codes above 0x80. If you sent FC 0x03 and received 0x83, the device rejected the request. The byte following the function code tells you why.

Exception Codes Reference

Standard Exception Codes

CodeHexNameDescription
010x01Illegal FunctionThe function code in the request is not supported by the device
020x02Illegal Data AddressThe register or coil address in the request does not exist on the device
030x03Illegal Data ValueThe value in the request is outside the acceptable range for the target register
040x04Server Device FailureAn unrecoverable error occurred while the device was processing the request
050x05AcknowledgeThe device accepted the request but needs extended time to process it (long-running operation)
060x06Server Device BusyThe device is processing a long-duration command — retry the request later
070x07Negative AcknowledgeThe device cannot perform the programming function specified in the request
080x08Memory Parity ErrorThe device detected a parity error in its internal memory (extended file area)
0A0x0AGateway Path UnavailableThe gateway could not establish a connection to the target device
0B0x0BGateway Target Device Failed to RespondThe target device behind the gateway did not respond within the expected time

Exception Code Frequency in Integration Projects

Based on Chipkin’s support data across 437+ Modbus FSE projects:

CodeFrequencyTypical Root Cause
02 (Illegal Data Address)~50% of all exceptionsOff-by-one addressing error, wrong register convention
01 (Illegal Function)~25%Using FC03 when device only supports FC04, or vice versa
0B (Gateway Target Failed)~10%Slave ID wrong, device offline, wiring issue
04 (Server Failure)~8%Device firmware bug or internal fault
03 (Illegal Data Value)~5%Writing out-of-range value to setpoint register
Others~2%Rare in field installations

Exception Code 02: Illegal Data Address (Most Common)

This is the #1 exception code encountered in Modbus integration — responsible for roughly half of all exception responses in gateway projects.

Common Causes

CauseSymptomFix
Off-by-one addressingRequest for register 40001 returns exception 02Try register 40000 (0-based) — see Modbus Addressing & Register Reference
Wrong register conventionAll registers return exception 02Verify whether the device uses Modicon (1-based) or PDU (0-based) addressing
Register doesn’t existSome registers work, specific ones failCheck the device register map for valid address ranges
Register count too largeReads of 1–10 registers work, larger reads failReduce the register count per request (max 125 for FC03/FC04)
Wrong function code for address rangeFC03 for addresses that require FC04Some devices split data across holding registers (FC03) and input registers (FC04)

[!WARNING] The addressing convention (0-based vs 1-based) varies by device manufacturer. A register listed as 40001 in the documentation might be address 0 in the PDU (0-based) or address 1 (1-based). Always verify with a single known register before building the full point map. See How to Read a Modbus Register Map for step-by-step guidance.

Diagnostic Steps

  1. Test a single known register — pick one register from the manufacturer documentation that you know exists
  2. Try both address conventions — if register 40001 fails, try addresses 0 and 1
  3. Verify the function code — try FC03 (holding registers) and FC04 (input registers)
  4. Reduce register count to 1 — eliminate count-related failures
  5. Check slave ID — some devices respond to the wrong address with exception 02 instead of silence

Exception Code 01: Illegal Function

The device does not recognize or support the requested function code.

Common Causes

CauseSymptomFix
Device only supports readWrite commands (FC05, FC06, FC16) return exception 01Verify the device’s supported function codes — some devices are read-only
FC03 vs FC04 confusionFC03 returns exception 01 but FC04 works (or vice versa)Check which function codes the device supports for each register range
Advanced function codeFC23 (Read/Write Multiple) returns exception 01Not all devices support advanced function codes — fall back to FC03 + FC16
Diagnostic function codeFC08 returns exception 01Diagnostic function codes are optional and rarely supported on field devices

[!TIP] When encountering exception 01, request the device’s supported function code list from the manufacturer. Most Modbus devices support only FC01–FC06 and FC15–FC16. Advanced codes (FC08, FC17, FC20–FC24, FC43) are uncommon in building automation equipment.

Exception Codes 0A and 0B: Gateway Errors

These codes are specific to gateway devices — they indicate a problem between the gateway and the downstream target device, not a problem with the Modbus request itself.

CodeMeaningRoot CauseFix
0A (Path Unavailable)Gateway cannot route to the targetWrong slave ID, target network unreachable, routing table misconfiguredVerify slave ID and gateway routing configuration
0B (Target Failed to Respond)Gateway reached the target but got no responseDevice offline, wrong baud rate, wiring fault, device not at expected addressCheck serial connection to downstream device, verify baud rate and wiring

[!NOTE] Exception 0B through a Modbus TCP gateway often means the gateway successfully received your TCP request but the serial-side Modbus RTU device is not responding. Troubleshoot the serial connection, not the Ethernet connection. See the Modbus Troubleshooting Guide for serial diagnostic procedures.

CodeMeaningAction
05 (Acknowledge)Device accepted the request but is still processingWait and poll again — the device will respond when complete. Do not resend the request.
06 (Server Busy)Device is busy with a previous operationRetry after a delay (typically 1–5 seconds). If persistent, the device may be overloaded with requests.

These exceptions are uncommon in normal read operations. They typically occur during:

  • Firmware updates via Modbus file transfer
  • Configuration writes to non-volatile memory
  • Calibration operations that require hardware settling time

[!TIP] If you receive persistent exception 06 responses, reduce the polling rate. Some slower devices (older PLCs, embedded controllers) cannot handle rapid sequential requests — add a 50–100ms inter-request delay in the gateway configuration.

No Response (Silence) vs Exception Response

The most confusing diagnostic scenario: the device returns nothing at all.

BehaviorMeaningCommon Cause
Exception responseDevice heard the request, understood the framing, but rejected the contentAddressing error, unsupported function code
No response (timeout)Device either didn’t hear the request or doesn’t exist at that addressWrong slave ID, baud rate mismatch, wiring fault, device powered off
Broadcast (address 0)Request sent to all devices — no response expected by protocolNormal behavior for broadcast writes

[!CAUTION] No response is worse than an exception response. An exception at least confirms the device is on the network and responding. Complete silence means you need to verify the physical layer first — see the Modbus RTU Pre-Commissioning Checklist for serial verification steps.

Capturing Exception Responses

Modbus RTU (Serial)

Use the CAS Modbus Scanner or any Modbus diagnostic tool to send test requests and observe responses. Exception responses appear as error codes in the tool’s response pane.

Modbus TCP (Ethernet)

Use Wireshark with the mbtcp display filter:

mbtcp.modbus.func_code >= 0x80

This filter shows only exception responses, making it easy to identify which requests are failing.

For specific exception codes:

mbtcp.modbus.exception_code == 2

This filters for Illegal Data Address (02) exceptions only.

Chipkin Tools

Need more help?

If this page does not resolve the issue, contact Chipkin support with the product model, protocol details, and any diagnostics you have already captured.

Open Chipkin Support