Read Input Register (Function 4)

The Read Input Register function reads the analog inputs.

In this example the first two analog inputs of slave number 11 are read. The analog outputs start at an offset of 0x0000. The length indicates the number of words to be read. A KL3002 has two words of input data, which is why the value to be entered in Count low is two.

Query

Byte Name

Example

Function code

4

Start address high

0

Start address low

0

Count high

0

Count low

2

The fieldbus coupler answers with byte count 4, i.e. four bytes of data are returned. The query was for two analog channels, and these are now distributed over 2 words. In the analog input process image, the first channel has the value 0x0038, while the second channel has the value 0x3F1B.

Response

Byte Name

Example

Function code

4

Byte Count

4

Data 1 high byte

0

Data 1 low byte

56

Data 2 high byte

63

Data 2 low byte

11