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

Technical reference and worked-example guide

Modbus function 02 discrete-input guide: field reference

Direct answer

The reader can form a valid request, unpack response bits, reconcile address notation and distinguish protocol state, PLC mapping and physical input truth.

Written for pLC, HMI and integration learners reading read-only discrete input state and connecting returned bits to field or device evidence.

a controls bench tracing generic PLC, remote I/O, serial and Ethernet paths into protocol diagnostics and mapped application data while studying Modbus function code 02 input addressing and bit evidence
System map / 02

NODE 01observable

Definition

Client, server, transport, unit identity, starting input address, quantity, address base, packed-bit order, read-only semantics, freshness, quality and field meaning.

NODE 02observable

Signal path

Application request through transport and device map to packed input bits, consuming tags, application logic and independent field evidence.

NODE 03observable

Worked example

Known inactive and active input cases read repeatedly with correct address, bit location and physical interpretation.

NODE 04observable

Limits

First and last address, excessive quantity, exception, timeout, short frame, unused packed bits, stale cache, device restart and sensor disagreement.

NODE 05observable

Common mistake

An identity, function, address-base, quantity, packing, freshness, device-map, logic or field-evidence mismatch.

NODE 06observable

Verification

The discrete-input map and behavior checked against current device manuals and a known physical or simulated condition.

Answer surface / 07

What does Modbus function code 02 read?

It reads discrete input bits, commonly representing read-only Boolean status in the server data model; exact meaning comes from the device map.

How is function 02 different from function 01?

Function 02 addresses discrete inputs while function 01 addresses coils; device semantics and access rules still require documentation.