Troubleshooting Modbus RTU Delays: S7-300 CP 341 and Foxboro DCS

David Krause15 min read
ModbusSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

1. Problem Overview

Field installations pairing a Siemens SIMATIC S7-300 with a Foxboro I/A Series DCS over Modbus RTU frequently exhibit two symptoms that engineers describe as a "tie delay" or "stale data" between the controllers:

  • The data exchanged through a CP 341 (RS-485/422 or RS-232 point-to-point module) updates inconsistently, sometimes lagging the actual process value by 2 to 30 seconds.
  • Spikes in the inter-message gap appear in the trace, even though no hardware fault is present, no parity error is logged, and the CP 341 SF/LED does not flag a communication error.

These symptoms are almost always the result of scan-time starvation on the DCS side, conservative default poll rates on the Foxboro Modbus master, or sub-optimal CP 341 parameterization. They are not caused by a defective CP or by STEP 7 itself. The remainder of this article walks through the diagnostic methodology, the parameter changes, and the verification procedure that resolves the issue.

Scope. This reference applies to CP 341 (order numbers 6ES7341-1AH01-0AE0 for RS-232, 6ES7341-1BH01-0AE0 for RS-485/422, 6ES7341-1CH01-0AE0 for RS-485 only) operating as a Modbus RTU slave against a Foxboro FCP270 or compatible station with a Modbus RTU master function block (typically in the FBM217 / FBM218 / CP30 chain or in an I/A Series 100/200 series block).

2. System Architecture and Components

Before any timing analysis can be performed, the physical and logical topology must be confirmed. The architecture assumed in this article is shown below.

Foxboro I/A DCS FCP270 Station Modbus Master FBM FBM217 / CP30 Port: COMx (RS-485) Default poll: 1000 ms Term: 120 Ω on RS-485 shielded CP 341 (6ES7341-1BH01) DIP switches: slave PTP parameter set: Modbus Baud: 19200 8E1 Inter-frame: 3.5 char DB100 (send / receive) Backplane (MPI/PROFIBUS) S7-300 CPU 315-2 DP OB1 scan FB7/FB8 calls DB100..DB110

Key items that must be confirmed in SIMATIC Manager → HW Config and on the DCS side:

Parameter Verify at S7-300 Verify at Foxboro DCS
Master / Slave role CP 341 set to slave (DIP 1=ON on 6ES7341-1BH01) FBM block configured as Modbus master
Physical layer RS-485 two-wire or four-wire FBM port strapped for RS-485
Baud rate Must match DCS exactly 19200 / 38400 typical
Parity / data / stop 8E1 or 8N1 Must match CP 341
Station address 1..247 (CP 341 slave address) Foxboro poll list
Register map DB.W starting at 0 4xxxx input / 3xxxx holding

3. Root Cause Analysis of Modbus RTU Timing Delays

Field experience shows that the "tie delay" in this topology is the combined effect of four independent timing sources:

  1. Foxboro scan-time allocation. A DCS that polls Modbus once per second allocates only ~0.1% of the controller scan to a non-critical link. The DCS vendor has to be asked explicitly to shorten the call rate.
  2. CP 341 inter-frame gap. The default silent interval between Modbus RTU frames on the CP 341 is configured by the Modbus driver as 3.5 character times. At 9600 baud that is 4 ms; at 19200 it is 2 ms. If the DCS inter-character timeout is set to a higher value, the CP 341 will appear sluggish.
  3. STEP 7 OB1 call rate. The CP 341 FB 7 P_RCV_RK / FB 8 P_SND_RK pair (or the new FB 7 / FB 8 variants in TIA Portal) must be called at a higher frequency than the fastest expected DCS poll, otherwise the S7-300 cannot respond in time and the DCS sees a timeout.
  4. RS-485 turnaround delay. Two-wire half-duplex RS-485 requires the driver to release the bus before responding. The CP 341 adds a fixed 2-3 ms turnaround. Long cables (>300 m) or improper termination can multiply this to tens of milliseconds.

The total time between the DCS issuing a request and receiving a valid response is therefore:

T_roundtrip = T_request + T_turnaround_CP341 + T_processing_S7 + T_turnaround_RS485 + T_response + T_silent

Where at 19200 8E1 and 16 bytes per message:

Component Typical value Where to change
T_request (16 bytes / 19200) ~8.3 ms Fixed by baud
T_turnaround_CP341 2-3 ms Set in PTP parameter assignment
T_processing_S7 (OB1 cycle) 5-50 ms Call FB 7 in OB1 or OB35
T_turnaround_RS485 1-2 ms (well-terminated) / 10-30 ms (poorly terminated) 120 Ω termination, cable
T_response (16 bytes / 19200) ~8.3 ms Fixed by baud
T_silent (3.5 char) ~2 ms at 19200 Modbus driver parameter

