Read multiple registers – function code 03h, Read multiple registers – function code 03h -2, Read multiple registers command message – Yaskawa F7 Modbus User Manual

Page 19

Advertising
background image

Message Formats 2-2

Read Multiple Registers – Function Code 03H

The Read Multiple Register message is used to read the contents of from one to eight consecutive registers. The formats of the read command

and response messages are shown below.

Read Multiple Registers Command Message

Table 2.2 - Read Command Message

Description

Data

Slave Address

02h

Function Code

03h

Upper

00h

Starting Register

Lower

20h

Upper

00h

Quantity

Lower

04h

Upper

45h

CRC-16

Lower

F0h

Each F7 drive slave address is set via. parameter H5-01. Valid slave addresses must be in the range of 1 to 20 hex (1 to 32 dec) and entered as a

hexadecimal number. No two slaves may have the same address. The master addresses the slave by placing the slave address in the Slave

Address field of the message. In the command message above, the slave is addressed at 02h. Broadcast address 0 is not valid for register read

commands.

The function code of this message is 03h (read multiple registers).
The starting register is the address of the first register to be read. In the command message above the starting register address is 20h (0020h).
The quantity indicates how many consecutive registers are to be read. The quantity may range from 1 to 8 registers. If an invalid quantity is

entered, error code 03h is returned in a fault response message. In this example, four consecutive registers are to be read: 20h, 21h, 22h and 23h.

A CRC-16 value is generated from a calculation including the message slave address, function code, starting register and quantity. 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 CRC-16 of the command message. If the two CRC-16 values are identical and the Slave Address is correct, the

slave processes command message. If the two CRC-16 values are not identical, the slave will discard the command message and not respond.
If the command message has a valid slave address, function code, starting register, and quantity, the slave will respond with a normal response

message. If the command message has an invalid function code, starting register, and/or quantity, the slave will respond with a fault response

message. If the command message has an invalid slave address or CRC-16, no response will be returned.

Advertising
This manual is related to the following products: