Read Holding Registers (Code = 0x03) |
The function code 0x03 (Read Holding Registers) allow to read informations, randomly, from the main PLC table
The PLC module acts like SERVER and the request should be prepared by a host system working as CLIENT. The PLC table is 16-bits word aligned array of general purpose data registers. The register address is in the range from zero to the maximum number of registers of your PLC (See specific technical data). For example, if my PLC has 1000 words, my address range is from 0 to 999
The fields related with the request are listed here
Field |
Lenght |
Description |
Start Address |
2 Bytes |
This field keeps the "first location address" that will be readed from the PLC table. The field represent a 16bits-aligned entity and can span from 0 to the maximum table size |
Quantity of Registers |
2 Bytes |
This is number of registers that will be readed starting from the first specified address |
Sample RS232/RS485 Packet Session (Request/Response)
REQUEST (SENT BY CLIENT SYSTEM)
|
|||||
Fields |
Mnemonic |
Description |
Lenght |
Sample Data |
Sent bytes and order |
MODBUS Request
|
FC |
Function Code |
1 Byte |
0x03 |
03H |
|
Start Address |
2 Bytes |
0x0240 |
02H 40H |
|
|
Quantity of Registers |
2 Bytes |
0x0004 |
00H 04H |
|
CRC |
CRC |
2 Bytes |
0xABCD |
ABH CDH |
RESPONSE (SENT BY SERVER PLC)
|
|||||
Fields |
Mnemonic |
Description |
Lenght |
Sample Data |
Sent bytes and order |
MODBUS Response |
FC |
Function Code |
1 Byte |
0x03 |
03H |
|
Content of register 0x0240 |
2 Bytes |
0x1234 |
12H 34H |
|
|
Content of register 0x0241 |
2 Bytes |
0x5678 |
56H 78H |
|
|
Content of register 0x0242 |
2 Bytes |
0x9ABC |
9AH BCH |
|
|
Content of register 0x0243 |
2 Bytes |
0xDEF0 |
DEH F0H |
|
CRC |
CRC |
2 Bytes |
0xABCD |
ABH CDH |
Note: Readed data is sent using Big Endian notation (MSB byte first)