Exception codes
| Code | Name | When the printer returns it |
|---|---|---|
| 01 | Illegal Function | Unsupported function code or MEI type. |
| 02 | Illegal Data Address | Unmapped register, part of an item, write to a read-only or unmapped coil or item, address range beyond 65535. |
| 03 | Illegal Data Value | Malformed request, bad quantity, invalid coil value, text that is not valid UTF-8, negative speed. |
| 04 | Server Device Failure | The write could not be carried out: missing counter, variable, printer, table row or label, text that does not match the mapping's pattern, missing action, or a failed signal write. |
As a rule of thumb:
- 02 is a mapping problem: wrong address, wrong length, or writing something that is not writable. Check the request against the mapping list.
- 03 means the printer rejected the value.
- 04 is a problem on the printer side. Look in the printer's log.
Every failed request is logged on the printer, with the function code, the exception code and the reason, for example:
Request failed (function 0x10, exception 2): partial write of register 0 (length 2)
Each distinct failure is logged once, so a PLC that repeats a bad request does not flood the log.
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Cannot connect | The Modbus server is disabled, or a firewall blocks port 502. Check Tools → I/O → Modbus on the printer. |
| Exception 02 on every read | Off-by-one address. See Addressing. |
| Exception 02 on a multi-register read | The read starts or ends inside an item, or crosses an unmapped address. Read whole items, or ask for reserved ranges to fill the gaps. |
| 32-bit values are wrong | Word order. See 32-bit values. |
| Text has its characters swapped in pairs | Byte order. See Strings. |
| A value is stuck at 65535 or 32767 | Saturation: use a 32-bit type. |
| An action runs only once | The coil latches. Write 0 before writing 1 again, see Action coils. |
| A label is selected over and over | The Select label item is in a cyclic write. Write it once per event. |
| A value reads 0 | The counter, variable or statistic it is mapped to does not exist. See the printer's log. |