A well-tuned link completes the full round trip in ~30 ms. A poorly tuned link routinely takes 300-1000 ms, which is the value the user sees as "tie delay".

4. CP 341 Hardware Configuration and Parameterization

CP 341 ships with the Modbus RTU driver loaded as a license-required optional package. The module must be parameterized through SIMATIC Manager → HW Config → CP 341 → Properties → Parameter Assignment. TIA Portal V21 supports the CP 341 as a Modbus RTU slave/peer under the same module family.

Recommended parameter set for a Foxboro master link at 19200 baud:

Parameter Recommended Notes
Protocol Modbus master / Modbus slave Select Modbus slave for the S7-300 side
Baud rate 19200 (or 38400 if DCS allows) Must match DCS exactly
Data bits 8 Modbus standard
Parity Even (preferred) or None Foxboro defaults to Even
Stop bits 1 (with parity) / 2 (no parity) Match DCS
Slave address 1..247 Must be unique on the trunk
Character gap 3.5 char (Modbus default) Do not change unless DCS specifies
Response timeout 2000 ms Increase only if DCS is slow
Hardware flow control Off (for RS-485) RS-232 only
Important. The Modbus RTU driver (Modbus Master / Modbus Slave) is an optional package. Without the license the module defaults to 3964(R) protocol, which is a totally different protocol that will silently fail to talk to Foxboro. The SF LED will illuminate if the license is missing on later firmware versions.

5. STEP 7 Software Configuration for Modbus RTU

The S7-300 side must provide two data blocks to the CP 341: a send DB and a receive DB. The function blocks FB 7 P_RCV_RK and FB 8 P_SND_RK move data between those DBs and the CP 341 buffer. A typical call pattern is:

// OB1 - call once per scan, every cycle
CALL  FB  7  , DB  7       // Receive
     EN  := TRUE
     R   := FALSE
     LADDR := 256          // Logical address of CP 341 (from HW Config)
     DB_NO := 100          // Receive data DB
     DBB_NO := 0           // Start byte in DB
     LEN   := 32           // Number of bytes to read (max 240 per Modbus)
     NDR   := M 10.0
     ERROR := M 10.1
     STATUS := MW 12
     _RECEIVE :=           // unused for Modbus
// OB35 / OB1 - call once per scan
CALL  FB  8  , DB  8       // Send
     EN  := TRUE
     R   := FALSE
     LADDR := 256
     DB_NO := 101          // Send data DB
     DBB_NO := 0
     LEN   := 32
     DONE  := M 20.0
     ERROR := M 20.1
     STATUS := MW 22
     _SEND :=              // unused for Modbus

Three rules are essential:

  1. Call FB 7 in OB1 (every scan). A cyclic OB (e.g. OB35 at 100 ms) is acceptable for monitoring, but receive must be polled more frequently than the DCS polls you, otherwise FC 05 / FC 06 / FC 16 commands will time out on the DCS side.
  2. DBs must be of the standard (non-optimized) type. Optimized DBs are not supported by the Modbus driver. The exact error from the CP 341 is "DB with optimized access" — see MODBUS (RTU) (S7-300, S7-400) error messages in the official TIA Portal documentation.
  3. DB numbers must be unique to the Modbus link. If a DB number is also used by another resource (e.g. a recipe DB or a process DB), the CP 341 returns "DB number is already being used by another data area".

6. Foxboro DCS Modbus Master Configuration

On the Foxboro side the relevant blocks are the FBM217 (RS-485 Modbus) and the CP30 / FCM100 high-performance controller. The Modbus master is typically programmed as an I/A Series compound block or as an EM (Equipment Module). The configuration object has the following parameters:

Foxboro parameter Typical default Recommended
Master poll period 1000 ms 100-200 ms (subject to scan budget)
Inter-message delay 50 ms 5-10 ms
Retries 3 3
Response timeout 500 ms 200 ms
RS-485 turnaround 3 ms 2 ms

Three Foxboro-side levers have the largest impact on the perceived delay:

  1. Poll period. This is the wall-clock delay before the DCS even asks for new data. Halving the poll period halves the average delay.
  2. Inter-message delay. Modbus master devices commonly insert a 50 ms delay between polls to give the slave a chance to recover. On a CP 341 the slave is ready in <5 ms, so 50 ms is wasted.
  3. Number of registers per request. The Modbus protocol caps a single FC 03/FC 16 request at 125 registers (16-bit). Foxboro defaults to 16 registers per poll. Combining 16 input + 16 output + 16 holding into a single poll instead of three sequential polls reduces DCS scan pressure by 66%.
