Modbus Exception Code 03: Illegal Data Value

TROUBLESHOOTINGUpdated Feb 20267 min read

Exception Code 03 means your slave accepted the function code and the register address, but rejected the value you tried to write. The address exists, but the data isn't acceptable.

What It Means

This exception only occurs on write operations (FC05, FC06, FC15, FC16). The slave is telling you: "I know that register, I accept writes to it, but the value you sent isn't valid." This could mean the value is out of range, the wrong data type, or violates a device-specific constraint.

Common Causes

1. Value out of range

A setpoint register might only accept values between 0-1000, but you sent 5000. Or a mode register only accepts 0, 1, or 2, but you sent 5. The device's documentation should specify the valid range for each writable register.

2. Writing the wrong data type

If a register expects an unsigned 16-bit integer and you send a negative value (which would be valid as a signed INT16 but overflows as UINT16), the device may reject it.

3. Quantity mismatch

For FC16 (Write Multiple Registers), the quantity field must match the number of register values in the data payload. A mismatch triggers exception 03 on some devices (others return exception 02).

4. Device in wrong state

Some devices reject write operations when in certain states. For example, a drive might reject speed setpoint changes while in local mode, or a relay might reject trip commands when already tripped.

How to Fix It

Check the device documentation for the valid range of the register you're writing to. Start by writing a known-good value (like 0 or 1) to confirm the write mechanism works, then adjust to your desired value. If the device has operating modes, ensure it's in the correct mode to accept writes.

📋 Built-in Device Maps

Know your registers before you write

ModBus Pro includes 80+ built-in device register maps so you can see register descriptions and data types before writing. Understanding the expected format helps prevent exception 03 errors.

Download Free