Instruction Manual

7. Troubleshooting
303
Modbus
Example of exception response generation
(Sample query message using Read Input Status)
Field
Sample value
[Hex]
ASCII mode
character string
RTU mode
8 bits [Hex]
Header ‘:’ None
Slave address 03
H
‘0, ’ ‘3’ 03
H
Function code
02
H
‘0, ’ ‘2’ 02
H
Start address [H] 04
H
‘0, ’ ‘4’ 04
H
Start address (L) A1
H
‘A, ’ ‘1’ A1
H
Number of DIs [H] 00
H
‘0, ’ ‘0’ 00
H
Number of DIs (L) 14
H
‘1, ’ ‘4’ 14
H
Error check LRC (2 characters) CRC (16 bits)
Trailer CR/LF None
Total bytes 17 8
If input status 04A1H does not exist, the following exception response will be returned.
Sample exception response from a slave
Field
Sample value
[Hex]
ASCII mode
character string
RTU mode
8 bits [Hex]
Header ‘:’ None
Slave address 03
H
‘0, ’ ‘3’ 03
H
Function code
82
H
‘8, ’ ‘2’ 82
H
Exception code 02
H
‘0, ’ ‘2’ 02
H
Error check LRC (2 characters) CRC (16 bits)
Trailer CR/LF None
Total bytes 11 5
The exception response consists of the slave address field, function code field, and data field. In the slave
address field, the applicable slave address is set as in the slave address field of a “successful” response.
In the function code field, the function code in the query is set, and then the MSB (most significant bit of
the function code) of this field is set to 1. This allows the master to recognize that the message is not a
“successful” response, but an exception response. An exception code indicating the content of exception
is set in the data field.