PLC Simulator
Modbus function reference

Modbus Function Code 02 — Read Discrete Inputs

Read packed read-only boolean states

02
Load in Modbus sandbox

Data model

Discrete inputs (1xxxx reference family)

Access

Read packed read-only boolean states

Protocol quantity

1–2000 discrete inputs

Worked example

Read the PDU field by field.

Read 22 discrete inputs beginning at protocol address 196. Unused bits in the final response byte are padding.

Typical use: Polling read-only field or status bits such as limit switches, trip feedback and device-ready states.

Example protocol data units

Request PDU

02 00 C4 00 16

Normal response PDU

02 03 AC DB 35

PDU examples omit the Modbus TCP MBAP header and the Modbus RTU unit-address/CRC envelope. Multi-byte values are shown in network byte order.

Common implementation mistakes

  • Trying to write a discrete-input object
  • Confusing the 1xxxx reference family with protocol address 10001
  • Treating padding bits as mapped signals

Run the reference

Turn a protocol table into evidence.

Compose the request publicly, then use Pro for advanced graded exceptions, saved fixtures, complete history and project sharing.

Open sandbox