11. Modbus TCP server
11. 4. List of Modbus functions supported
| Code | Modbus name | Description | Size of data |
| (decimal) |
|
|
|
3 = 16#03 | Read Holding Registers | Read N output words | 63 words max. | |
6 = 16#06 | Write Single Register | Write one output word | - | |
16 | = 16#10 | Write Multiple Registers | Write N output words | 61 words max. |
23 | = 16#17 | Read/Write Multiple Registers | Read/write N words | 20/20 words max. |
43 | = 16#2B | Read Device Identification | Identification | - |
11. 5. “Read Holding Registers” (3) function
This Modbus request is used to read the values of a number (No. of Points) of adjacent words starting at the address indicated (Starting Address). The values read are restored one after another, at the end of the response (First Point Data →Last Point Data).
Request format:
Byte | Meaning |
0Function Code = 16#03
1Starting Address Hi
2Starting Address Lo
3No. of Points Hi (0)
4No. of Points Lo (1 - 125)
Response format: |
|
| |
|
|
| |
Byte | Meaning |
| |
0 | Function Code = 16#03 |
| |
1 | Byte Count (B = 2 × No. of Points) |
| |
2 | First Point Data Hi |
| |
3 | First Point Data Lo |
| |
… | ……………………… |
| |
B | Last Point Data Hi |
| |
B+1 | Last Point Data Lo |
| |
Exception response format: |
| ||
|
|
| |
Byte | Meaning | With the VW3A3310d Ethernet card | |
0 | Function Code = 16#83 |
| |
|
| 01 (Illegal Function) | |
1 | Exception Code | 02 (Illegal Data Address) | |
03 (Illegal Data Value) | |||
|
| ||
|
| 04 (Illegal Response Length) | |
|
|
|
35