Home / Resources / Modbus Function Codes Explained for Everyday Testing
Modbus & Industrial Automation

Modbus Function Codes Explained for Everyday Testing

Published September 22, 2026

A practical introduction to common Modbus function codes used when testing coils and registers.

Function codes tell a Modbus server what operation the client is requesting. Understanding the common codes makes device documentation easier to interpret.

Common reads

Function 01 reads coils, 02 reads discrete inputs, 03 reads holding registers and 04 reads input registers.

Common writes

Function 05 writes a single coil, 06 writes a single holding register, 15 writes multiple coils and 16 writes multiple holding registers.

When a read fails

Confirm that the function code matches the device data table, then check the address and quantity. Use the exception response together with the device manual to identify the problem.