IMDTouchKnowledge BaseShop main store

How-to

Wiring an M221 PLC to an HMI over RS-485

HMI and touchscreens Published 5 min read

Short answer

Bridge SDA to RDA and SDB to RDB at the HMI connector and run the junctions to M221 RJ45 pin 5 (D0) and pin 4 (D1), with ground as the third wire. Two wires on the panel's pins 1 and 2 leave one direction of the pair open; join the pairs, match the serial settings on both ends, and the link comes up.

On this page
  1. The two ports you are joining
  2. Build and verify the cable
  3. Match the serial settings on both ends
  4. When the link still stays silent
  5. Prove the link end to end
  6. Questions asked

Bridge SDA to RDA and SDB to RDB at the HMI connector, then run those two junctions to the PLC: pin 5 of the M221's serial line RJ45 is D0 and pin 4 is D1, so the SDA-RDA junction lands on pin 5, the SDB-RDB junction on pin 4, and ground is the third wire. The two wires you have on pins 1 and 2 of the panel's D-sub leave one direction of the link open, and that is why the connection never starts. RS-485 (TIA/EIA-485) two-wire carries both directions on a single differential pair; the panel splits that pair into separate transmit and receive terminals, and they must be joined before it can share a line with a port that presents one pair.

The two ports you are joining #

The panel here is a Magelis GXU3512, and the method holds for any HMI whose serial port brings the four signals out separately: SDA/SDB as the transmit pair and RDA/RDB as the receive pair on the 9-way D-sub. The PLC side is the M221's serial line RJ45, which presents one pair plus ground: pin 5 is D0 and pin 4 is D1. Schneider wires this controller's RS-485 with three conductors, D1, D0 and ground, so take the ground pin number from the pinout table in the controller's wiring guide and land it on the panel's signal ground.

Two things to read rather than assume: which D-sub pins actually carry SDA, SDB, RDA and RDB, because the pins 1 and 2 in use now are to be verified, not trusted; and whether the panel port has a mode selection that must be set to RS-485, as a switch or a configuration item, before the port behaves as a two-wire port.

HMI connector Junction in the panel plug M221 serial line RJ45
SDA bridged to RDA one wire from the junction pin 5 (D0)
SDB bridged to RDB one wire from the junction pin 4 (D1)
signal ground direct ground pin per the wiring guide

Build and verify the cable #

Power both devices down before you make or change any of these connections.

  1. Identify pin 1 of the RJ45 from the wiring guide's figure, not from the latch orientation, and locate pins 5 and 4 from it.
  2. Ohm out the cable before you crimp the D-sub: pin 4 must reach only the conductor you intend for D1, pin 5 only the D0 conductor, and no conductor may short to the other or to the shield.
  3. Judge the readings against the run you actually built. Example: a 15 m run of 24 AWG shielded twisted pair. 24 AWG copper is about 0.084 ohm per meter, so each conductor should read 15 m x 0.084 ohm/m = 1.26 ohm end to end, plus 0.1-0.3 ohm of meter leads; accept anything under about 1.6 ohm. Between the two conductors, and from either conductor to the shield drain, expect an open circuit on a typical meter.
  4. Record the four panel pin numbers from the panel's hardware guide on the wiring sheet, and set the port to RS-485 mode where the model offers the selection.
  5. Fit the two jumpers in the panel's plug: SDA to RDA, and SDB to RDB. The bridges live at the panel end because the M221 already presents a single pair on its pins 4 and 5.
  6. Build with one twisted pair for the two junction wires so D0 and D1 stay twisted along the whole run, add the ground conductor, then check the finished cable: SDA-RDA junction continuous to pin 5, SDB-RDB junction continuous to pin 4, the two junctions isolated from each other and from the shield.

Match the serial settings on both ends #

Correct wiring still fails when the framing differs, and the cable does not fix any of these values. Read them from the M221's serial line configuration in the programming software and enter the same values in the panel project.

Parameter M221 side HMI side
Baud rate serial line configuration communication driver settings
Parity, data bits, stop bits serial line configuration communication driver settings
Protocol and slave address serial line configuration equipment address in the project

