7 Modbus TCP/IP Messaging
YASKAWA ELECTRIC SIEP C730600 59A V1000 Option Modbus TCP/IP Technical Manual 29
Examples of Multiple Register Write Command
Table 28 lists command examples when writing register values 0001H and 0258H to register addresses 0001H and
0002H in a drive with the slave address (unit identifier) 01H.
Table 29 shows examples of responses indicating that the write command has been executed successfully. The command
specifies the beginning of the register address and the number of registers.
Table 30 shows examples of an error response when writing to a register. The exception code is 02H (indicating a register
number error).
Table 28 Example Write Multiple Registers Command
Table 29 Example Write Multiple Registers Response
Table 30 Example Write Multiple Registers Error Response
23 (17 H) 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 31 Read/Write Multiple Registers Command
Description Data (H)
Slave Address 01
Function Code 10
Starting Register
Upper 00
Lower 01
Quantity of Registers
Upper 00
Lower 02
Number of Data Bytes 04
First Register Data
Upper 00
Lower 01
Next Register Data
Upper 02
Lower 58
Description Data (H)
Slave Address 01
Function Code 10
Starting Register
Upper 00
Lower 01
Quantity of Registers
Upper 00
Lower 02
Description Data (H)
Slave Address 01
Error Code 90
Exception Code 02
Description Byte(s) Data (H)
Slave Address
<1> M = Quantity of Registers to Read (range is 1 - 16)
<2> N = Quantity of Registers to Write (range is 1 - 16)
100 to FF
Function Code 1 17
Read Starting Register 2 0000 to FFFF
Quantity of Registers to Read 2 M
<1>
Write Starting Register 2 0000 to FFFF
Quantity of Registers to Write 2 N
<2>
Write Byte Count 1 N <2> x 2
Write Register Values N <2> x 2 0000 to FFFF
Modbus_conditional_E.fm 29 ページ 2012年3月7日 水曜日 午前11時31分