External device setup manual – IDEC High Performance Series User Manual
Page 642
Chapter 5
624
External Device Setup Manual
- FC2 Read discrete inputs - Reading of Input Relay (I) consecutively
Data sequence of read value
When two or more data are read out, the read data are arranged starting from the lowest address by 8 bits (1 byte). Within any 1
byte, data in the lower address is set to the lower bit. The data in the unread bit becomes “0”.
For example, when reading an 11-bit data as shown below, the read value becomes 21 03.
Address
Data
Remarks
C 1
1
Data for the 1st byte
Bit pattern= 00100001 = 21 (HEX)
C 2
0
C 3
0
C 4
0
C 5
0
C 6
1
C 7
0
C 8
0
C 9
1
Data for 2nd byte
Bit pattern 00000011 = 03 (HEX)
C 10
1
C11
0
Request
Byte 7
FC (Function code)=02
Byte 8-9
Reference No.
Byte 10-11
Number of read bits (1 to 2000 bits)
Normal response
Byte 7
FC (Function code)=02
Byte 8
Number of bytes for the response ((number of read bits+7)/8)
From Byte 9
Read data
Abnormal response
Byte 7
FC (Function code)=82 (HEX)
Byte 8
Exception code 01 or 02
Example
Reading of I100001. 1 bit. The read value is 1.
02 00 00 00 01 => 02 01 01