IMDHMIControls LibraryShop main store

How-to

Modicon M340 serial Modbus RTU connection to an HMI

Industrial networks Published 7 min read By IMDHMI controls team

Short answer

The BMXP341000's built-in serial port runs Modbus RTU as a slave, so a TP1200 Comfort connects to it directly as the Modbus RTU master over a documented serial cable. Match the HMI driver, station address, baud, parity and stop bits to the PLC port, then prove the link with one readable holding register; an Ethernet cable cannot carry this link.

On this page
  1. What the M340 serial port runs
  2. Confirm driver and port before cutting a cable
  3. Wire the documented cable
  4. Commissioning sequence
  5. Size the timeout from the transaction arithmetic
  6. Read the first failures
  7. The decision
  8. Questions asked

Yes, the link works directly. The BMXP341000's built-in serial port runs Modbus RTU as a slave, and the panel software ships a Modicon Modbus RTU channel for Comfort Panels, so a TP1200 Comfort talks to this PLC over one documented serial cable with no protocol conversion. An Ethernet cable cannot bridge the two: the M340's Ethernet interface runs Modbus TCP, a separate service, and no cable converts RTU framing into Ethernet. The work is in the details: the port must be configured for Modbus RTU rather than character mode, the electrical interface must match the cable, and station address, baud, parity and stop bits must be identical at both ends. Prove the link with one readable holding register before any tag reaches the process, and size the panel's response timeout from the transaction arithmetic in this article.

What the M340 serial port runs #

The embedded serial port on the BMXP341000 carries two services, Modbus RTU and character mode, selected in the PLC's hardware configuration; Schneider's Modicon M340 Serial Link user manual documents both. For HMI polling the roles are fixed by the protocol: the panel is the Modbus master (client) and the PLC is the slave (server), because a serial RTU segment allows exactly one master.

Name the governing standard: MODBUS over Serial Line, the V1.02 specification and implementation guide, requires one master per segment, valid slave addresses from 1 to 247, frames delimited by at least 3.5 character times of silence, and a default framing of 19200 bit/s with 8 data bits, even parity and 1 stop bit — 2 stop bits when parity is none. RTU names the message framing only. It says nothing about the connector, the pinout or the electrical interface, which is where this job actually goes wrong. If a second polling device might sit on the segment, resolve ownership first — the same single-master rule that governs how to poll many Modbus RTU slaves from one serial master is applied through a scheduler.

Confirm driver and port before cutting a cable #

Two independent checks decide between a direct link and a gateway.

Panel side: open the connection driver list for the configured panel in the engineering software. The WinCC connections documentation lists Modicon Modbus RTU among the channels available to Basic and Comfort Panels, and in WinCC Unified the protocol appears as Standard Modbus RTU in the Communication driver column. An Ethernet Modbus TCP driver does not establish serial RTU capability — if the channel is absent from the installed project's driver set, the direct link is off the table and a gateway is the only path.

PLC side: in the M340 hardware configuration, set the serial port protocol to Modbus RTU rather than character mode, and note its electrical mode, station address and framing there. Download and read the values back online; an offline project is not evidence of what the port is running. Record the station address now, because the panel connection will need the same number.

Wire the documented cable #

No pin schedule can be derived from the two product names. The M340 serial port's pinout is published per configuration, and Schneider documents a direct RS-232 cable for it under part number TCSMCN3M4M3S2 along with the pinout; use that cable or copy the published pinout conductor for conductor, with the shield terminated the way both manuals specify.

Check the electrical interface, not the connector shape. The port's configured mode, RS-232 or RS-485, must match the cable and the panel interface: RS-232 is a point-to-point set of paired signals, while RS-485 is a differential pair whose A and B polarity is defined in each manual and which is terminated at the two segment ends. A passive adapter cannot convert between the two, and an Ethernet patch cable carries nothing on serial pins even when the plug fits. RS-485 does allow more devices on the segment, but the single-master rule still decides who polls; How to Share One RS-485 PLC Port Between Multiple HMIs covers that case.

Commissioning sequence #

  1. Freeze process writes. Keep HMI command tags out of the project until reads are proven; the safety note at the end of this article is the reason.
  2. Configure the PLC port. Set the protocol to Modbus RTU, then the electrical mode, the station address and the framing in the M340 hardware configuration; download and read back online.
  3. Create the panel connection. Select the Modicon Modbus RTU channel, pick the panel's serial interface, and enter the PLC's station address as the destination.
  4. Match the framing. Enter the same baud, parity, data bits and stop bits at the panel that the PLC port reported online.
  5. Verify the cable. Continuity-check the documented pins end to end and confirm the shield lands where both manuals say.
  6. Add one read tag. Point it at a documented holding register: in the common four-digit convention, holding register 40001 maps to protocol address 0 for function 03 — check how your driver wants the offset entered before assuming.
  7. Go online and read. Watch the panel's connection status, then compare the tag against the same value in the PLC software while toggling a safely changeable test register.
  8. Expand deliberately. Add tags in groups, watch for timeouts as load grows, and prove one write to a designated test register before connecting any HMI command to machine operation.

