IMDTouchKnowledge BaseShop main store

How-to

Connecting an HMI to a Controller Over a Serial COM Port

HMI and touchscreens Published 8 min read

Short answer

A serial link between an HMI and a controller fails in a fixed order: cable, driver, then port settings. Ring the cable out end to end, run the driver that matches the controller with generic Modbus RTU only as a fallback, copy the controller's baud, parity, data bits, stop bits and station address exactly, then prove the link with read, write, unplug and reconnect tests.

On this page
  1. Ring out the cable before blaming the software
  2. Pick the driver: dedicated first, generic Modbus RTU second
  3. Copy the controller's serial settings, don't guess them
  4. Commissioning procedure, in order
  5. Worked example: a baud mismatch times out cleanly
  6. What each symptom points to
  7. Questions asked

A serial link between an HMI and its controller fails for three reasons, and they fail in order: the cable does not carry the signals between the pins the two devices actually use, the project polls with a driver that does not match the controller, or the port settings do not copy the controller's serial configuration. Work those three in order, then prove the link with a read, a write, an unplug and a reconnect. When one of the four tests fails, the table at the end names the first move for the symptom you are seeing.

Ring out the cable before blaming the software #

DB9 pin assignments on serial ports are vendor-specific, and they are not even consistent within one panel: HMIs commonly carry one or two serial connectors, one port wired for RS-232 and another for RS-485, and the same connector shell serves different signal sets depending on the mode that port is set to. Generic charts disagree with each other for exactly this reason — one supplier's RS-485 DB9 documentation puts the transmit pair on pins 3 and 9, while the worked cable below carries its data pair on pins 6 and 9. Both are correct for their own hardware. The pin numbers that count are the ones printed in the two manuals for the exact ports you are using.

So the decision is mechanical. Read the pin table for the controller's serial port and the pin table for the HMI COM port you will plug into, build a three-conductor cable for two-wire RS-485 — two signal conductors and a common — and ring it out: continuity on every conductor end to end, no conductor shorted to another, and the DB9 end landed on the HMI port you will configure. One worked mapping: a controller whose serial port is an RJ-11 jack, cabled to the HMI's DB9 as pin 1 to pin 9, pin 2 to pin 6 and pin 3 to pin 5, with DB9 pin 5 as signal common. The mapping belongs to that hardware pair; the ring-out process transfers to yours.

If the wiring matches both manuals and the link still sits silent, swap the two signal conductors before anything else. Reversed polarity on an RS-485 pair produces total silence, not damage, and it is the most common fault in a cable that rings out clean. For the RS-232 variant of the same job, building the RS-232 Modbus cable between an HMI and a controller walks the wire-by-wire checks in detail.

Pick the driver: dedicated first, generic Modbus RTU second #

In the HMI engineering software — EasyBuilder Pro is the example here — the device list is where the link gets its protocol. If the controller vendor ships a dedicated serial driver and your installed build lists it, use that driver. It addresses the controller's variables by the names and addresses the controller itself uses, usually through a tag file the vendor's project tool exports, so register maps are never transcribed by hand. Import that file unchanged, and re-export it whenever a variable is added, renamed or re-addressed: a stale tag file binds tag names to addresses the controller no longer holds, which reads as wrong values or rejected reads on a physically healthy cable.

If the driver list has no entry for the controller, update the engineering software to a build that carries it. When an update is not on the table, generic Modbus RTU is the fallback: it talks to any controller that speaks Modbus RTU on its port, at the cost of mapping every register by hand from the controller's register table. One physical port carries one driver — a dedicated driver and a Modbus RTU driver never share a port.

Modbus RTU also permits exactly one master on the wire. If the controller itself runs a Modbus master while the HMI polls, or a second panel polls the same port, the collisions show up as intermittent timeouts that no parameter change fixes — the pattern behind an HMI Modbus timeout caused by a PLC master-slave conflict. Sharing one controller between several panels is a layout problem rather than a driver change; connecting multiple HMIs to one PLC over 200 ft serial covers the multidrop arrangement.

Copy the controller's serial settings, don't guess them #

The HMI is the polling master and the controller owns the port, so the controller's configuration is the source and the HMI's device properties are the copy. Read the baud rate, parity, data bits, stop bits and station address from the controller's port configuration and enter identical values — nothing in this step is guessed. Where a serial port documents a Modbus RTU default, the Modbus serial line specification names 19200 baud as the default to implement, but a printed default is only valid until you read the actual configuration. Data bits are 8 on any Modbus RTU port; a controller offering 7 data bits is speaking Modbus ASCII there, not RTU.

Parity is the setting that bites. A Modbus RTU character is 11 bits either way: start bit, eight data bits, then a parity bit plus one stop bit, or no parity bit plus two stop bits. Change parity without changing the stop-bit count and the character length moves, the receiver's framing slips by a bit per character, and every reply fails its CRC check. A port set to 8E1 and a port set to 8N1 are not interchangeable, and a port at 19200 baud hears nothing from a partner transmitting at 9600.

Commissioning procedure, in order #

