−24−
6.5 Function Code
Responses by function code are given below. (See Table 2. Function code table in Section 6.3.2)
Note) See Section 6.6 for responses in abnormal status.
6.5.1 Read digital parameter (read coil status)
[Function code: 01 (01H)]
The specified number of “digital (ON/OFF) parameters” are read out consecutively commencing with
the designated Reference No. For ON/OFF data, 8 Reference Nos. are placed in each data (1 byte)
sequentially in number to constitute the response message data. The LSB (D0 side) of each data
becomes the digital data with the smallest number. If the number of Reference No. is anything other
than a multiple of 8, an unnecessary bit becomes 0.
Example) Reading 1 Reference Nos. 101of digital parameters for the slave unit 2.
Reference No
101
Data OFF
AT
stop
(RTU mode)
Master
→
Instruments Instruments
→
Master (normal)
Slave address
02H
Slave address
02H
Function code
01H
Function code
01H
Start No. (H)
00H
No. of data
01H
Start No. (L)
64H
1st 8 data
00H
Number of Reference No. (H)
00H
CRC (L)
51H
Number of Reference No. (L)
01H
CRC (H)
CCH
CRC (L)
BCH
CRC (H)
26H
LRC 98H
LRC
FCH
Note) Start No. (Relative No.) is given by “Reference No. - 1”.
(Decimal number 100 (=101 – 1) Hexadecimal 64H)
Note) No. of data is the number of data bytes.
(which is different from the requested number of Reference No. In the example given above, the
requested number of Reference No. is1 and the number of data is 1).
6.5.2 Read digital input data (read input relay status)
[Function code. 02 (02H)]
The specified number of “digital (ON/OFF) input data” are read out consecutively commencing with
the designated Reference No. For ON/OFF data, 8 Reference Nos. data are placed in one data (1
byte) sequentially in number to constitute the response message data. The LSB (on DO side) of each
data is a digital data with the smallest number. If the number of Reference No. read is anything other
than a multiple of 8, an unnecessary bit becomes 0. An example of response message is the same as
in “Function code 01”, though its start number (Relative No.) is “Reference No. –10001”.
0 0 0 0 0 0 0 0
108
101
(00H)
Beginning 8 data
Reference No.
(Error check in ASCII mode)
The error check: CRC (L) and CRC (H) will be as follows.