Vendor constraint. The Foxboro Modbus master is governed by the I/A Series application scheduler. The engineering workstation is the only place to change the call rate. If your local Foxboro engineer cannot reduce the poll period below 500 ms (for example, because the same FBM is also polling a Modbus 232-to-485 gateway with a long response time), the timing problem is structural and cannot be solved on the Siemens side alone.

7. Baud Rate, Timing, and Frame Optimization

Modbus RTU frame timing at the bit level is governed by the formula:

T_frame (ms) = (1 / baud) × 1000 × (1 + 8 + parity_bits + stop_bits) × N_bytes

For an 8E1 frame (10 bit per byte):

Baud Time per byte 16-byte frame (request) 32-byte frame (request+response)
9600 1.04 ms 16.7 ms 33.3 ms
19200 0.52 ms 8.3 ms 16.7 ms
38400 0.26 ms 4.2 ms 8.3 ms
57600 0.17 ms 2.8 ms 5.6 ms
115200 0.087 ms 1.4 ms 2.8 ms

The single most effective change to reduce the tie delay is to double the baud rate. From 9600 to 19200 the wire time per request is halved. From 19200 to 38400 it is halved again. Beyond 38400 the timing benefit is small but the EMC risk grows.

The second most effective change is to bundle registers. If the process requires 30 input registers, request them in one FC 03 (16+14 in two consecutive polls) rather than 30 single-register polls. Modbus function codes commonly used with a CP 341 slave:

FC Function Use
01 Read Coils Digital outputs from PLC
02 Read Discrete Inputs Digital inputs to PLC
03 Read Holding Registers Most common for S7-300 ↔ DCS
04 Read Input Registers Process values
05 Write Single Coil Single-bit commands
06 Write Single Register Setpoints
15 Write Multiple Coils Block of commands
16 Write Multiple Registers Most common for setpoint blocks

8. Common Error Messages and Diagnostics

The CP 341 surfaces several distinct error conditions. The authoritative list is in the TIA Portal documentation: MODBUS (RTU) (S7-300, S7-400) error messages. The most relevant ones for a slow link are summarized below.

Error STATUS (hex) Meaning Fix
Invalid value of DB 0x80A1 DB length shorter than LEN parameter Extend DB or reduce LEN
DB number does not exist 0x80A2 FB 7/8 references a DB that was not loaded Recompile / download hardware
DB number is already being used by another data area 0x80A3 Conflict with another resource Rename DB to a free number
DB with optimized access 0x80A4 DB is attribute "optimized" in TIA Portal Uncheck "Optimized block access"
Frame error / parity 0x0800 Noise or baud mismatch Check baud, parity, cable
Slave not responding 0x0810 Address mismatch Check slave address on both sides
CRC error 0x0820 Electrical noise / termination Check 120 Ω termination, shield
Timeout on send 0x0830 No CTS / RTS handshake issue Disable HW flow control for RS-485

Status bytes 0x80xx are returned by the function block to the user program. Status bytes 0x08xx are Modbus protocol errors. The hex values are consistent across STEP 7 V5.5, V5.6, and TIA Portal V17/V18/V19/V20/V21 for the CP 341.

9. Cable, Termination, and Physical Layer Considerations

RS-485 timing margins are tight. The standard permits 32 unit loads on a single twisted pair, 1200 m total length at the lowest baud, and one termination resistor at each end equal to the cable characteristic impedance (typically 120 Ω). A field report of "intermittent delay" that does not produce a parity or CRC error is most often a reflections problem caused by missing or duplicate termination.

Cable / termination issue Symptom Action
No 120 Ω at the end points Late, jittery response Install 120 Ω at the two physical ends of the trunk, not at the middle
Termination on a stub > 1 m Reflections, CRC errors Remove stub termination, terminate only at trunk ends
Shield not bonded at one end Random CRC errors Bond shield to ground at the DCS end, leave far end floating
Baud too high for cable length CRC errors at peak load Reduce baud or replace cable with characteristic impedance 100-120 Ω, capacitance < 60 pF/m
TIA-485 node count > 32 Drive margin lost, no response Use a repeater (e.g. Phoenix Contact PSI-MODEM-REP)
Best practice. Run a hand-held Modbus line analyzer (e.g. Elpro 105-EL, Wireshark with RS-485 tap, or any of the no-name Chinese USB-RS485 tracers) on the trunk and confirm that the inter-frame gap is exactly 3.5 character times. If the gap is wildly inconsistent, the issue is the Foxboro master, not the CP 341.

10. Step-by-Step Troubleshooting Procedure

