Communication-capable Circuit Breakers
WL Circuit Breaker
Exception Responses
Except for broadcast messages, when a master device sends a query to a slave device, it expects a normal response. One of four possible events can occur from the master's query:
1.If the slave device receives the query without a communication error, and can handle the query normally, it returns a normal response.
2.If the slave does not receive the query due to a communication error, no response is returned. The master program will eventually process a timeout condition for the query.
3.If the slave receives the query, but detects a communication error (parity or CRC), no response is returned. The master program will eventually process a timeout condition for the query.
4.If the slave receives the query without a communication error, but cannot handle it (for example, if the request is to read a
The exception response message has two fields that differentiate it from a normal response:
Function Code Field: In a normal response, the slave echoes the function code of the original query in the function code field of the response. All function codes have a
Data Field: In a normal response, the slave may return data or statistics in the data field (any information that was requested in the query). In an exception response, the slave returns an exception code in the data field. This defines the slave condition that caused the exception.
Example:
Request Message to slave
The following is an example of a request to read Dataset 1 (Diagnostic Information) from a COM16 slave device at MODBUS address 7. Dataset 1 has 8 registers, but in this example, the Master tries to read just 6 registers.
07H | Slave Address |
03H | Function Code |
01H | Register Start Address “High” (Dataset 1 |
| address is 0100 hex) |
00H | Register Start Address “Low” |
00H | Quantity of Registers “High” |
06H | Quantity of Registers “Low” (6 registers is not |
| valid) |
xxH | CRC Check Code “Low” |
xxH | CRC Check Code “High” |
Reply Message from slave
The response returns the function code with the high bit set indicating an exception response. The Exception Code returned is 03 (Invalid Data Value). This exception code indicates that an illegal amount of data was specified for the requested Dataset.
07H | Slave Address |
83H | Function Code |
03H | Exception Code (Illegal Register Amount) |
xxH | CRC Check Code “Low” |
xxH | CRC Check Code “High” |
3/9
WL MODBUS Communication and Electronic Accessories • January 2005