Size the timeout from the transaction arithmetic #

Transactions, not tags, set the load. Take a read of two holding registers with function 03: an 8-byte request and a 9-byte response, 17 bytes total. At the default 19200 bit/s with even parity, each serial byte costs 11 bit times (1 start + 8 data + 1 parity + 1 stop), so the pair moves 17 x 11 = 187 bits, and 187 / 19200 bit/s = 9.7 ms on the wire. The standard's 3.5-character frame silence adds 3.5 x 11 = 38.5 bits = 2.0 ms, plus roughly a millisecond of slave turnaround, so one poll costs about 12.7 ms — near 80 such polls per second (1000 ms / 12.7 ms = 79). A screen of twelve single-register tags therefore needs 12 x 12.7 ms = 152 ms per sweep before the panel's own scan interval is counted, which is why a 500 ms response timeout is a workable example starting point, not a documented constant: measure the actual response, keep the timeout several multiples above it, and grow the tag count while watching for timeouts. What a serial port looks like when tags outrun it is exactly the case covered by why Modbus RTU drive polling on one serial port is slow.

Read the first failures #

What the panel shows What it means Where to look next
Timeout on every tag Requests or replies are not crossing One master on the segment, station address, electrical mode, wiring, framing
Garbled or intermittent messages Signal integrity, framing, or a second talker Error counters, shield routing, segment termination
Exception 02, illegal data address The PLC received the request but the register does not exist in its map Function code and the register range the slave actually holds
Valid link, wrong values Address offset or data representation 40001-versus-0 offset, 16- versus 32-bit tags, word order, scaling

Exception 02 is the Modbus illegal-data-address code: the request reached the PLC and the PLC rejected the address, so the fix is in the object type and offset, not the cable. Address-convention faults between an HMI and a PLC look the same on every protocol; Fixing Modbus TCP Addressing Errors Between an HMI and a PLC walks that fault over Modbus TCP. When the panel shows question marks or stale numbers instead of clean timeouts, the symptom-to-cause mapping in why HMI values show question marks when PLC comms time out is the faster path.

The decision #

Commit by case. Direct serial RTU is the design whenever three checks pass: the panel project has the Modicon Modbus RTU channel, the M340 port is configured as the RTU slave, and the electrical interfaces meet on a documented cable — TCSMCN3M4M3S2 or its published pinout for the RS-232 case. If the driver is missing, the design is a gateway with Modbus RTU on the PLC side and a panel-supported protocol on the other. If the electrical interfaces differ, the design is an active converter; a passive adapter will not do it. An Ethernet cable is never the answer to this link: it carries Modbus TCP or nothing.

One safety note: keep HMI writes out of the project until the link is proven against a readable test register — the first validated value is transport evidence, not permission to command the machine.

Questions asked

Can an Ethernet cable make this connection work?

No. The M340's Ethernet port runs Modbus TCP, a different service with its own addressing, and the RTU framing the panel driver sends over serial never crosses an Ethernet cable. If the project must stay serial, wire the documented serial cable; if Modbus TCP on the Ethernet port is acceptable instead, that is a separate connection with its own driver and address mapping, not a conversion of the serial link.

What framing should I set first on both ends?

Set the Modbus serial default first: 19200 bit/s, 8 data bits, even parity, 1 stop bit; with no parity the standard asks for 2 stop bits. Enter the same values in the PLC port configuration and the panel connection, download both, then read the settings back online rather than trusting an offline project.

Why does a 32-bit value come through scrambled when the link works?

Modbus registers are 16 bits wide and each register is transmitted high byte first, so a 32-bit value spans two consecutive registers and the driver's word-order setting decides which register the panel treats as the high word. Verify the tag against the PLC value online and switch the word order if the halves are swapped; scaling comes after the raw words read correctly.

Keep reading

  • Troubleshooting

    Why a DL05 Modbus RTU slave answers only with ODD parity

    Set the Modbus master to the DL05 port's factory combination of 9600 baud, ODD parity, 8 data bits and 1 stop bit, and the slave answers. Connect on Port 2 with the cable your programming software uses, keep a minimal program containing an END instruction in the PLC, leave the mode switch in TERM, and cycle to RUN and back if the port stays dead.

    Industrial networks

  • Troubleshooting

    Why CM1241 RS485 A/B polarity stops Modbus RTU slave replies

    Your communication-load instruction completing with DONE true and STATUS 16#0000 for one cycle proves the port initialized; the blinking Rx LED proves only that differential activity reaches the CM1241. With A and B swapped, every request fails framing and CRC, so the slave stays silent. Swap the pair at the adapter, then match baud, parity, stop bits and slave address.

    Industrial networks

  • Troubleshooting

    Configure an S7-200 HMI connection in TIA Portal correctly

    The S7-200's port runs PPI, the RS-485 protocol it was built with; MPI is the PROFIBUS-based protocol of the larger S7 CPUs and the two are not interchangeable. Configure the panel in TIA Portal with the S7-200 connection its driver list documents, set the panel's rate equal to the CPU's configured port rate, and give every station a unique address.

    Industrial networks