Read input register (Function 4)

The function Read input register reads the inputs on a word basis.

In this example the first two analog inputs (or the first two input words) are read. The analog inputs (or input words) start at an offset of 0x0000. The length indicates the number of words to be read. A KL3002, for example, has two words of input data. Therefore, the length to be entered at Number low is two.

Query

Byte name

Sample

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

Sample

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