Modbus Register Types: Coils, Inputs & Holding Registers
The Modbus data model defines four types of data that a slave device can expose to a master. Understanding these register types is fundamental to working with any Modbus device — they determine what data you can read, what you can write, and which function codes to use.
This guide explains each register type in detail, including their address conventions, practical applications, and how they relate to Modbus function codes.
The Four Modbus Data Types
| Data Type | Size | Access | Traditional Address | Function Codes |
|---|---|---|---|---|
| Coils | 1 bit | Read/Write | 00001–09999 | FC01, FC05, FC15 |
| Discrete Inputs | 1 bit | Read Only | 10001–19999 | FC02 |
| Input Registers | 16 bits | Read Only | 30001–39999 | FC04 |
| Holding Registers | 16 bits | Read/Write | 40001–49999 | FC03, FC06, FC16, FC23 |
Coils (Discrete Outputs)
Coils represent single-bit read/write values. The name comes from the relay coils found in early PLCs. Each coil can be either ON (1) or OFF (0).
Common Uses
- Controlling relays, contactors, and solenoids
- Turning motors, pumps, or heaters on and off
- Setting digital control flags
- Resetting alarms or clearing error conditions
Function Codes for Coils
- FC01 — Read Coils: Read the state of one or more coils. Returns a packed bit array.
- FC05 — Write Single Coil: Set one coil to ON (0xFF00) or OFF (0x0000).
- FC15 — Write Multiple Coils: Set multiple coils in a single request.
Example
A motor controller might use coil addresses 0–7 for eight relay outputs. To start the motor on relay 3, you write 0xFF00 to coil address 3 using FC05. To stop it, you write 0x0000.
Discrete Inputs
Discrete inputs are single-bit read-only values. They represent the state of physical inputs that the master can monitor but not change.
Common Uses
- Reading the state of physical switches and push buttons
- Monitoring door contacts, proximity sensors, and limit switches
- Checking alarm conditions and device status flags
- Reading safety interlocks
Function Codes for Discrete Inputs
- FC02 — Read Discrete Inputs: Read the state of one or more discrete inputs. Returns a packed bit array, same format as FC01.
Since discrete inputs are read-only, there are no write function codes. The device's internal logic or physical wiring determines their state.
Input Registers
Input registers are 16-bit read-only values. They typically represent measured or calculated data from the device's sensors or internal processing.
Common Uses
- Reading analog sensor values (temperature, pressure, humidity, flow)
- Monitoring electrical measurements (voltage, current, power, energy)
- Reading device counters and accumulated values
- Accessing firmware version, serial numbers, and device info
Function Codes for Input Registers
- FC04 — Read Input Registers: Read one or more 16-bit input registers.
Example
A temperature transmitter might expose the current temperature in input register 0 as a signed 16-bit value with a scaling factor of 0.1. A raw value of 234 means 23.4°C.
Holding Registers
Holding registers are 16-bit read/write values. They are the most commonly used register type in Modbus devices, serving as the primary storage for both configuration parameters and process data.
Common Uses
- Setpoints and control parameters (temperature setpoint, speed reference)
- Device configuration (communication settings, sensor ranges, alarm limits)
- Process values that the master needs to read and occasionally update
- Recipe data and batch parameters
Function Codes for Holding Registers
- FC03 — Read Holding Registers: Read one or more 16-bit holding registers.
- FC06 — Write Single Register: Write a value to one holding register.
- FC16 — Write Multiple Registers: Write values to a contiguous block of holding registers.
- FC23 — Read/Write Multiple Registers: Read a block of registers and write to another block in a single transaction.
- FC22 — Mask Write Register: Modify specific bits in a holding register without affecting others.
Example
A VFD (Variable Frequency Drive) might use holding register 0 for the speed setpoint (0–50000 representing 0.00–500.00 Hz) and holding register 1 for the control word (start/stop/direction bits).
Addressing Conventions
Modbus addressing can be confusing because of two different conventions:
Protocol Address (0-based)
In the actual Modbus protocol, all addresses are 0-based. When a master sends a request for holding register 0, it means the first holding register. This is what travels on the wire.
Traditional/PLC Address (1-based with prefix)
Many PLC manufacturers and documentation use a 1-based addressing convention with a prefix digit that indicates the register type:
| Type | Prefix | Example | Protocol Address |
|---|---|---|---|
| Coils | 0xxxx | 00001 | 0 |
| Discrete Inputs | 1xxxx | 10001 | 0 |
| Input Registers | 3xxxx | 30001 | 0 |
| Holding Registers | 4xxxx | 40001 | 0 |
Watch out: When device documentation says "Register 40001," it almost always means holding register at protocol address 0. Most Modbus testing tools use 0-based protocol addressing, so you'd enter address 0 with function code FC03. Always check whether your documentation uses 0-based or 1-based addressing.
Multi-Register Data Types
A single 16-bit register can only hold values from 0 to 65535. For larger values, devices use multiple consecutive registers:
- 32-bit float (IEEE 754) — Uses 2 consecutive registers. Common for analog measurements like temperature (23.45) or pressure (1013.25).
- 32-bit integer — Uses 2 consecutive registers. For counters and accumulated values that exceed 65535.
- 64-bit double — Uses 4 consecutive registers. For high-precision measurements.
- ASCII string — Uses multiple registers, 2 characters per register. For serial numbers, model names, etc.
When reading multi-register values, byte order matters. Different devices use different byte orders (Big Endian, Little Endian, Mid-Big Endian, Mid-Little Endian). Using the wrong byte order will produce garbage values. A tool like Modbus Simulator lets you try all 4 byte orders without changing your poll configuration.
Practical Tips
- Always refer to the device's register map documentation before polling
- Start with a small poll (5–10 registers) to verify communication before expanding
- If values look wrong, try switching the display format — a 32-bit float displayed as two unsigned integers will look like random numbers
- Use FC03 for holding registers and FC04 for input registers — using the wrong function code will return an error
- Some devices have overlapping address spaces (the same register is accessible via both FC03 and FC04) — check your device documentation
For step-by-step instructions on setting up polls and reading data, see our testing guide. If you're getting errors, consult our troubleshooting guide.
Explore All Register Types with Ease
Modbus Simulator supports all four register types, 21+ display formats, and 4 byte-order options. Read coils, inputs, and holding registers in any format you need.
Get Started — $99