Skip to content

Modbus Register Types

Nikhil Bangar edited this page Jul 30, 2026 · 1 revision

Modbus Register Types

Modbus defines four distinct data regions, often called "register types" even though two of them are single bits, not registers in the 16-bit sense. Every Modbus master tool — ModbusViewer included — needs to know which one it's talking to, since each uses a different function code on the wire.

Type Address prefix (Modicon) Size Access Read function code Write function code
Coils 0x (e.g. 00001) 1 bit Read/write 01 (Read Coils) 05 (Write Single Coil)
Discrete Inputs 1x (e.g. 10001) 1 bit Read-only 02 (Read Discrete Inputs)
Input Registers 3x (e.g. 30001) 16 bits Read-only 04 (Read Input Registers)
Holding Registers 4x (e.g. 40001) 16 bits Read/write 03 (Read Holding Registers) 06 (Write Single Register)

What each one is typically used for

  • Coils — digital outputs you can control: relays, solenoids, enable flags. Since they're writable, this is how a master commands a slave device.
  • Discrete Inputs — digital inputs you can only observe: limit switches, alarm contacts, on/off sensor states. Read-only because the slave device owns that physical input, not the master.
  • Input Registers — analog measurements you can only observe: a temperature, a voltage, a flow rate reported by a sensor. Read-only for the same reason as Discrete Inputs.
  • Holding Registers — the general-purpose, read/write 16-bit space: configuration parameters, setpoints, or any analog value the master is allowed to change. This is what most Modbus tutorials default to, and historically the only one some simpler master tools support.

Addressing conventions

The wire protocol always uses a flat, 0-based address per function code — there's no "region" encoded in the address itself, only in which function code you use to read it. The 0x/1x/3x/4x prefixes above are a display convention (often called "Modicon addressing") layered on top, where the first digit tells you the region and the rest is a 1-based offset within it. ModbusViewer supports both: a 0-based (PDU) mode showing the raw wire address, and a Modicon mode showing the traditional 4xxxx-style address — toggle it from the top toolbar, and it applies consistently everywhere an address is shown or entered.

How ModbusViewer exposes all four

  • Normal mode has a Type selector in the toolbar — pick which of the four you're viewing, and the address column automatically shows the right prefix for that type.
  • Coil rows show a toggle switch (writable, matches the type's own read/write nature).
  • Discrete Input and Input Register rows are read-only — no edit control, since the protocol itself doesn't allow writing them.
  • Favorites mode can mix all four types in one list — each entry remembers its own type, address, and (for the two 16-bit types) display format.

See the Getting Started page for how to actually connect and try this against a real device or the bundled simulator.

Clone this wiki locally