External device setup manual – IDEC High Performance Series User Manual
Page 643

625
1 Modbus
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
Modb
us
External Device Setup Manual
- FC4 Read input registers - Reading of Input Register (IR) consecutively
- FC5 Write coil - Writing to a single Coil (C)
- FC6 Write single register - Writing to a single Holding Register (HR)
Data sequence of read value
The data sequence for the read value is similar to that of FC1 Read Coils.
Request
Byte 7
FC (Function code)=04
Byte 8-9
Reference No.
Byte 10-11
Number of read words (1 to 125 words)
Normal response
Byte 7
FC (Function code)=04
Byte 8
Number of bytes for the response (number of read words x 2)
From Byte 9
Read data
Abnormal response
Byte 7
FC (Function code)=84 (HEX)
Byte 8
Exception code 01 or 02
Example
Reading of IR300001 (1 word). The read value is 1234 (HEX).
04 00 00 00 01 => 04 02 12 34
Request
Byte 7
FC (Function code)=05
Byte 8-9
Reference No.
Byte 10
Write value (FF when write value is 1, and 00 when write value is 0)
Byte 11
Fixed value 00
Normal response
Byte 7
FC (Function code)=05
Byte 8-9
Reference No.
Byte 10
Write value (FF when write value is 1, and 00 when write value is 0)
Byte 11
Fixed value 00
Abnormal response
Byte 7
FC (Function code)=85 (HEX)
Byte 8
Exception code 01 or 02
Example
Writing of C1 (1 bit). The write value is 1.
05 00 00 FF 00 => 05 00 00 FF 00
Request
Byte 7
FC (Function code) = 06 (HEX)
Byte 8-9
Reference No.
Byte 10-11
Write data