DOCA0172EN-12

Function 100-4: Read Non-Adjacent Registers

Structure of Modbus Read n Non-Adjacent Registers Messages Where n ≤ 100

The example below is the case of reading of 2 non-adjacent registers.

Request

Definition

Number of Bytes

Value

Modbus server number

1 byte

0x2F

Function code

1 byte

0x64

Length of data in bytes

1 byte

0x06

Sub-function code

1 byte

0x04

Transmission number(1)

1 byte

0xXX

Address of the first word to be read (MSB)

1 byte

0x00

Address of the first word to be read (LSB)

1 byte

0x65

Address of the second word to be read (MSB)

1 byte

0x00

Address of the second word to be read (LSB)

1 byte

0x67

(1) The client gives the transmission number in the request.

NOTE: The table above describes how to read addresses 101 = 0x65 and 103 = 0x67 of a Modbus server. The Modbus server number is 47 = 0x2F.

Response

Definition

Number of Bytes

Value

Modbus server number

1 byte

0x2F

Function code

1 byte

0x64

Length of data in bytes

1 byte

0x06

Sub-function code

1 byte

0x04

Transmission number(1)

1 byte

0xXX

First word read (MSB)

1 byte

0x12

First word read (LSB)

1 byte

0x0A

Second word read (MSB)

1 byte

0x74

Second word read (LSB)

1 byte

0x0C

(1) The server sends back the same number in the response.

NOTE: The table above describes how to read addresses 101 = 0x65 and 103 = 0x67 of a Modbus server. The Modbus server number is 47 = 0x2F.
QR Code is a registered trademark of DENSO WAVE INCORPORATED in Japan and other countries.

Was this helpful?