Exception responses

If a Modbus slave receives a query message correctly (that is, it passes error checking), but cannot perform the required operation, the slave returns an exception response. This may happen, for instance, if the request is to read a non-existent register or coil.

An exception response message is formatted differently than a normal response, as it contains an exception code (instead of requested data). The format used is as follows:

  1. Its device address, confirming to the master that it is replying to the query.
  2. The function code, modified from the originally-requested function code by adding 80 hex to it (this signals the master to look for a following exception code, versus the originally-requested data).
  3. The exception code number. Refers to the exception code sent by the slave, which indicates why it was unable to deliver a normal response.

    The table lists standard Modbus exception codes (01-08) plus extended codes (09-13). The driver’s Modbus proxy points that reflect an exception response assume a fault status, and have a Fault Cause slot in the proxy extension that shows the name of the received exception code.

    Modbus exception codes, standard and extended

    Code Name Meaning
    01 ILLEGAL FUNCTION The function code received in the query is not an allowable action for the slave. For example, if a FORCE SINGLE COILS (05) is received by a slave without coils, this exception code would be issued.
    02 ILLEGAL DATA ADDRESS The data address received in the query is not an allowable address for the slave. For example, if a READ INPUT REGISTERS (04) with an input register address higher than contained in the slave is received, this exception code would be issued.
    03 ILLEGAL DATA VALUE A value contained in the query data field is not an allowable value for the slave. For example, if a PRESET SINGLE REGISTER (06) is received with an implied length that is incorrect, this exception code might be issued.
    04 SLAVE DEVICE FAILURE An unrecoverable error occurred while the slave was attempting to perform the requested action. For example, a READ HOLDING REGISTERS (03) is received on data that is deemed corrupted in the slave. The slave is still able to reply, however.
    05 ACKNOWLEDGE The slave has accepted the request and is processing it, but a delay is necessary before response is ready. Further polling of the slave may result in a rejected message response (06, next exception code).
    06 SLAVE DEVICE BUSY The slave is busy processing a long-duration query, or is otherwise occupied. This acknowledges to the master that the query has been received, but that the slave is too busy to respond to it.
    07 NEGATIVE ACKNOWLEDGE The slave cannot perform the requested function. An example might occur when attempting to write data in a holding register that is currently write disabled.
    08 MEMORY PARITY ERROR The slave attempted to read extended memory, but detected a parity error. A retry from the master may be successful, but the slave likely needs service.
    09 noResponse The slave is not responding to a particular query.
    10 (0A) crcError An error-checking CRC error has been detected.
    11 (0B) otherError The query has resulted in an uncategorized error.
    12 (0C) okNotActive No error/No operation. The normal status of a proxy point that is not configured to poll, or of a proxy point not yet written.
    13 (0D) unknown The slave has responded, but nothing else is known.
  4. An error-check field to confirm integrity of the message, as received from the slave. If the master detects an error in the response, the master ignores the message.