-19-
5.4.2 Message in ASCII mode
Calculate the error check LRC from the core message. LRC is 94H (See Section 5.3.5.2). Each data in
the core message is converted to ASCII code. LRC is also converted to ASCII code to be added to the
core message. Add a message starting character " : " and "CR" and "LF" to the end of the message.
3AH
30H
32H
30H
34H
30H
30H
36H
34H
30H
30H
30H
32H
39H
34H
0DH
0AH
5.5 Function Code
Responses by function code are given below. (See Table 2. Function code table in Section 5.3.2)
Note) See Section 5.6 for responses in abnormal status.
5.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 10 Reference Nos. from 25 to 34 of digital parameters for the slave unit 2.
Reference No
25 26 27 28 29 30 31 32 33 34
Data ON
-
-
-
-
-
-
-
-
-
Temperature
C
(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
02H
Start No. (L)
18H
1
st
8 data
01H
Number of Reference No. (H) 00H
Next 8 data
00H
Number of Reference No. (L) 0AH CRC
(L) FCH
CRC (L)
3CH
CRC
(H) 6CH
CRC (H)
39H
LRC
DBH LRC FAH
Note) Start No. (Relative No.) is given by "Reference No. - 1".
(Decimal number 24 (=25 - 1) Hexadecimal 18H)
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. is10 and the number of data is 2).
02H 04H 00H 64H
[
: ]
00H 02H 94H
LRC
CR
LF
(Error check in ASCII mode)
The error check: CRC (L) and CRC (H) will be as follows.
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
(01H)
(00H)
Reference No.
34
33
Next 8 data
Beginning 8 data
Reference No.
32
25