
36
YASKAWA
SIEP C730600 0E YAI Modbus TCP/IP Technical Manual
Function code
When sent by the master, this field identifies the command to be undertaken by the slave. It also identifies the
format for the DATA section of the message. The slave normally echoes this command back to the master in its
response message. When the most significant bit of this field is set in the response message, it signals an error
condition has occurred.
Data
This field contains multiple bytes of varying length based upon the Function Code for commands and based upon
the results of the command in the response. When sent by the master, this field contains details of the command
that the slave will require to carry out the function. When sent by the slave, this field contains details of the
response and sometimes error information.
■
Modbus TCP/IP Option Function Details
03 (03 (Hex.)) Read Multiple Registers
This function code is used to read the contents of a contiguous block of registers. The command specifies the
starting register and the number of registers. The normal response packs two bytes per register. For each register
in the response, the first byte contains the most significant bits and the second byte contains the least significant
bits.
Table 7.6 Read Multiple Registers (Command)
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Function Code
1
03
Starting Register
2
0000 - FFFF
Quantity of Registers
2
N
*1
N = Quantity of Registers (1 to 16)
Table 7.7 Read Multiple Registers (Response)
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Function Code
1
03
Number of Data Bytes
1
2 × N
Register Values
N
× 2
Values contained in slave registers
*1
N = Quantity of Registers
Table 7.8 Read Multiple Registers (Error Response)
Description
Byte No.
Data (Hex.)
Slave Address (Unit Identifier)
1
00 - FF
Error Code
1
83
Exception Code
1
Refer to Modbus TCP/IP Exception Codes.
Examples of Fault Response, Read Response, and Read Multiple Registers Command
lists command examples to 4 read register contents (register addresses 0020 (Hex.) to 0023 (Hex.)) from
a drive with the slave address (unit identifier) 02 (Hex.).
shows examples of responses indicating that multiple registers have been read successfully. The
contents read from 0020 (Hex.) are 1770 (Hex.), 1770 (Hex.), 0109 (Hex.), and 0000 (Hex.).
shows examples of an error response when reading multiple registers. The exception code is 02 (Hex.)
(indicating a register number error).
Table 7.9 Example Read Multiple Registers Command
Description
Data (Hex.)
Slave Address (Unit Identifier)
02
Function Code
03
Starting Register
Upper
00
Lower
20
Quantity of Registers
Upper
00