PLC Simulator
Modbus function reference

Modbus Function Code 05 — Write Single Coil

Write one boolean output state

05
Load in Modbus sandbox

Data model

Coils (0xxxx reference family)

Access

Write one boolean output state

Protocol quantity

Exactly 1 coil

Worked example

Read the PDU field by field.

Write ON to the coil at protocol address 172. ON is encoded FF00 and OFF is encoded 0000.

Typical use: Sending a single boolean command when the device map explicitly permits a coil write.

Example protocol data units

Request PDU

05 00 AC FF 00

Normal response PDU

05 00 AC FF 00

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

  • Encoding ON as 0001 instead of FF00
  • Writing a physical state without an interlock or authorisation check
  • Treating a normal echo response as proof the machine moved

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