92
6 Useful Functions
92
Useful Functions
Chapter
6
■ Error responses
The slave device returns an error response without executing the command when a request from the
master contains a failure. The value used for the function code is the requested function code with 0x80
added to it.
Exception code is judged after the received frame.
The priority of the exception code judgment is 1→3→2.
Exception code = 01
A function code that does not exist has been specified.
Confirm the function code.
Exception code = 02
An address that cannot be used has been specified.
- Confirm the start address or the start address + (the number of coils, statuses or registers).
(Function codes 1 to 6, 15 and 16)
- Confirm that the start address is at the HI position of the 32-bit variable, or the start address +
number of registers includes the LO position of 32-bit.
(Funct
ion codes 3, 6 and 16)
Exception code = 03
Specified data is out of range.
- Confirm that the number of coils, statuses or registers are within readable range.
(Function codes 1 to 4)
- Confirm that the output value is 0x0000 or 0xFF00.
(Function code 5)
- Confirm that the output value is from 0x0000 to 0xFFFF,
or that they are not specified within start address 54.
(Function code 6)
* 32-bit variables cannot
be written with function code 6.
- Confirm that the number of coils or registers is within range.
(Function codes 15 and 16)
- Confirm that the number of bytes can be obtained from the number of coils or registers.
(Function codes 15 and 16)
- Confirm that the total number of bytes for the transmitted format is correct.
(Function codes 1 to 6, 8, 15 and 16)
Exception code No.
1 Function code error
2 Address out of range error
3 Data value error