33
FnIO MODBUS Adapter NA-9171, NA-9173
FnIO S-Series
Copyright(C) CREVIS Co.,Ltd Support +82-31-899-4599 URL : www.crevis.co.kr
6.2.4.
4 (0x04) Read Input Registers
This function code is used to read from 1 to approx. 125 contiguous input registers in a remote device. The
Request PDU specifies the starting register address and the number of registers. The register data in the response
message are packed as two bytes per register, with the binary contents right justified within each byte. For each
register, the first byte contains the high order bits and the second contains the low order bits.
Request
Field name
Example
RTU
ASCII
ASCII (bus line)
Start of Frame
-
t1-t2-t3
“,”
0x3A
Slave Address
0x07
0x07
“07”
0x30, 0x37
Function Code
0x04
0x04
“04”
0x30, 0x34
Starting Address Hi
0x00
0x00
“00”
0x30, 0x30
Starting Address Lo
0x00
0x00
“00”
0x30, 0x30
Quantity of Register Hi
0x00
0x00
“00”
0x30, 0x30
Quantity of Register Lo
0x02
0x02
“02”
0x30, 0x32
Error Check (CRC/LRC)
-
0x71, 0xAD
“F3”
0x46, 0x33
End of Frame
-
t1-t2-t3
CR, LF
0x0D, 0xA
Response
Field name
Example
RTU
ASCII
ASCII (bus line)
Start of Frame
-
t1-t2-t3
“,”
0x3A
Slave Address
0x07
0x07
“07”
0x30, 0x37
Function Code
0x04
0x04
“04”
0x30, 0x34
Byte Count
0x04
0x04
“04”
0x30, 0x34
Input Register #0 Hi
0x00
0x00
“00”
0x30, 0x30
Input Register #0 Lo
0x80
0x80
“80”
0x38, 0x30
Input Register #1 Hi
0x00
0x00
“00”
0x30, 0x30
Input Register #1 Lo
0x00
0x00
“00”
0x30, 0x30
Error Check (CRC/LRC)
-
0x9C, 0x6C
“71”
0x37, 0x31
End of Frame
-
t1-t2-t3
CR, LF
0x0D, 0xA
-
In case of address 0x0000, 0x0001 input register value: 0x0080, 0x0000.