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. |
||
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. |
||