PLC Simulator
Modbus function reference

Modbus Function Code 15 — Write Multiple Coils

Write a packed block of boolean states

15
Load in Modbus sandbox

Data model

Coils (0xxxx reference family)

Access

Write a packed block of boolean states

Protocol quantity

1–1968 coils

Worked example

Read the PDU field by field.

Write ten coil states beginning at protocol address 19. The request declares quantity, byte count and packed data.

Typical use: Updating a documented contiguous command block in one transaction.

Example protocol data units

Request PDU

0F 00 13 00 0A 02 CD 01

Normal response PDU

0F 00 13 00 0A

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

  • Mismatching quantity and byte count
  • Packing bits most-significant-bit first
  • Overwriting adjacent command bits that another controller owns

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 15 write-multiple-coils guide: field reference

Direct answer

The reader can construct and inspect a bounded request, calculate byte count and bit order, validate the echoed response and diagnose exception or application-state mismatches.

Written for pLC programmers and commissioning technicians writing several discrete outputs with Modbus function code 15 (0x0F).

an industrial communications lab with a generic PLC, RS-485 segment, gateway, protocol trace and an eight-relay coil output bank while studying Modbus function code 15 request packing, address validation, atomic application behavior and response checking
System map / 02

NODE 01observable

Definition

Client and server roles, unit identity, starting address, quantity, byte count, least-significant-bit packing, unused bits, response echo and application permission.

NODE 02observable

Signal path

Operator or control intent through client mapping and request frame into server coil references, physical output ownership and independent process feedback.

NODE 03observable

Worked example

A known pattern written across byte boundaries and read back with the expected address, quantity, bit order and permitted physical response.

NODE 04observable

Limits

Off-by-one addressing, wrong unit, reversed bit order, incorrect byte count, read-only range, illegal quantity, exception, timeout, partial application and stale display.

NODE 05observable

Common mistake

A transport, unit, function, address, quantity, byte-count, packed-data, server-map or application-response mismatch.

NODE 06observable

Verification

The request constrained, access-controlled and retested on the exact server without assuming that a successful protocol response proves safe motion.

Answer surface / 07

How are coils packed in Modbus function code 15?

Coils are packed from the addressed sequence into data bytes, with the first coil in the least-significant bit of the first byte. Unused bits in the final byte are set according to the specification.

What should a successful function 15 response contain?

The normal response echoes the starting address and quantity written. Read-back and independent process evidence are still needed because an accepted request does not prove the intended physical outcome.