IMDTouchKnowledge BaseShop main store

How-to

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

HMI and touchscreens Published 8 min read

Short answer

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.

On this page
  1. Is reconfiguring the HMI panel all it takes to move to RS-485?
  2. Which serial settings must match at both ends?
  3. Do I have to rewrite the PLC program for the new port?
  4. How do I change the controller's serial settings when the defaults don't fit?
  5. Which conductor goes to A and which to B?
  6. Does a two-device link need termination and biasing?
  7. What does a lower baud rate cost in response time?
  8. What is the complete migration procedure?
  9. What proves the new RS-485 link works?
  10. Questions asked

Yes — when the controller's RS-485 port already runs its built-in Modbus slave, the move is a panel-side change: rewire the pair with verified polarity, switch the panel's device entry to Modbus RTU on two-wire RS-485, and change nothing else, so both ends keep the same serial parameters and the same register map. No PLC reprogramming is part of the move. The deciding test is a valid reply to a read of a register whose value you already know, on the new port. What follows gives the settings that must match, where the controller's port configuration lives, the polarity and termination decisions, the full procedure, and the arithmetic behind what a slower baud rate costs.

Is reconfiguring the HMI panel all it takes to move to RS-485? #

Yes, when the controller's RS-485 port already serves its built-in Modbus slave at 115200 baud, even parity, 8 data bits and 1 stop bit: rewire the pair, point the panel's device entry at Modbus RTU two-wire, and change nothing else.

Modbus does not care which electrical interface carries it. RS-232 is single-ended signalling referenced to a signal ground; RS-485 is the voltage difference between two conductors of one pair. The function codes, the slave address and the register map ride on either unchanged, which is why a physical-layer move is configuration work, not protocol work.

In the installation this migration follows, every serial port on the controller runs the same built-in Modbus slave at the same settings, so the RS-485 port answers exactly as the RS-232 port did — confirm that in the port documentation before you count on it. Once the first controller moves, the panel's freed RS-232 port serves the second controller, and building the RS-232 Modbus cable between an HMI and a controller covers that side of the job. Keep the two links separate: each device entry stays bound to its own port. If both controllers had RS-485 and had to share one port, that would be a multidrop design instead, with each controller on its own slave address on one continuous pair.

Which serial settings must match at both ends? #

All five — baud rate, parity, data bits, stop bits and slave address — plus the physical interface selection: 115200 bit/s, even parity, 8 data bits, 1 stop bit in this installation, with the HMI's target address equal to the controller's configured slave address.

Setting Value that must match Where it is set
Baud rate 115200 bit/s, or one lower rate chosen at both ends Controller port configuration and HMI device entry
Parity Even Both serial configurations
Data bits 8 Both serial configurations
Stop bits 1 Both serial configurations
Interface RS-485, two-wire Panel device entry and controller terminals
Slave address Same value at both ends Controller Modbus configuration and HMI target
Protocol Modbus RTU Panel driver selection and controller slave service

The interface choice is a setting too: a panel that carries both ports makes you pick RS-232, RS-485 two-wire or four-wire per device entry, and the wrong pick behaves exactly like a wiring fault. Parity is the quiet mismatch — the panel transmits, the slave discards the frames, and you see a timeout rather than wrong values; why a Modbus RTU link fails with even or odd parity works one such case end to end.

Do I have to rewrite the PLC program for the new port? #

No — moving the port or changing the baud rate is configuration, not code, as long as the built-in Modbus slave service owns the port; rewrite only when you must change which data the Modbus commands can reach.

Approach Configured in Choose it when It costs you
Built-in Modbus slave The controller's web pages, Hardware Setup Keeping the existing register map while the port, baud or framing changes Matching the HMI settings and a controller power cycle
Program-managed slave The PLC program, using the documented serial-port and Modbus-slave function blocks (SysSerialPort and ModbusSlave_v1 in this family) You must control the register offsets and the buffer area the commands reach Port ownership, slave setup and data mapping written and tested in code

The decision for this migration is the built-in service: the register addresses the screens already use stay valid, and nothing in the program changes. Reaching for the function blocks buys control you do not need here and adds code that must then be maintained.

How do I change the controller's serial settings when the defaults don't fit? #

Through the controller's web configuration pages: browse to its IP address, open Hardware Setup, set the port's baud, parity, data and stop bits, apply, then switch the controller off and on — the power cycle is what activates the new port settings.

On models without Ethernet, the same pages are reached over USB with the RNDIS driver, following the manufacturer's access instructions; log in with the credentials the controller documentation assigns. The power cycle stops the controller's program, so do it with the machine in a safe state, never mid-cycle.

Which conductor goes to A and which to B? #

Connect negative to negative and positive to positive, and treat the printed letters as hints only: the RS-485 standard marks A as the negative terminal and B as the positive one, but manufacturers label both ways, so settle each end from its own manual before wiring.

What decides is the polarity the transceivers expect, not the letters beside the screw. When one device marks its terminals D+ and D− and the other A and B, the two manuals settle it, not the alphabet. Run the pair as one daisy-chained trunk with short taps, polarity consistent along the whole run. A reversed pair yields a timeout, not wrong values: swap the two conductors at one end and retest.

No — a short two-device link inside one cabinet runs without termination resistors; fit them only at the two physical ends of a long multidrop trunk, and only with the resistance and bias values the interface documentation specifies.

On a short run the transceivers hold the line usable, and resistors added without checking what the network already carries only load the drivers. The long-run version follows the Modbus serial-line specification's cabling rules — daisy-chain trunk, consistent polarity, termination at the ends — with the values taken from the interface documentation of the actual devices.

