Summary:
- Modbus function codes define specific actions for device communication, like reading inputs or writing outputs.
- Common codes (01, 03, 06) handle basic input/output tasks in most systems.
- The function codes list is structured by operation type, helping ensure reliable data exchange.
- Open Automation Software offers built-in support for Modbus TCP/RTU and easy tag integration.
Modbus has been a staple in industrial automation for decades, thanks to its simplicity and flexibility. But behind that simplicity is a precise system of instructions known as Modbus function codes.
Without a clear understanding of how Modbus function codes work, data exchange between devices can become unreliable or inefficient. Each code serves a specific role, and knowing how to apply the right one is key to successful integration.
In this post, we’ll look at the most essential function codes used in Modbus systems, explain what they do, and explore how they’re applied in real-world automation environments.
What Are Modbus Function Codes?
In a Modbus system, every action starts with a function code. A function code in Modbus tells a device what to do, such as read a value, write to a register, or run a quick diagnostic.
Each code is tied to a number, usually in hexadecimal. For example, function code 03 reads holding registers, while code 06 writes to a single one. These numbers are what keep communication consistent across devices.
The Modbus function codes list is mostly standardized, but not all devices support every option. Picking a supported Modbus function code helps avoid miscommunication and makes setup and troubleshooting a lot smoother.
How the Modbus Function Codes List Is Structured
The Modbus function codes list is grouped by function, making it easier to identify the right code for a specific task. These tasks typically fall into four categories:
- Reading coils or discrete inputs
- Reading or writing registers
- Writing coils or outputs
- Diagnostic and auxiliary tasks
Each function code in Modbus follows a set format that defines how data is requested or sent. Some codes handle one value at a time, while others allow for bulk operations.
By understanding how the list is structured, integrators can quickly find the appropriate Modbus function code and apply it effectively in automation environments. This clarity is a main reason Modbus remains a go-to protocol in industrial settings.
Most Common Function Codes in Modbus and Their Applications
Some Modbus function codes are used far more often than others, especially in industrial automation settings. These essential codes allow systems to read inputs, control outputs, and exchange real-time data between devices like PLCs, RTUs, and SCADA platforms.
Below are the most commonly used function codes in Modbus, along with their typical applications.
01 – Read Coils
Reads the ON/OFF status of discrete outputs.
Use case: Monitor devices such as relays, valves, or motor starters.
02 – Read Discrete Inputs
Reads the status of digital inputs that can only be monitored, not controlled.
Use case: Check switch positions or alarm states.
03 – Read Holding Registers
Retrieves the value of holding registers, which typically store output-related data.
Use case: Get analog output values like speed setpoints or temperature thresholds.
04 – Read Input Registers
Reads input-only data often tied to sensors.
Use case: View live readings such as pressure, voltage, or flow rate.
05 – Write Single Coil
Changes the state of one digital output (ON or OFF).
Use case: Start or stop a single device like a fan or light.
06 – Write Single Register
Sends a new value to a single holding register.
Use case: Adjust a single setpoint, such as a temperature limit.
15 (0x0F) – Write Multiple Coils
Updates the state of multiple digital outputs at once.
Use case: Activate a group of devices in a single command.
16 (0x10) – Write Multiple Registers
Writes a series of values to consecutive holding registers.
Use case: Send configuration data or set multiple process parameters.

Practical Use Cases in Industrial Automation
Function codes aren’t just technical details; they’re what make real-time control and monitoring possible in industrial systems. From factory floors to remote stations, they keep everything talking to each other and running as expected.
Monitoring Equipment Status
One of the most common uses is checking the status of machines. Reading coils or discrete inputs let operators see if a motor is running, a valve is open, or a relay has tripped. It’s a simple way to stay ahead of potential issues.
Managing Setpoints and Outputs
When it’s time to tweak a setpoint or push a new value, writing to a register does the job. For example, you might need to change a temperature limit or update a speed setting. Doing this remotely saves time and avoids interruptions.
Sensor Data Collection
Input registers often store values from field devices like pressure sensors or flow meters. Systems regularly poll this data for dashboards, alarms, or reports, giving teams the visibility they need to respond quickly.
Coordinating System Responses
Sometimes multiple devices need to act at the same time. Writing to several coils or registers at once helps synchronize those actions, which is important in systems like automated packaging lines or multi-step batch processes.
Remote Troubleshooting
Advanced function codes like diagnostics or masked register writes can assist technicians with remote system checks and fine-tuning. This can reduce the need for onsite maintenance and speed up issue resolution across distributed systems.
How Open Automation Software Supports Modbus Protocols
Supports Modbus TCP and RTU
Open Automation Software works with both Modbus TCP and Modbus RTU, making it easy to connect a wide range of industrial devices over Ethernet or serial.
Master and Slave Modes
OAS can act as a Modbus master, slave, or both. This gives users flexibility in how devices send and receive data within SCADA, HMI, or edge systems.
Simple Tag Mapping
Modbus data points can be mapped to OAS tags for use in real-time monitoring, logging, and automation with no custom code required.
Built for Integration
With built-in scaling, data conversion, and support for many other protocols, OAS helps unify Modbus devices with modern software, cloud services, and enterprise systems.
Where Modbus Meets Modern Automation
Working with Modbus doesn’t have to be complicated. Once you’re familiar with how function codes are used, it becomes much easier to build reliable, well-connected systems that fit your operation’s needs. The right tools can help you spend less time on configuration and more time focusing on performance and results.
Curious how Open Automation Software can simplify your Modbus setup? Request a free, interactive demo and get your questions answered by our team of experts. We’ll show you what’s possible and help you explore the best path forward for your project.