System Overview
This reference documents the field architecture, gateway selection, and commissioning steps required to extend Modbus RTU communication from a Siemens SIMATIC S7-300 CP341 slave to an ABB AC500-class PLC acting as a Modbus TCP master over a total run of 1600 metres. The original installation uses an ABB PLC for plant-wide Modbus TCP OPC aggregation, while the field device cluster retains RS485 RTU on the CP341 for legacy reasons: existing shielded twisted-pair cable, FTAB-licensed Modbus slave function blocks in STEP 7, and validated I/O mapping. The 1600 m physical distance exceeds the TIA-485-A cable reach envelope at any standard Modbus baud rate, so a mid-span conversion device is required either as a true RS485 repeater/segmenter or as a media converter that re-emits the Modbus transaction as Modbus TCP on the Ethernet side facing the ABB PLC.
The CP341 in question is loaded with the Modbus Slave firmware license (CP 341 order number 6ES7341-1AH02-0AE0 or 6ES7341-1BH02-0AE0 depending on RS232/422-485 interface variant). The ABB master is expected to issue Modbus TCP requests on TCP/502 against the converter IP, and the converter in turn translates those requests into Modbus RTU frames addressed to the CP341 slave unit identifier. This reference consolidates the four viable converter choices raised in field discussions (Moxa MGate MB3170, Advantech ADAM-4572, Lantronix XPress-DR-IAP, and Siemens CP343-1 with Open ModbusTCP) and adds RS485 wiring, topology, and fault-diagnostics content drawn from ABB, Endress+Hauser, and Honeywell Modbus instrumentation manuals.
RS485 Physical Layer Limits at 1600 m
TIA-485-A specifies a maximum line length of 1200 m (4000 ft) between two 120 Ω termination resistors at data rates up to 100 kbit/s when using 24 AWG twisted pair with characteristic impedance of 100-120 Ω and a stub length below one-tenth of the unit interval. Above 100 kbit/s the cable loss budget becomes baud-rate dependent. The conservative field rule is:
| Baud Rate (bit/s) | Maximum Recommended RS485 Length | Typical Use |
|---|---|---|
| 1200 | 1200 m | Legacy, very robust |
| 9600 | 1200 m | CP341 default Modbus |
| 19200 | 1000 m | Moderate speed |
| 38400 | 750 m | Marginal |
| 115200 | 350 m | Short runs only |
A 1600 m link therefore cannot be run as a single RS485 segment at any practical Modbus baud rate. There are two industry-accepted solutions:
- Insert an RS485 repeater at the 800 m midpoint (e.g. Phoenix Contact PSI-REP-RS485/W2, Advantech ADAM-4510/ADAM-4520). Each segment then respects the 1200 m budget and the cable behaves as two isolated electrical segments sharing a common logic.
- Convert the medium at the midpoint: place a Modbus RTU-to-Modbus TCP gateway at 800 m, run Ethernet (CAT 6, fibre, or industrial wireless) for the remaining 800 m to the ABB PLC. The gateway terminates the RS485 segment and presents a Modbus TCP server on Ethernet.
Because the user explicitly requested a repeater-cum-converter rather than a transparent electrical repeater, the converter-at-midpoint topology is the target architecture in this reference. The RS485 segment stays bounded at 800 m, well inside the TIA-485-A budget for 9600-19200 bit/s, while the second 800 m hop is run on Ethernet, where 100 m copper limits per segment are irrelevant because industrial Ethernet can use fibre or managed copper extenders.
CP341 Modbus Slave Constraints
The CP341 in Modbus Slave mode exposes the following field-relevant constraints:
- Physical interface: RS485 half-duplex (2-wire) on variant 6ES7341-1BH02-0AE0, RS232 on -1AH02. The RS485 variant is required for the multi-drop field installation.
- Protocol: Modbus RTU (8-N-1 or 8-E-1) only; ASCII is available but rarely used on CP341.
- Baud rates: 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 76800, 115200 bit/s.
- Function codes supported in slave mode: 01, 02, 03, 04, 05, 06, 15, 16.
- Addressing: 1-based for the STEP 7 DB layout, mapped transparently to Modbus addresses 0-based on the wire.
- Timing: CP341 response delay (turnaround) is configurable from 0 to 65535 ms. Default 0 ms. Set this to at least 5 ms when a gateway in RTU-master mode is in front of the CP341 to avoid premature frame detection.
- Buffer length: up to 4096 bytes per PDU; in Modbus mode the application buffer is sized at commissioning via the Modbus Slave FB parameters.
ABB Modbus TCP Master Requirements
The ABB master side is typically implemented on an AC500 platform (PM571/PM581/PM582/PM590/PM591) with the onboard Ethernet port or a CM564-ETH communication module. ABB provides Modbus TCP client/server support either through:
- The AC500 Modbus TCP library on the Control Builder Plus / Automation Builder IDE.
- An OPC DA/UA server bridging to Modbus TCP (e.g. ABB OPCServer, Matrikon OPC, Kepware).
Regardless of the upstream interface, the ABB PLC expects to:
- Open a TCP connection to the gateway IP on port 502 (default Modbus TCP well-known port).
- Issue a Modbus request PDU wrapped in an MBAP header (transaction ID, protocol ID 0, length, unit identifier).
- Receive the response within a poll timeout typically configured at 1000-3000 ms.
The unit identifier in the MBAP header is the bridge to the CP341 slave address. Most gateways default to mapping unit ID 1 to the only slave on the RS485 side; verify that the CP341 Modbus Slave FB has Modbus Address = 1 or remap as needed.
Architecture: Mid-Span Converter Placement
The recommended topology places the gateway at the electrical midpoint, 800 m from each end. The gateway in this configuration runs in two roles that are not simultaneous:
- RS485 side: Modbus RTU master (because the CP341 is the slave and a master must poll it).
- Ethernet side: Modbus TCP slave (because the ABB PLC is the master and the gateway answers it).
If the gateway only supports a transparent bridge mode (TCP server ↔ serial slave), then the ABB master still has to issue Modbus RTU frames by routing through the gateway as if the CP341 were attached locally. This works on the Moxa MGate MB3170 and Advantech ADAM-4572 in their default RTU Master ↔ TCP Slave mode and is the most common field deployment. Lantronix XPress-DR-IAP in "Tunnel" mode can also be configured this way, although Lantronix's strength is mode 1 (master on serial, slave on TCP) where the device actively polls.
Gateway Comparison and Selection
| Device | Mode | Ethernet | Serial | Configuration | Field-Proven Use |
|---|---|---|---|---|---|
| Moxa MGate MB3170 | RTU M/S ↔ TCP M/S, transparent, agent | 10/100BaseT, 1 port | RS232/422/485, 1 port | Web, MGate Manager, Telnet | Yes, oil & gas, water |
| Moxa MGate MB3270 | Same as MB3170 + dual serial | 10/100BaseT, 1 port | 2 ports (Daisy-chain) | Web, MGate Manager, Telnet | Yes, redundant polls |
| Advantech ADAM-4572 | RTU M/S ↔ TCP M/S | 10/100BaseT, 1 port | RS232/422/485, 1 port | Web, ADAM.NET Utility | Yes, factory automation |
| Lantronix XPress-DR-IAP | Tunnel, Modbus RTU ↔ TCP gateway | 10/100BaseT | RS232/422/485, isolated | Web, Lantronix DeviceInstaller | Yes, rugged outdoor |
| Siemens CP343-1 + Open ModbusTCP | Requires S7-300/400 station | Profinet/TCP | n/a | TIA Portal / STEP 7 | Only if replacing CP341 |
Selection guidance:
- Pick Moxa MGate MB3170 for the default CP341-to-ABB scenario. It has explicit master/slave mode selection, very robust web UI, and a 10-year hardware lifecycle typical for industrial gateway suppliers.
- Pick Advantech ADAM-4572 when the customer standardises on Advantech ADAM-4000 I/O and already uses the ADAM.NET utility stack for commissioning.
- Pick Lantronix XPress-DR-IAP when the gateway must be installed in a high-vibration, outdoor, or extended-temperature cabinet. Industrial-rated (-40 °C to +70 °C) and isolated serial port.
- Pick CP343-1 + Open ModbusTCP only if the S7-300 station can host a CP343-1 and the user is willing to migrate the CP341 Modbus slave code to an Open ModbusTCP server on the S7. The 341 hardware stays for legacy I/O but the Modbus transaction becomes TCP-native at the S7-300 end.
Moxa MGate MB3170 Configuration
The MB3170 firmware revision 3.x or later is required for full transparent bridging with per-request unit-ID mapping. Order number: MB3170-T for wide-temp (-40 to 75 °C), MB3170 for standard temp.
- Wire RS485 to the DB9-M serial port: pin 1 = Data+ (D+), pin 2 = Data- (D-), pin 5 = SGND. Connect shield to chassis ground at one end only (gateway end preferred).
- Set the DIP switch on the bottom of the unit to RS485 2-wire (position 1 ON, position 2 OFF, position 3 OFF). Termination resistor (120 Ω) is enabled by DIP switch 4 ON.
- Apply 12-48 VDC on the removable terminal block. Verify the PWR LED is solid green.
- Set the laptop to
192.168.127.254 / 24and connect to the gateway's Ethernet port. Open the web UI athttp://192.168.127.253(default). - In Network Settings, assign the static IP that the ABB PLC will poll, e.g.
192.168.10.50/24, gateway192.168.10.1. - In Serial Settings: baud 9600, parity none, data 8, stop 1, interface RS485 2-wire, flow control none.
- In Modbus Mode: select RTU Master ↔ TCP Slave. Add a Slave rule with IP 0.0.0.0 (any) and unit ID 1 mapping to slave address 1 on RS485.
- Set Response Timeout to 1000 ms and Inter-Character Timeout to the Modbus standard of 3.5 character times (e.g. 4 ms at 9600 bit/s).
- Save, restart the gateway, and watch the MB3170 LEDs: P1 (serial) flashes green on each transaction, P2 (Ethernet) flashes on TCP exchanges.
Advantech ADAM-4572 Configuration
Advantech ADAM-4572 (and successor ADAM-4572L) is a single-port RS232/422/485-to-Ethernet Modbus gateway with browser-based configuration. It is widely used in factory automation panels.
- Wire the RS485 terminals:
D+ / D- / SGNDon the detachable terminal block. Insert 120 Ω termination if the gateway is the segment end (DIP switch SW1 position 1 ON). - Power the gateway with 10-30 VDC on the same terminal block (V+/V-). Status LED "Link" should turn green.
- Default IP is
10.0.0.1/8. Set laptop to10.0.0.2/8and accesshttp://10.0.0.1in the browser. Default useradmin, password00000000. - In Network: assign the static IP for the ABB PLC network. Note: the ADAM-4572 supports only one Ethernet port, so it cannot bridge two IP subnets without a router.
- In Serial: match the CP341 settings exactly (baud, parity, data bits, stop bits). Set interface to RS485 2-wire.
- In Modbus Gateway: select RTU Master mode, add the CP341 as Slave ID 1, set TCP Port 502.
- Configure the inter-frame timeout as 3.5 character times. ADAM-4572 calls this "Character Timeout" and exposes it in milliseconds.
- Save and reboot. Verify traffic in the Diagnostic page: Tx/Rx counters should match the ABB OPC poll rate.
Siemens CP343-1 + Open ModbusTCP Path
The Siemens alternative to a third-party gateway is to use a CP343-1 Ethernet communication processor in the same S7-300 rack as the CP341, and to load the optional Open ModbusTCP software package on the CPU. The CP341 then remains as a Modbus RTU slave to local I/O, while the CP343-1 becomes a Modbus TCP server for the ABB PLC. Note that this does not make the CP341 itself reachable on TCP; it merely moves the gateway function inside the S7-300 station.
- Verify that the S7-300 station has a CP343-1 (typical article 6GK7343-1EX30-0XE0 for 1-port, or 6GK7343-1CX10-0XE0 for the more recent 6GK7343 variant) installed and connected to the plant Ethernet.
- Order the Open ModbusTCP license (article 6AV6676-6MB30-0AX0 or the current licence package) and install via SIMATIC Automation Tool / Automation License Manager.
- In STEP 7 / TIA Portal, instantiate the MODBUS_PN FB block, configure CP343-1 as the Modbus TCP server, and bind the same DB that the CP341 Modbus slave FB writes into. This gives the ABB PLC direct register access without converting protocols at a separate box.
- Set the CP343-1 IP, subnet mask, and gateway. Disable any router restrictions that would block TCP/502 from the ABB PLC subnet.
- From the ABB master, poll
CP343-1-IP:502. Use Modbus function codes 03 / 04 / 06 / 16 to read/write holding registers.
Lantronix XPress-DR-IAP Path
The Lantronix XPress-DR-IAP is a rugged industrial device server with isolated RS232/422/485 and Modbus RTU-to-TCP bridging firmware. It is rated -40 °C to +70 °C operating, 5-30 V DC, and is suited to outdoor cabinet or rooftop installations.
- Wire the RS485 terminals on the XPress-DR-IAP: pin 2 = TX/RX+, pin 3 = TX/RX-, pin 7 = SGND. Enable 120 Ω termination in the web UI (Modbus Settings → Termination).
- Apply 5-30 V DC. Wait 30 s for boot. Status LED "Link" solid and "Status" blinking 1 Hz indicates ready.
- Use Lantronix DeviceInstaller on a laptop to discover the gateway. Default IP is on the 169.254.x.x link-local subnet (Lantronix default). Log in to the web UI (user
admin, password is the device serial number printed on the label). - In Network: assign the static IP for the ABB PLC subnet. Disable DHCP.
- In Modbus/RTU Settings: baud 9600 8-N-1, RS485 2-wire, inter-character timeout 4 ms (3.5 chars at 9600).
- In Mode: select Modbus RTU ↔ Modbus TCP Gateway (Master on Serial). This is the equivalent of the Moxa "RTU Master ↔ TCP Slave" mode.
- Configure the local Modbus slave address (CP341) = 1, the TCP port = 502.
- From the ABB OPC server, poll
XPress-DR-IAP-IP:502.
RS485 Wiring, Termination, and Shielding
All four gateways share a common RS485 implementation, so the wiring rules are identical regardless of which box is installed:
| Item | Specification | Notes |
|---|---|---|
| Cable type | Shielded twisted pair, 24 AWG typical, 100-120 Ω characteristic impedance | Belden 3106A, Lapp ETHERLINE, or equivalent |
| Topology | Daisy-chain, max stub length = 1/10 of unit interval | No stars, no T-taps beyond 1 m |
| Termination | 120 Ω at both segment ends only | CP341 end and gateway end; never in the middle |
| Bias | 680 Ω pull-up to 5 V on D+, 680 Ω pull-down on D- | Provided by gateway; CP341 also has internal bias on -1BH02 variant |
| Shield | Bonded to chassis ground at one end only | Use EMC glands at cabinet entries |
| Max nodes | 32 unit loads per segment | CP341 = 1 unit load, gateway = 1 unit load; 30 spares |
Network Topology and IP Planning
The Ethernet side of the gateway must coexist with the ABB PLC's existing plant network. Recommended addressing plan:
| Device | IP Address | Subnet | Default Gateway |
|---|---|---|---|
| ABB AC500 PLC | 192.168.10.10 | 255.255.255.0 | 192.168.10.1 |
| Modbus gateway (MB3170 / ADAM-4572 / XPress-DR-IAP) | 192.168.10.50 | 255.255.255.0 | 192.168.10.1 |
| Engineering laptop | 192.168.10.99 | 255.255.255.0 | 192.168.10.1 |
| Plant router / managed switch | 192.168.10.1 | 255.255.255.0 | n/a |
Open TCP/502 from the ABB subnet toward 192.168.10.50:502 on the managed switch's ACL. If the plant uses VLANs, place the gateway in the same VLAN as the ABB PLC or trunk with explicit ACL rules. Keep management ports (HTTP 80, HTTPS 443, Telnet 23) on a separate VLAN or block them at the firewall because the gateway default passwords are widely known.
Commissioning Procedure
- Pre-power checks. Verify RS485 cable continuity with a multimeter (D+ to D+ should read ~100-120 Ω across the segment, indicating two 120 Ω terminators in parallel). Verify shield continuity and one-end-only ground bond.
- Gateway IP assignment. Connect laptop to gateway, set static IP out-of-the-box (e.g. Moxa default 192.168.127.253), configure plant IP via web UI, reboot.
- Serial settings. Set baud, parity, data, stop to match CP341. Confirm RS485 2-wire DIP switch. Confirm 120 Ω termination.
- Modbus mode. Set "RTU Master ↔ TCP Slave". Add slave rule with unit ID 1, slave IP 0.0.0.0 (any), TCP port 502.
-
Inter-character timeout. Calculate at the chosen baud rate:
Set gateway inter-character timeout to 4 ms at 9600 bit/s. Lower values cause spurious frame aborts; higher values slow polling.T_char = 11 bits / baud = 11 / 9600 = 1.146 ms T_interframe = 3.5 * T_char = 4.01 ms - CP341 Modbus Slave FB. In STEP 7, set Modbus address = 1, response delay = 5 ms, hold-off = 50 ms.
-
Test loop. From a Windows host running
mbpollor Modbus Poll tool, connect togateway-IP:502and read holding register 0 (FC 03). Verify the CP341 returns the expected value. -
ABB integration. In ABB Control Builder / Automation Builder, instantiate the Modbus TCP client FB, point it at
192.168.10.50:502, and bind to OPC tags. Monitor the OPC tag quality; it should go to Good within 5 s.
Troubleshooting Matrix
| Symptom | Likely Cause | Diagnostic Step | Remediation |
|---|---|---|---|
| No TCP connection from ABB to gateway | ACL / firewall / wrong IP | From ABB ping 192.168.10.50; telnet 192.168.10.50 502
|
Open TCP/502 on managed switch / Windows firewall |
| TCP open, no Modbus responses | Mode mismatch (gateway set to slave on serial) | Check gateway web UI Modbus mode | Switch to "RTU Master ↔ TCP Slave" |
| Intermittent timeouts at 38400+ | Baud too high for 800 m cable | Drop to 9600 and retest | Replace cable with lower-capacitance type or add RS485 repeater |
| CRC errors in gateway log | Termination only on one end, or bias missing | Inspect D+/D- with scope for ringing | Add 120 Ω at both ends, enable bias in gateway |
| Response timeout (CP341 doesn't reply) | CP341 Modbus Slave FB not running | STEP 7 online → monitor DB; check OB1 call of FB | Load STEP 7 project and restart CP341 |
| Unit ID mismatch (response for wrong slave) | Gateway Unit ID mapping incorrect | Set Modbus Poll unit ID = 1, then = 2 | Adjust unit-ID mapping in gateway Modbus rules |
| OPC quality = Bad after link-up | ABB poll timeout too short, gateway response latency | Check gateway response latency stat | Raise ABB poll timeout to 3000 ms; check inter-character timeout |
| ABB sees stale data after CP341 reboot | Gateway caches last response | Disable "Response Cache" in gateway | Set "Pass-through" or "Discard on error" mode |
| All polls return Exception 02 (illegal data address) | CP341 DB offset / address mapping wrong | Verify STEP 7 Modbus Slave FB DB number & offset | Align DB layout to Modbus address space expected by ABB |
| LEDs all off on gateway | Power supply reversed or under-voltage | Measure V+ V- at gateway terminal | Use 24 V regulated supply, observe polarity |
Verification and Acceptance Test
Before signing the loop into production, run the following checks and record the results in the loop folder:
- Cable test. With gateway powered down, measure resistance D+ to D- at the gateway end: 60 Ω nominal (two 120 Ω in parallel), confirming both terminators are present. Reading > 130 Ω indicates a missing terminator; reading < 50 Ω indicates a short.
- Bias test. With gateway powered and CP341 powered, measure D+ to SGND: should be > 200 mV (idle high). Measure D- to SGND: should be < -200 mV (idle low). This confirms bias resistors are functional.
- Round-trip latency. From Modbus Poll on the engineering laptop, read 10 holding registers and record the request-to-response time. Expect < 50 ms at 9600 bit/s with one CP341 slave.
- Soak test. Run continuous polling at the configured ABB OPC rate for 1 hour. Capture gateway diagnostic counters: Tx, Rx, CRC errors, timeouts. Acceptable: 0 CRC errors, < 0.1% timeouts.
- Failover test. Power-cycle the CP341. Confirm the gateway returns Exception / Timeout gracefully (no ABB OPC card crash) and recovers within 5 s of CP341 returning.
- Network test. Disconnect the Ethernet cable at the gateway. Confirm ABB OPC quality goes Bad. Reconnect, confirm quality returns to Good within 5 s.
For Modbus instrumentation integration context (mass flow, pressure, gas volume), review the ABB LVS Digital with UMC motor controller Interface Manual Modbus for ABB's own Modbus register conventions, the Endress+Hauser Proline Promag 53 Modbus RS485 operating instructions for vendor-specific function code behaviour typical of RS485 field devices, and the Honeywell EK205 volume converter operating instructions for diagnostic and exception-code mapping on Modbus RTU slaves sharing the same CP341 bus.
What is the maximum RS485 cable length without a repeater at 9600 bit/s?
1200 m (4000 ft) per TIA-485-A. The 1600 m link in this reference requires a mid-span repeater or media converter at approximately 800 m.
Does the Siemens CP341 support Modbus TCP natively?
No. The CP341 is a serial-only module supporting Modbus RTU (and ASCII on certain firmware) over RS232, RS422, or RS485. To expose the CP341 data as Modbus TCP you need an external gateway or a CP343-1 with the Open ModbusTCP software package on the same S7-300 station.
Which Moxa gateway mode maps CP341 as slave behind an ABB TCP master?
Use RTU Master ↔ TCP Slave mode (also called "Master on serial" in MGate Manager). Add the CP341 as Slave ID 1 with IP 0.0.0.0 and TCP port 502. The gateway actively polls the CP341 on the RS485 side and answers the ABB OPC polls on the Ethernet side.
What termination resistor value do I install on RS485?
120 Ω at both segment ends only. Never in the middle of a daisy-chain. Enable it in the gateway via DIP switch (MB3170 / ADAM-4572 / XPress-DR-IAP all support 120 Ω terminator activation in hardware or web UI).
How do I calculate the inter-character timeout for Modbus RTU?
T_char = 11 bits / baud_rate. T_interframe = 3.5 × T_char. Example at 9600 bit/s: T_char = 1.146 ms, T_interframe = 4.01 ms. Configure the gateway inter-character timeout to the nearest integer ms above this value (4 ms).
Can I use the same gateway for multiple CP341 slaves on the RS485 side?
Yes. Configure each CP341 with a unique Modbus slave address (1-247) and add one slave rule per address in the gateway Modbus table. The Moxa MB3170 supports up to 256 Modbus commands; the MB3270 doubles the serial ports and is recommended when the ABB OPC tag database exceeds 256 polls.