What does a lower baud rate cost in response time? #

Six times the line time at 19200 bit/s versus 115200 bit/s: one single-register poll occupies the pair for about 2.1 ms at 115200 bit/s and about 12.6 ms at 19200 bit/s, counting both silent intervals the Modbus serial-line specification requires between frames.

Here is the arithmetic for one read of a single holding register, as a calculated serial minimum rather than a measured test. With even parity, 8 data bits and 1 stop bit, one character on the wire is 1 start + 8 data + 1 parity + 1 stop = 11 bits. The request is 8 bytes — address, function, register, quantity, CRC — and the response is 7 bytes — address, function, byte count, data, CRC — so 15 bytes × 11 bits = 165 bits per transaction. The specification delimits frames with silence of at least 3.5 character times, 38.5 bits here, and a poll cycle contains two of those gaps.

  • 165 bits ÷ 115200 bit/s = 1.43 ms of characters, plus 2 × 38.5 bits ÷ 115200 bit/s = 0.67 ms of silence: about 2.1 ms.
  • 165 bits ÷ 19200 bit/s = 8.59 ms of characters, plus 2 × 38.5 bits ÷ 19200 bit/s = 4.01 ms of silence: about 12.6 ms.
  • 115200 ÷ 19200 = 6, exactly the ratio of the two totals.

Device response time, the driver's polling interval, retries and the screen refresh rate all add on top of that minimum. The decision: lower the baud only when the cable run or the noise margin demands it, set the same rate at both ends — controller web pages and panel project — and raise the panel's response timeout by at least the same factor.

What is the complete migration procedure? #

Ten steps, and the last two are the test: record the working baseline, verify polarity, change the controller only if the defaults do not fit, rewire, reconfigure the panel's device entries, download, then prove each controller before the machine returns to service.

  1. Record the working RS-232 baseline: driver, port, serial settings, slave address, and the register list the screens use.
  2. Put the machine in a safe state; a controller power cycle is coming.
  3. Confirm from the port documentation that the RS-485 port runs the built-in Modbus slave, and note its terminal polarity.
  4. If any default must change, open Hardware Setup in the controller's web pages, apply the new port settings, and power-cycle the controller.
  5. Wire the two-wire pair negative-to-negative and positive-to-positive, daisy-chained, with no termination on this short link.
  6. In the panel project, set the first controller's device entry to Modbus RTU on the RS-485 two-wire port, with the settings from step 1 and the same slave address.
  7. Set the second controller's device entry to the panel's RS-232 port with that controller's settings.
  8. Download the project to the panel.
  9. Test the RS-485 controller first: read the known register and watch its screen object, then test the RS-232 controller the same way.
  10. When both reply with their own values, return the machine to service and file the final configuration with the machine documents.

A valid reply to a request for a register whose value you already know — not a number that merely changes on screen, and not a controller that still answers on its other services.

Put a distinct constant in a spare register of each controller and confirm each screen object reads its own value, because a moving number can come from the wrong controller or from a stale display. A timeout means the panel sent its request and decoded no reply within the configured window; with the settings matched and the polarity verified, work the serial path — fixing HMI Modbus device no response over RS-485 covers those checks — and treat it as a wiring or settings fault, not as evidence that the PLC program failed. If the controller still answers in its web pages while the panel times out, the program is running and the fault sits between the two connectors.

Questions asked

Does two-wire RS-485 need the signal ground that the RS-232 cable had?

No conductor from the old RS-232 cable carries over, except possibly as a shield. RS-485 reads the voltage difference between the two conductors of the pair, so the RS-232 signal-ground wire is not part of the signalling. If either device's documentation calls for a shield or a signal-reference conductor, land it on the terminal that document marks for it, never on the A and B pair.

Why does a reversed A/B pair show up as a timeout instead of an error?

Because two-wire RS-485 has no handshake to fail: the panel puts its request on the pair, the far receiver never decodes a valid frame, and the response window simply expires. Nothing comes back to interpret. With the serial settings already matched, swap the two conductors at one end and retest — reversed polarity is the first suspect on a freshly wired link.

Can both controllers share one RS-485 pair instead of using two panel ports?

Only if both controllers expose RS-485 and speak Modbus RTU: give them different slave addresses, daisy-chain one continuous pair, and point both device entries at that port. In this installation the second controller offers RS-232 only, so it keeps the panel's RS-232 port and the two links stay separate, each device entry bound to its own port.

When do the new settings take effect on each side?

On the panel, when the edited project is downloaded: the device entry's port, driver and serial parameters travel with the download. On the controller, after the web configuration is applied and the unit is switched off and on. Test once both ends hold the new settings, not between the two steps.

Keep reading

  • Troubleshooting

    Why an HMI Freezes or Updates Slowly Over Serial

    A panel-wide freeze or slow updates over serial is a link fault — driver, PLC port, wiring, or startup timing — not a screen-object fault. Test the two field-proven fixes first: a 10-second startup delay before the first poll, and a port set to four-wire RS-422 at 19,200 baud. Fix an isolated stale tag separately, by address and data type.

    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

  • How-to

    Connecting an HMI panel to an S7-300 MPI port with a PG

    Yes: wire the panel's RS-485 port to the CPU's MPI/DP port and run the Siemens S7 MPI driver, with no communication module. Put a PROFIBUS connector with a PG socket on that port, hang the PC adapter on the socket, give every node a unique address and one common baud rate, and STEP 7 stays online while the panel runs.

    HMI and touchscreens