Run the steps in this order; each one depends on the ones before it.

  1. Read the pin tables for both ends — the controller's serial port and the exact HMI COM port — and build the cable to them.
  2. Ring out the cable: continuity on every conductor end to end, no conductor-to-conductor shorts, and the DB9 end on the port you will configure.
  3. Add a device to the HMI project and confirm the driver list carries the controller's dedicated serial driver; update the engineering software if it does not.
  4. If the driver works from an exported tag file, export it fresh from the controller project and import it unchanged.
  5. Point the device at the COM port the cable lands on and set that port's serial mode to match its wiring.
  6. Copy the baud rate, parity, data bits, stop bits and station address from the controller's port configuration into the device properties.
  7. Bind one numeric object to one tag, run the project in the simulator or download it to the panel, and watch the communication error flag clear.
  8. Read test: change a value at the controller and confirm the same value on the panel within a few poll cycles.
  9. Write test: on a spare writable register that moves nothing in the process — not a drive reference or a digital output — enter a value from the panel and confirm it lands in the controller.
  10. Unplug test: pull the cable with the project running. Bound objects must flag a communication failure instead of freezing on the last value; reconnect and confirm the values recover without a panel restart. Power-cycle the controller and repeat one read to confirm the station address and serial settings persisted.

Worked example: a baud mismatch times out cleanly #

Take a link where everything is right except one number: the HMI device set to 19200 baud, the controller port set to 9600. A short read request of 8 bytes is 8 characters at 11 bits each, so 88 bits go on the wire. At 19200 baud one bit lasts 1/19200 s = 52.1 µs, so the request occupies 88 × 52.1 µs = 4.58 ms. The controller's UART, configured for 9600, expects each bit to last 1/9600 s = 104.2 µs; the first character's stop bit arrives after half the expected bit time, the framing check fails, and the controller discards the frame without answering. The master waits out its timeout and reports no reply. That signature is worth memorizing: continuity confirmed, driver correct, and a timeout with zero reply bytes means a parameter mismatch, not a cable. Compare the settings at the controller end — station address first, then baud rate, then parity and stop bits, the three mismatches that look identical from the panel.

What each symptom points to #

Symptom on a running project What it points to First move
Clean timeout, zero reply bytes, cable rings out Wrong station address, reversed A/B polarity or a baud mismatch — all three look identical from the panel Confirm the address at the controller, swap the two signal conductors, then compare settings end to end
Framing errors, or replies that fail their CRC Parity or stop-bit mismatch shifting the character length by one bit Match parity and stop bits, not just the baud rate
Wrong values or rejected reads on a healthy cable Stale tag file binding tag names to re-addressed variables Re-export the tag file from the controller project and import it unchanged
Runs fine, then intermittent timeouts A second Modbus master polling the same port Take one master off the wire or move it to its own port
Passed the bench, drops frames at distance Unterminated RS-485 ends reflecting at length and speed Terminate both cable ends with the resistance the controller manual specifies

Close the job on four passes: a read that tracks the controller, a write that lands, a fault that flags when the cable is pulled, and a recovery that returns without a panel restart — then a controller power cycle and one more read to prove the settings persisted. When one of the four fails after the settings prove clean, fixing HMI PLC communication timeout over serial takes the diagnosis past these first moves.

Questions asked

Can I reuse the cable that fits the controller's programming port?

Not until it has been rung out against the COM port's own pin table. A programming-port cable and a data-port cable can carry different signals on the same connector style, and some panels assign different pins to different serial modes on identical DB9 connectors. A cable that programs the controller proves nothing about the polling link; three continuity checks settle it.

Which station addresses are valid for a Modbus RTU serial slave?

Serial Modbus RTU slave addresses run from 1 to 247. Address 0 is reserved for broadcast writes, which no slave answers, so it never works for a polled read. Every device on a multidrop needs a unique number, because two slaves set to the same address both fall silent. The station number the HMI enters must equal the number configured in the controller's port settings.

Why did the link pass on the bench but drop frames after installation?

A two-meter bench cable hides the problems that distance creates. On longer RS-485 runs, unterminated cable ends reflect the signal and corrupt frames, and the error rate climbs as the baud rate rises. Terminate both ends of the cable with the resistance the controller manual specifies, and stay inside the documented maximum length for the baud rate you are running.

Can a second HMI poll the same controller serial port?

Modbus RTU allows one master on a serial bus, so a second polling panel competes for the wire and both panels start showing intermittent timeouts. Give the second panel the controller's other serial port, move the panels onto a network instead, or use a gateway that owns the serial line and serves both panels from the network side.

Keep reading

  • Troubleshooting

    Connecting a Pro-face HMI to a Q02HCPU Over RS-232

    A Pro-face HMI and a Mitsubishi Q02HCPU communicate over RS-232 only when four things match: the Q-series driver in the HMI project, the exact port used (CPU or module), the cable wiring from both manuals, and identical serial settings on both ends. Verify all four from the documentation before changing any configuration.

    HMI and touchscreens

  • How-to

    Migrating an HMI serial connection from RS-232 to RS-485

    Yes — when the controller's RS-485 port already runs its built-in Modbus slave, rewire the pair and switch the panel's device entry to Modbus RTU two-wire with the same 115200 baud, even parity, 8 data bits and 1 stop bit; no PLC reprogramming. Verify A/B polarity before wiring, power-cycle the controller only if you change its port settings, and accept the migration when a known register returns a valid reply.

    HMI and touchscreens

  • How-to

    Connecting One HMI Panel to Two PLCs Over Serial

    Yes. A two-port panel — one RS-232-only port, one selectable RS-232/RS-485 port — runs two PLCs: one point-to-point link per port, or both PLCs as separately addressed slaves on the single RS-485 bus. Give each link its own cable, driver and matching serial settings, and prove one link before configuring the next.

    HMI and touchscreens