Set the M221 line to the protocol the panel's driver speaks; Modbus RTU is the usual choice for this pairing, and you confirm it in both projects. Enter the identical framing and the same slave address, then download both projects. The panel polls as Modbus master and the M221 answers as slave; two masters on one line is a silent failure, the one behind an HMI Modbus timeout caused by a PLC master-slave conflict.

Change one thing at a time and retest after each change:

  • Polarity. A swapped pair gives a silent link with no frames on the wire. Swap the two signal wires at one end only, because swapping both ends changes nothing.
  • Termination. Enable it at the two physical ends of the bus only, with the switches or jumpers the hardware guides describe; 120 ohm matches the nominal impedance of RS-485 twisted pair and is the value those guides use. Mid-span devices stay unterminated.
  • Shield. Ground the shield at one point only, per the hardware guides, to keep ground loops out of the pair.
  • Port conflict. Confirm no other function in the M221 project is assigned to the same serial line.

If the wiring and the settings both verify and the panel still times out, work through the wider checks in fixing an HMI PLC communication timeout over serial.

  1. Display a numeric field bound to a PLC word you can change from the programming software online, and confirm the value follows within the polling interval.
  2. Write from the panel to a different PLC word and read the value back in the online view.
  3. Pull the cable at the PLC end: the panel should raise its communication-lost indication; reconnect and confirm the indication clears without a restart.

Accept the link when reads and writes work in both directions and recovery is automatic. If a step fails, the fault is in the wiring, the settings or the port assignment, not in the bridge itself, which is fixed by the two ports you are joining.

Questions asked

Can the M221's serial port power the HMI?

The controller's serial line RJ45 can deliver 5 V at 200 mA, which its documentation describes as a supply for an HMI or a Bluetooth adapter. Treat that as an accessory supply, not a panel supply: power a full operator terminal from the supply its own hardware guide specifies.

Does pin 5 stay D0 if I add a TMC2SL1 cartridge for a second port?

The pin 5 (D0) and pin 4 (D1) assignment belongs to the built-in serial line RJ45. The TMC2SL1 cartridge adds a second Modbus RTU port, and its connector has its own wiring guide. Read the pinout from that document before crimping anything rather than copying the built-in port's numbers.

Can I wire a second HMI onto the same two wires?

Electrically the pair is a multidrop bus, but only one master may poll it. A second panel wired straight onto the same pair would be a second Modbus master, and the two would collide on the line. Serve extra readers as slaves behind the single master, or give the second station its own port or an Ethernet link.

Why does my bench cable work with no termination?

A short run reflects little energy, so an unterminated bench cable can pass. That pass proves nothing about the installed length: enable the termination at the two physical ends, 120 ohms on this kind of twisted pair, when you fit the final cable, and leave mid-span devices unterminated.

Do I need the ground wire on a two-wire RS-485 link?

Yes. This controller's RS-485 wiring is three conductors: D1, D0 and ground. The ground gives both receivers a common reference and holds them inside their common-mode range; without it a link can frame correctly on the bench and throw random errors once the run lengthens or passes other equipment.

Keep reading

  • 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

  • Troubleshooting

    Fixing PLC not responding between an HMI and a CQM1

    The alarm means the panel's request never returned from the CQM1. Set the panel port to RS-232C, verify the 2-2, 3-3, 5-9 cable with pin 1 open, match the CQM1's Host Link defaults of 9600 baud, 7 data bits, 2 stop bits and even parity, and reserve the panel's system start address from the PLC program.

    HMI and touchscreens

  • Troubleshooting

    FX3GE RS422 to HMI wiring fix for no response

    Wire HMI COM1 receive to the FX3GE transmit pair, the HMI transmit pair to the PLC receive pair with matching polarity, and land signal ground on PLC pin 5. The failed map had the transmit pair reversed and ground on pin 3; the crossed, polarity-matched map with ground on pin 5 restored communication.

    HMI and touchscreens