Modbus Function and Exception Codes

Field reference for grid scale battery storage technicians. 9 entries, taken from the StoreWatt app.

These notes come from StoreWatt

Reference notes from StoreWatt, the offline field toolkit for grid scale battery energy storage technicians. It works with no cell signal, because the sites do not have any.

Get StoreWatt on the App Store
01

Read coils

Reads discrete outputs (coils), one bit each. Coils are read and write points: commands, enables, and latches. Address space traditionally documented as 00001 to 09999.

02

Read discrete inputs

Reads discrete inputs, one bit each, read only: status contacts, alarms, and limit switches. Traditionally documented as 10001 to 19999.

03

Read holding registers

Reads 16 bit holding registers: setpoints, configuration, and many measured values. Traditionally documented as 40001 and up. The most used function code in plant integration, and the one most often confused with 04.

04

Read input registers

Reads 16 bit input registers, read only measurements. Traditionally documented as 30001 and up. Devices differ on which table their telemetry lives in; when a poll returns zeros without errors, try the other table before blaming the device.

05

Write single coil

Writes one coil on or off. The on value is 0xFF00 and off is 0x0000; some devices reject anything else. Used for single commands like start, stop, and reset permissives.

06

Write single register

Writes one 16 bit holding register: a single setpoint or configuration word. Devices may accept 06 but ignore values outside their limits, returning success while clamping internally; read back after writing to confirm.

15

Write multiple coils

Function 15 (0x0F) writes a block of coils in one transaction. Useful for command words spread across bits; beware devices that require all or nothing block writes.

16

Write multiple registers

Function 16 (0x10) writes a block of holding registers in one transaction. The standard way to deliver multi register setpoints and 32 bit values so both halves land atomically. Some devices only accept certain registers through 16 and reject 06 for the same address.

EX

Exception codes

An exception response sets the high bit of the function code and carries a reason. 01 illegal function: the device does not support that code. 02 illegal data address: wrong register or out of range block. 03 illegal data value: bad length or a rejected value. 04 slave device failure: internal error. 06 slave device busy: retry later. 0B gateway target failed to respond: the device behind a gateway is silent, so chase the serial side.

These notes come from StoreWatt

Reference notes from StoreWatt, the offline field toolkit for grid scale battery energy storage technicians. It works with no cell signal, because the sites do not have any.

Get StoreWatt on the App Store

These notes are a field aid, not a substitute for the governing codes, the stamped drawings, the authority having jurisdiction, or manufacturer manuals. Verify against the current documentation for your installed equipment.