Follow the procedure below in order. Each step has an objective verification that confirms whether to continue or back-track.

  1. Confirm the master / slave assignment. Open the Foxboro configuration for the FBM/CP30 chain and confirm that the CP 341 station is configured as a slave and the Foxboro is the master. The same problem looks different if the roles are reversed.
  2. Capture a line trace. Connect a Modbus line analyzer to the trunk. Run for 60 seconds. Confirm that the master polls at the expected period and that the slave responds within the configured timeout. Save the trace.
  3. Verify CP 341 parameters in HW Config. Open the CP 341 properties in HW Config and confirm: protocol = Modbus slave, baud matches the DCS, parity matches, slave address matches the Foxboro poll list.
  4. Verify the receive and send DBs. In STEP 7 / TIA Portal, confirm the DBs used by FB 7 and FB 8 are not optimized, are large enough, and are not used by any other resource. Reference: TIA Portal: MODBUS (RTU) (S7-300, S7-400) error messages.
  5. Increase the OB1 call rate of FB 7 and FB 8. If the application calls them in OB35 only, add a parallel call in OB1 (gated by a flag) to ensure the receive cycle is as fast as the S7-300 scan.
  6. Request Foxboro to shorten the poll period. The poll period is set in the FBM217 / CP30 configuration, not in the PLC. Be specific: 1000 ms → 200 ms, inter-message delay 50 ms → 5 ms.
  7. Double the baud rate. From 9600 to 19200, or from 19200 to 38400. Both ends must be changed.
  8. Bundle registers. Convert N single-register polls into one FC 03 / FC 16 multi-register poll.
  9. Check termination. 120 Ω at the two physical ends, shield bonded at the DCS end only.
  10. Re-take the line trace. Compare to step 2. The inter-frame gap should be tight, response time should be < 50 ms, and no error responses should appear.

11. Verification and Commissioning Checklist

Item Acceptance criterion Tool
Round-trip time (request → response) < 50 ms at 19200 baud Modbus line analyzer
Average inter-poll gap Equals configured poll period ± 5% Modbus line analyzer
CRC error count over 1 h 0 Line analyzer / FBM statistics
S7-300 SF LED on CP 341 Off Visual
FB 7 NDR transitions per second Equals DCS poll rate STEP 7 online monitor
STATUS output of FB 7 / FB 8 0x0000 on every successful call STEP 7 VAT
Process value in DCS Updates within configured poll period DCS HMI / historian
DB is non-optimized Property "Optimized block access" = false TIA Portal / STEP 7 DB properties
CP 341 protocol loaded Modbus Master or Modbus Slave HW Config → CP 341 → Properties
Final rule. If the round-trip time on the line analyzer is < 50 ms but the DCS still reports stale data, the delay is inside the Foxboro application scheduler, not on the wire. Escalate to the Foxboro engineer with the line trace as evidence.

12. Frequently Asked Questions

Why does my S7-300 CP 341 respond slowly to a Foxboro DCS Modbus master?

The CP 341 itself is rarely the bottleneck. The two most common causes are a Foxboro poll period of 1000 ms (the default) and an inter-message delay of 50 ms. Ask the Foxboro engineer to reduce the poll period to 200 ms and the inter-message delay to 5 ms. Verify the change with a Modbus line analyzer showing a round-trip of < 50 ms.

What is the fastest baud rate the CP 341 supports for Modbus RTU?

CP 341 part numbers 6ES7341-1AH01, -1BH01, and -1CH01 support 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, and 115200 baud. For Foxboro, 19200 or 38400 is the practical limit. The DCS and the CP 341 must be set to the same baud and the same parity, otherwise the SF LED will illuminate and no frames will be decoded.

Which Modbus function codes does the CP 341 slave support?

FC 01 (read coils), FC 02 (read discrete inputs), FC 03 (read holding registers), FC 04 (read input registers), FC 05 (write single coil), FC 06 (write single register), FC 15 (write multiple coils), and FC 16 (write multiple registers) are supported. Use FC 03 and FC 16 for the bulk of the traffic to minimize inter-frame overhead.

I get error 0x80A4 "DB with optimized access". What does that mean?

The receive or send DB attached to FB 7 / FB 8 has the attribute "Optimized block access" enabled. The CP 341 Modbus driver only works with standard (non-optimized) DBs. Open the DB properties in TIA Portal, uncheck "Optimized block access", recompile, and download. The full list of CP 341 error codes is in the TIA Portal: MODBUS (RTU) (S7-300, S7-400) error messages documentation.

Can the S7-300 act as the Modbus master and the Foxboro as the slave?

Yes, but it requires the Modbus Master license on the CP 341 and a Modbus slave block on the Foxboro side. The same tie-delay root causes apply, but the lever moves to the S7-300: call FB 8 P_SND_RK from OB1, not OB35, and ensure the Foxboro slave block has a response time of < 50 ms. The topology chosen is usually dictated by which controller is the "data owner" in the process design.

Back to blog