Read Holding Register (Function 3)
The Read Holding Register function can be used to read the input and output words and the registers. The inputs have offsets 0 - 0xFF while the outputs have offsets 0x800 - 0x8FF.
The first two analog outputs are read in this example. The analog outputs begin at offset 0x800. The length indicates the number of channels to be read.
Query
Byte Name |
Example |
---|---|
Function code |
3 |
Start address high |
8 |
Start address low |
0 |
Count high |
0 |
Count low |
2 |
The fieldbus coupler answers with byte count 4, i.e. 4 bytes of data are returned. The query was for two analog channels, and these are distributed over two words. In the analog output process image, the first channel has the value 0x3FFF, while the second channel has the value 0x0.
Response
Byte Name |
Example |
---|---|
Function code |
3 |
Byte Count |
4 |
Data 1 high byte |
63 |
Data 1 low byte |
255 |
Data 2 high byte |
0 |
Data 2 low byte |
0 |