← All Posts

Modbus HMI: Build an Operator Panel for a Modbus TCP PLC

Modbus TCP is the least common denominator of industrial networking: if a PLC, a VFD, a power meter, or a temperature controller has an Ethernet port, there is a good chance it speaks Modbus TCP on port 502. That makes "put an HMI on it" a question of mapping registers to widgets, not of learning a proprietary stack. This guide walks through how a Modbus HMI works, which function codes belong on which widgets, and how to verify a register map before you build screens on it.

How a Modbus HMI Works

An HMI connected to Modbus TCP is a Modbus client (the terms master and client are used interchangeably). It does two things on a cycle:

  1. Reads registers and coils from the device: process values, statuses, counters.
  2. Writes coils or registers when the operator acts: setpoints, start/stop commands, mode changes.

Modbus has no tag names and no subscriptions. The HMI polls registers by address, the device answers, and the widgets update. The Modbus application protocol defines the function codes that make this work; the ones that matter on an HMI are FC03 (read holding registers), FC04 (read input registers), FC05 (write single coil), FC06 (write single register), and FC16 (write multiple registers), per the Modbus Application Protocol specification. The transport details, including the well-known TCP port 502, are defined in the MODBUS Messaging on TCP/IP Implementation Guide.

Which Register Goes on Which Widget

The most common design mistake is treating all Modbus data the same. A holding register holding a setpoint and a coil holding a fault bit want different widgets and different permissions:

Modbus data
Typical content
Widget on the HMI
Holding register, read (FC03)
Setpoints, process values, counters
Value display, bar gauge, tank; slider for operator-adjustable setpoints
Input register (FC04)
Measurements (read-only by design)
Display only: never bind a control to it
Coil, read (FC01)
Run, fault, interlock bits
LED indicator or status pill
Discrete input (FC02)
Limit switches, field contacts (read-only)
Display only
Coil, write (FC05)
Start/stop, reset, acknowledge
Push button, write on press
Holding register, write (FC06/FC16)
Setpoints, mode numbers
Slider or button action, role-gated

Two rules keep this safe. First, everything the operator can change should sit behind a role check: a viewer watching a tank level should not be able to move a setpoint slider. Second, 32-bit values (floats, DINTs) span two consecutive 16-bit registers, and the register pair is only half the story: byte order decides whether you display 72.5 or a nonsense number. If your values look wrong, try Big-endian (ABCD), Little-endian (DCBA), Swapped Big (BADC), and Swapped Little (CDAB) in the data type setting; usually exactly one will be right for that device, and the device manual settles it. Our guide to Modbus floating point and byte order covers the details, and Modbus addressing explained covers the area model and why a manual's "40001" is address 0 on the wire.

Connecting: IP, Port, Unit ID

A Modbus TCP connection needs exactly three things: the device's IP address, port 502 (or a custom port if the device's configuration changed it), and the Unit ID. On Modbus TCP the Unit ID is mostly a compatibility leftover from serial: many devices accept any value, while devices behind a Modbus TCP-to-RTU gateway use it to address the serial slave behind the gateway. If a read fails, confirming the Unit ID against the device manual is the second thing to check after basic reachability.

Building an Operator Panel

Whatever HMI or SCADA software you use, the work follows the same order:

  1. Verify the register map first. Read each address you plan to use with Modbus Poll and confirm the address, data type, scaling, byte order and Unit ID. Mistakes found here cost minutes; mistakes found on a finished screen cost hours.
  2. Add the device in your HMI or SCADA software with the IP address, port and Unit ID, and confirm the connection with a test read.
  3. Bind read-only widgets first (values, gauges, indicators) and check them against what Modbus Poll shows.
  4. Add writes last. Bind each button or slider to a register the PLC program explicitly expects an operator to change, and test it against a simulated device before it touches a real machine. Modbus Poll can simulate one; see Modbus simulator for macOS.

If you want browser-based operator screens over Modbus, Voltrus SCADA polls Modbus devices and serves dashboards to a browser. It is read-only by default, and tag writes go through a server-side write policy.

What Belongs on a Machine-Level Modbus HMI (and What Doesn't)

A good Modbus operator panel is small. In practice, four screens cover most machines:

  • Overview: the two or three values an operator checks every shift, plus run status.
  • Control: start/stop and mode buttons, each bound to a coil or register the PLC program explicitly expects an operator to write.
  • Trends: the process values worth watching over time.
  • Alarms: fault bits as alarm rules, with severity colors and acknowledgement.

What does not belong: plant-wide aggregation, historical storage for compliance, dashboards combining ten machines. That is supervision, and supervision is what SCADA is for. Trying to stretch a machine HMI into a SCADA role produces a slow screen and an unusable historian. See SCADA vs HMI for the split, and web-based HMI if you are weighing browser delivery against a native panel.

Check the Register Map Before You Build Screens

Modbus Poll reads and writes Modbus TCP and RTU registers from your Mac, so you can confirm addresses, data types and byte order before they end up on an operator screen.

See Modbus Poll

Further Reading