
4 | Start-up
FISCHER Mess- und Regeltechnik GmbH
16 / 28
BA_EN_DE43
4.3.3 Function code 0x02: Read Discrete Inputs
This function code is used to read digital inputs.
Request
The query contains the address of the first bits that are to be read and their
number.
0x02
MSB
LSB
MSB
LSB
5
1
2
3
4
Byte
Byte Field name
Size
Value range
1
Function Code
1 byte
0x02
2.3
Start Address
2 bytes
0x0000 to 0xFFFF
4.5
Number of inputs
2 bytes
1 to 2000 (0x7D0)
The DE43 can be equipped with up to four digital inputs.
Bit
Data type
Description
State
0
Boolean
Digital input 1
0 or 1
1
Boolean
Digital input 2
0 or 1
2
Boolean
Digital input 3
0 or 1
3
Boolean
Digital input 4
0 or 1
Response
The states of the digital inputs are summarised as bytes in the response. The
number of bytes (N) is the result of the number of inputs divided by 8. If there is
a rest, the number of bytes increases (N=N+1).
However, as the DE43 only has a maximum of 4 inputs, only 1 byte is trans-
ferred as a response.
The states of the digital inputs from the bit with the lowest value are saved
within a byte. A bit value of 0 corresponds to the status OFF; a bit value of 1
corresponds to the status ON.
0x02
N
Byte1
Byte N
1
2
3
Byte
...
Byte Field name
Size
Value range
1
Function Code
1 byte
0x02
2
Number of bytes
1 byte
N
3…
Number of inputs
N Bytes 8 Bit value
Error
0x82
Code
1
2
Byte
Byte Field name
Size
Value range
1
Function Code (error)
1 byte
0x82
2
Error code
1 byte
Code s. table Error codes [