GPD315 Modbus RTU Technical Manual TM 4325
Page
10
Read Multiple Registers – Function 03h
The multiple register read function (03h) allows the master to request information from the slave.
The command message of a multiple register read is structured as shown below.
Table 4-2 Read Command Message
Slave Address 02h
Function Code 03h
Upper 00h
Starting Register
Lower 20h
Upper 00h
Quantity
Lower 04h
Lower 45h
CRC-16
Upper F0h
Each GPD315’s slave address is set in advance by the drive parameter n153. Valid slave
addresses must be in the range of 1 to 31 decimal (1 to 1F hex). No two slaves may have the
same address. The master addresses the slave by placing the slave address in the address field
of the message. In the command message above, the slave is addressed at 2.
The function code of this message is 03h (read multiple registers).
The starting number is the first register to be read. In the command message above the starting
register is 20h, indicating that the first register is the Status Signal. A listing of the GPD315’s
registers is shown in Chapter 5, Registers.
The quantity indicates how many consecutive registers are to be read. The quantity may range
from 1 to 8 registers. If the quantity is greater than 8, an error code of ‘3’ is returned in the fault
response message. In this example there are four consecutive registers to be read: 20h, 21h,
22h and 23h.
A CRC-16 value is generated from a calculation using the values of the address, function code,
and data sections of the message. The procedure for calculating a CRC-16 is described at the
end of this chapter. When the slave receives the command message it calculates a CRC-16
value and compares it to the one in CRC-16 field of the command message. If these two CRC-
16 values are the same the slave has received the proper command message. If the two CRC-
16 values are not the same the slave will not respond.
If the command message has a valid slave address, function code, starting register, and quantity
value, the slave will respond with a normal response message. If the command message has an
invalid slave address, function code, starting register, and/or quantity the slave will respond with
a fault response message.