40
YASKAWA
SIEP C730600 0E YAI Modbus TCP/IP Technical Manual
Description
Data (Hex.)
Lower
01
Quantity of Registers
Upper
00
Lower
02
Table 7.23 Example Write Multiple Registers Error Response
Description
Data (Hex.)
Slave Address (Unit Identifier)
01
Error Code
90
Exception Code
02
23 (17 (Hex.)) Read/Write Multiple Registers
This function code performs a combination of one read operation and one write operation in a single Modbus
TCP/IP transaction. The write operation is performed before the read. The command specifies the starting read
address, quantity of contiguous registers to read, starting write address, quantity of contiguous registers to write
and the values to be written. The normal response contains the values of the registers that were read.
For both the address and the values, the first byte contains the most significant bits and the second byte contains
the least significant bits.
Table 7.24 Read/Write Multiple Registers Command
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Function Code
1
17
Read Starting Register
2
0000 - FFFF
Quantity of Registers to Read
2
M
Write Starting Register
2
0000 - FFFF
Quantity of Registers to Write
2
N
Write Byte Count
1
N
× 2
Write Register Values
N
× 2
0000 - FFFF
*1
M = Quantity of Registers to Read (range is 1 - 16)
*2
N = Quantity of Registers to Write (range is 1 - 16)
Table 7.25 Read/Write Multiple Registers Response
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Function Code
1
17
Number of Data Bytes
1
M
× 2
Read Register Values
M
× 2
Values contained in slave registers
*1
M = Quantity of Registers
Table 7.26 Read/Write Multiple Registers Error Response
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Error Code
1
97
Exception Code
1
Refer to Modbus TCP/IP Exception Codes.
Read/Write Multiple Registers
lists command examples when reading registers 0001 (Hex.) and 0002 (Hex.) and then writing register
values 0103 (Hex.) and 0258 (Hex.) to register addresses 0102 (Hex.) and 0103 (Hex.) in a drive with the slave
address (unit identifier) 01 (Hex.).
shows examples of responses indicating that the read/write multiple registers command has been
executed successfully. Read data 1 contains the value of register address 0001 (Hex.) (0001 (Hex.)). Read data 2
contains the value of the register address 0002 (Hex.) (0002 (Hex.)).
shows examples of an error response when the command to read and write to multiple registers has
failed. The exception code is 02 (Hex.) (indicating a register number error).