40
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.10.
23 (0x17) Read/Write Multiple Registers
This function code performs a combination of one read operation and one write operation in a single MODBUS
transaction. The write operation is performed before the read. The request specifies the starting address and
number of holding registers to be read as well as the starting address, number of holding registers, and the data to
be written. The byte count specifies the number of bytes to follow in the write data field.
The normal response contains the data from the group of registers that were read. The byte count field specifies the
quantity of bytes to follow in the read data field.
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
0x17
0x17
“17”
0x31, 0x37
Read Starting Address Hi
0x08
0x08
“08”
0x30, 0x38
Read Starting Address Lo
0x00
0x00
“00”
0x30, 0x30
Quantity of Read Hi
0x00
0x00
“00”
0x30, 0x30
Quantity of Read Lo
0x02
0x02
“02”
0x30, 0x32
Write Starting Address Hi
0x08
0x08
“08”
0x30, 0x38
Write Starting Address Lo
0x00
0x00
“00”
0x30, 0x30
Quantity of Write Hi
0x00
0x00
“00”
0x30, 0x30
Quantity of Write Lo
0x02
0x02
“02”
0x30, 0x32
Byte Count
0x04
0x04
“04”
0x30, 0x34
Write Reg. Value #0 Hi
0x11
0x11
“11”
0x31, 0x31
Write Reg. Value #0 Lo
0x22
0x22
“22”
0x32, 0x32
Write Reg. Value #1 Hi
0x33
0x33
“33”
0x33, 0x33
Write Reg. Value #1 Lo
0x44
0x44
“44”
0x34, 0x34
Error Check (CRC/LRC)
-
0x88, 0x3F
“20”
0x32, 0x30
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
0x17
0x17
“17”
0x31, 0x37
Byte Count
0x04
0x04
“04”
0x30, 0x34
Write Reg. Value #0 Hi
0x11
0x11
“11”
0x31, 0x31
Write Reg. Value #0 Lo
0x22
0x22
“22”
0x32, 0x32
Write Reg. Value #1 Hi
0x33
0x33
“33”
0x33, 0x33
Write Reg. Value #1 Lo
0x44
0x44
“44”
0x34, 0x34
Error Check (CRC/LRC)
-
0x2E, 0xD2
“34”
0x33, 0x34
End of Frame
-
t1-t2-t3
CR, LF
0x0D, 0xA
-
In case of address 0x0800, 0x0801 output register value: 0x0000, 0x0000 changes to 0x1122, 0x3344.