Migrating S5-95U Master to S7-300 with FDL Protocol and CP342-5

David Krause15 min read
ProfibusSiemensTechnical Reference
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

Migrating an S5-95U Master to an S7-300 CPU While Keeping S5-95U Slaves on SINEC L2

This reference covers the field-proven procedure for replacing a failed master S5-95U (order number 6ES5 095-8MB02) and its TP15 panel with a SIMATIC S7-300 CPU, while leaving the three remaining S5-95U slave stations untouched. The existing peer-to-peer data exchange is based on Siemens SINEC L2 / FDL (PROFIBUS Layer 2) blocks FB252 (send) and FB253 (receive). The task is to retain that wire-level protocol so that the three S5-95U slaves do not need to be re-engineered, re-flashed, or rewired.

Engineering decision required up front: The S5-95U's onboard interface is SINEC L2, which implements the FDL (Fieldbus Data Link) services of PROFIBUS. It is not PROFIBUS-DP in the strict sense. The replacement S7-300 must therefore speak FDL (not DP-Master). The two supported hardware paths are: (a) a CP342-5 in the S7-300 running FDL mode, or (b) a DP/DP coupler between the S7-300 DP master and the L2 segment.

1. Problem Context

Original configuration:

  • Four 6ES5 095-8MB02 S5-95U stations on a single SINEC L2 segment.
  • One station is the master and also drives a TP15 panel.
  • Three stations are slaves that exchange process data with the master using FB252/FB253 on the L2 interface.
  • Master S5-95U and TP15 fail beyond economical repair.

Goal: drop a SIMATIC S7-300 (with appropriate CP) into the role of master, keep the cable plant, keep the three S5-95U slaves, and have the L2 data traffic continue without rewriting the slave applications.

2. Hardware Identification: S5-95U 6ES5 095-8MB02

The 6ES5 095-8MB02 is the L2 variant of the S5-95U compact PLC. The 8MB02 suffix is significant: it identifies the second-release module with a SINEC L2 interface on board. Key facts that govern the migration:

Attribute Value
Order number 6ES5 095-8MB02
Onboard port 1 SINEC L2 (FDL services, PROFIBUS Layer 2)
Onboard port 2 Serial (TTY / RS485 depending on variant)
L2 protocols supported FDL send/receive (free layer-2), not DP
L2 user blocks FB252 (L2-SEND), FB253 (L2-RECEIVE)
Max. L2 stations per segment Per RS-485 physics; up to 32 with repeaters
Connector 9-pin sub-D (Siemens L2 pinout)

Reference documentation: the Siemens manual "SINEC L2 Interface of the S5-95U Programmable Controller" describes the L2 services, SAPs, and block interfaces used by FB252/FB253. Treat this as the authoritative source for the slave-side behavior you must preserve.

Common mistake: 8MB02 supports L2, not DP. A 6ES5 095-8MAxx (or similar MA suffix) is the variant without L2. Confirm the suffix on the label of every slave before starting the migration — wiring 8MAxx slaves into an FDL segment will fail at the first frame.

3. Protocol Analysis: SINEC L2, FDL, and PROFIBUS Layer 2

SINEC L2 is the marketing name Siemens used for what later became standardized as PROFIBUS with the FDL services defined in EN 50170 / IEC 61158. Concretely, FB252/FB253 on the S5-95U build SDA (Send Data with Acknowledge) and SRD (Send and Request Data) frames at the FDL layer. They do not run DP-V0 cyclic I/O, they do not run DP-V1 acyclic, and they do not exchange DP diagnostics.

This matters for the S7-300 replacement because the only S7-300 CP that can run in FDL mode is the CP342-5 (or its successor CP343-5). A standard DP-only CP, or a CPU's onboard MPI/DP port set to DP master, will not interpret FB252/FB253 traffic from the slaves.

Service Direction Mechanism Block on S5-95U Block on S7-300 (CP342-5 FDL mode)
SDA Master → Slave FDL Send Data with Ack FB252 (L2-SEND) FC5 AG_SEND / CP342-5 FDL SEND
SRD Master ↔ Slave FDL Send and Request Data FB252 + FB253 FC5/FC6 / CP342-5 FDL SEND-RECV
SDN Master → All FDL Send Data No Ack (broadcast) FB252 (broadcast SAP) FC5 with broadcast SAP

Each FDL relationship is identified by a pair of Service Access Points (SAPs). On the S5-95U, FB252/FB253 parameters include the local and remote SAP. The replacement CP342-5 on the S7-300 must use the same SAP numbers to keep the slaves happy.

4. Why CP340 Fails and CP342-5 Succeeds

It is tempting to reach for a CP340 (for example 6ES7 340-1CH02-0AE0, RS422/485) because the S5-95U's onboard L2 is also an RS-485 physical layer. Do not do this. The pinout, the bit timing, the frame format (PROFIBUS HDLC), and the link-layer state machine are completely different from any point-to-point serial protocol the CP340 can run (ASCII, 3964(R), RK512, Modbus RTU master/slave, USS).

Criterion CP340 (RS422/485) CP342-5 / CP343-5 (PROFIBUS)
Physical layer RS-422/485 point-to-point or multi-drop RS-485 PROFIBUS (per EN 50170)
Framing UART characters, 3964(R) protocol, ASCII, Modbus RTU PROFIBUS HDLC, token passing, FDL services
SAPs / FDL None Yes, configurable per logical connection
Replaces FB252/FB253 No Yes (SEND/RECV blocks on FDL)
Speaks with 6ES5 095-8MB02 directly No (electrical level only) Yes

Use the CP342-5 in the S7-300 (or its modern equivalent CP343-5 on a later ET 200S/S7-300 station) and configure it in FDL mode, not DP master. FDL is one of the protocol modes selectable in the CP's HW Config in STEP 7. The CP then exposes FDL SEND / FDL RECV services to the S7-300 program via the standard SEND/RECV interface (FC5/FC6 or the CP's own FBs).

5. Alternative Path: DP/DP Coupler (6ES5 8ME__ on the S5 Side)

If the customer wants to keep the new S7-300 in standard DP master mode and isolate the legacy L2 segment, use a DP/DP coupler. The L2-side flange variant referenced in service discussions is the 6ES5 8ME__ family. The more common S7-side flange is 6ES7 158-0AD01-0XA0. The DP/DP coupler converts DP I/O on one side to FDL on the other, with up to 244 bytes of input and 244 bytes of output transferred bidirectionally. This decouples the migration: the S7-300 can stay in standard DP master / DP slave mode, and the three S5-95U slaves keep using FB252/FB253 unchanged.

Criterion CP342-5 in FDL mode DP/DP coupler
S7 CPU code Must call FDL SEND/RECV blocks; SAP handling Standard DP I/O, no FDL blocks
Slave S5-95U code Unchanged Unchanged
Maximum throughput Full L2 bandwidth, deterministic Capped at coupler I/O size (244/244 bytes per direction)
Diagnostics FDL statistics, SAP status, frame errors DP diagnostics, no L2 detail
Cable / topology Shared bus with S5 slaves Two separate segments bridged at the coupler
Best for Direct replacement, low SAP churn Cleaner separation, multi-vendor DP on the S7 side

For a four-station network with the S7-300 taking the master role, the CP342-5 in FDL mode is usually the lower-cost and lower-latency choice. The DP/DP coupler makes sense when the S7-300 station is shared with additional DP slaves (ET 200, drives, third-party) and you want to keep the legacy L2 segment isolated.

6. Network Topology and Cabling

The original plant likely uses the historical Siemens purple SINEC L2 cable (6XV1 830-0AH10 or the older 6XV1 830-0xxx), which is electrically compatible with PROFIBUS DP cable. At the data rates the S5-95U typically ran (187.5 kbit/s, 500 kbit/s, occasionally 1.5 Mbit/s), the legacy cable is usually fine. Verify before power-up:

  1. Shield continuity end-to-end. L2 cable shields must land at the bus connector shell at every node.
  2. Characteristic impedance ~150 Ω. Measure with the segment powered off.
  3. Termination at both physical ends of the segment only. On an L2 segment, set terminating resistors on the two end stations and off on the middle ones — same rule as DP.
  4. No stubs. The S5-95U's 9-pin sub-D must be a bus connector with PG port, not a drop cable.
  5. No L2 repeater needed for four nodes; just segment termination.
Common field fault: An old L2 installation with a terminated middle node, or a shield landed at only one end, will show valid bus signals on the oscilloscope but corrupt FDL frames under load. Symptoms: sporadic SDA timeouts on FB252, FB253 reporting "no remote station".

7. S5-95U Slave Side: FB252 and FB253 Configuration

On each of the three remaining slaves, FB252 and FB253 must keep their existing parameters. Document them before the cut-over so the S7-300 can be configured to match. The relevant parameters are:

FB252 (L2-SEND) parameter Meaning Notes for migration
SSNR Interface number (1 = onboard L2) Must stay 1
A-NR Job number (1..16) Local job identifier
ANZW / ZT Status word / cycle time Slave code must remain compatible
QTYP / DBNR / QANF / QLAE Source data: type, DB, offset, length Defines which DB area is sent
Z-NR / ZTYP / ZANF / ZLAE Destination on receiver Must match FB253 on the peer
REMST / SAP-NR Remote station number / SAP Critical — must match the new S7-300's FDL config

For FB253 (L2-RECEIVE), the same parameters appear inverted, with a status byte that the slave's OB1 evaluates. Do not change FB252/FB253 on the slaves during migration — the S7-300 must impersonate the master that the slaves already expect.

8. S7-300 Master Side: CP342-5 in FDL Mode

Configuration steps in STEP 7 (matching the FB252/FB253 parameters captured from the slaves):

  1. Insert the CP342-5 in HW Config on the S7-300 rail. The CP is order-number sensitive; use the variant intended for FDL (CP342-5 / CP343-5).
  2. In the CP's properties, set the operating mode to FDL (not DP master, not DP slave).
  3. Set the PROFIBUS address of the CP342-5 to the value the old master S5-95U had on the L2 segment.
  4. Set the baud rate to the value the slaves run on (typically 187.5 kbit/s or 1.5 Mbit/s; check the slaves' project). Mismatched baud is the number-one cold-start failure.
  5. For each of the three slaves, define an FDL connection with the remote station's PROFIBUS address and the same SAPs the slaves' FB252/FB253 use.
  6. Map the data blocks: each FDL connection's send and receive buffers correspond to the QTYP/QLAE/ZTYP/ZLAE parameters the slaves send.

The S7-300 program then uses the standard SEND/RECV interface (FC5 AG_SEND / FC6 AG_RECV or the FDL-specific blocks) to drive the CP342-5. The control interface per job mirrors the FB252/FB253 paradigm (job number, status word), so the S7-300 control code is essentially a re-implementation of the original master logic on STEP 7.

// Example: cyclic FDL exchange with one S5-95U slave on the CP342-5
// Using FC5 AG_SEND / FC6 AG_RECV in OB1
// ID  = 1   (configured FDL connection ID in HW Config)
// LADDR = hardware address of CP342-5 (from HW Config)
// SEND  = P#DB100.DBX0.0 BYTE 32
// LEN   = 32
// DONE  = M100.0   // send complete
// ERROR = M100.1
// STATUS= MW102    // CP342-5 status

CALL  FC  5
      ID     := 1
      LADDR  := W#16#300
      SEND   := P#DB100.DBX0.0 BYTE 32
      LEN    := 32
      DONE   := M100.0
      ERROR  := M100.1
      STATUS := MW102;

Repeat with FC6 for receive. For each of the three slaves, allocate one ID and one pair of DBs sized to the slave's expected payload.

9. Migration Procedure: Step-by-Step

  1. Document the existing network — list every S5-95U's L2 station address, baud rate, SAPs, DBs, and the FB252/FB253 job numbers. Photograph the bus connector terminations.
  2. Capture the old master's program from a working backup or PG. Even if the failed master is dead, the three slaves still hold the protocol contract.
  3. Order the S7-300 components: CPU 315-2 DP (or 314 + CP), one CP342-5, and the I/O modules to replicate the master S5-95U's signals.
  4. Build and bench-test the S7-300 in the workshop. Configure the CP342-5 in FDL mode. Simulate the S5-95U slaves with another S7-300 running a stub FDL SEND/RECV. Verify all three logical connections cycle without error.
  5. Power down the line. Isolate the L2 segment by switching off the three slaves.
  6. Remove the failed master S5-95U and TP15. Note the bus cable path and termination.
  7. Install the S7-300 in the same cabinet. Insert the CP342-5. Land the L2 bus cable on the CP342-5's 9-pin sub-D PROFIBUS connector.
  8. Move the bus termination to the new physical end of the segment (the S7-300's CP342-5 connector if it is now at the end, otherwise the existing end node).
  9. Power the segment in stages — bring up the S7-300 first, watch CP342-5 diagnostics for "bus fault" / "station not found". Then power each slave one at a time and confirm FB252/FB253 report 0 (no error).
  10. Run a controlled data-exchange test for each slave. A failing slave will report the FDL connection as down; the CP342-5's diagnostics buffer gives the failing station and SAP.
  11. Restore the TP15/OP15 replacement — the original TP15 is a 5" text display. Modern replacement is a Comfort Panel running a WinCC Flexible / TIA Portal project, with the variable names retained from the STEP 5 source.

10. Verification and Diagnostics

After the cut-over, run a structured verification pass:

Check Pass criterion Tool / location
CP342-5 bus status "OK", no station failure CP diagnostic buffer (STEP 7 → CP → Diagnostics)
All three FDL connections active Status STATUS = 0000 on every FC5/FC6 call Watch table on MW102 / equivalent
FB252 returns on each slave ANZW = 0 in OB1 of each slave PG online on each 6ES5 095-8MB02
FB253 receives on each slave Receive DB updated within the configured ZT cycle time PG online, status display on each slave
No "duplicate station" or "duplicate SAP" warnings None in CP342-5 buffer CP diagnostic buffer
End-to-end cycle time Within original design (typically < 100 ms for 3 slaves at 187.5 kbit/s) Cross-check on master cycle counter vs. slave receive timestamp
No frame errors (parity / HDLC / timeout) over 24 h Zero CP342-5 statistics page in STEP 7

10.1 Troubleshooting Matrix

Symptom Most likely cause Fix
All slaves report "no remote station" Baud rate mismatch Match CP342-5 baud to slaves' project
One specific slave missing Wrong SAP, wrong remote station number, or wrong DB offset Cross-check against the slave's FB252 parameters
Intermittent timeouts on one slave Termination not at segment ends, or shield not continuous Re-terminate, verify shield ground at every node
FB253 receives stale data Receive DB too short (L2 truncates), or SEND/RECV job numbers collide Increase DB length, renumber A-NR jobs
CP342-5 bus short / station failure on power-up Termination resistor left on a middle node, or short in the old L2 cable Disconnect segment in halves to localize
Original TP15 program cannot be ported TP15 uses S5-95U-specific system bits Replace with OP15 or migrate to a Comfort Panel under WinCC Flexible / TIA Portal

11. Field-Proven Caveats

TP15 / OP15 replacement. The TP15 is a 5" text display that ties to the S5-95U directly via the TTY/AG port, not via L2. If the TP15 was driven by the master S5-95U (not standalone), its variables are sourced from the S5-95U's process image. The S7-300 replacement project must reproduce those variable names in a Comfort Panel (TP700 / TP900) project under TIA Portal or WinCC Flexible 2008 SP5. There is no direct TP15 → Comfort migration tool — expect a screen-by-screen port.

S5-95U firmware revisions. Some 6ES5 095-8MB02 units carry firmware that supports 32-byte payloads, some 64, and some 244. Confirm with the part-number and the MLFB suffix before assuming maximum frame length. The CP342-5 must be configured to match, not to the largest possible size.

CP342-5 vs. CP343-5. The CP343-5 is the modern ET 200S/S7-300 replacement for the CP342-5. Both can run FDL. The CP343-5 has the same S7-300-side programming interface (FC5/FC6) but a different MLFB. For long-term spares, prefer the CP343-5 if the rack and firmware allow.

SAP allocation. SAPs 0 (default) and 1..62 are free for FDL user traffic. SAP 63 is reserved for DPV1. SAP 64..65 are reserved. SAPs are configured on the CP342-5 per FDL connection, not globally. Make sure that the S7-300 master uses a SAP that does not collide with the slave's SSNR mapping.

Avoid mixing DP and FDL on the same CP342-5. A CP342-5 in FDL mode cannot simultaneously act as a DP master. If the S7-300 station also needs to serve a local DP line, add a second CP342-5 (or a CP343-5) and run FDL on one, DP on the other.

Can the S7-300 onboard DP port (CPU 315-2 DP) replace the S5-95U master without adding a CP342-5?

No. The onboard DP port runs PROFIBUS-DP master, not FDL. The 6ES5 095-8MB02 slaves do not speak DP; they only implement FDL services via FB252/FB253. You need either a CP342-5 (or CP343-5) in FDL mode, or a DP/DP coupler to bridge a DP segment to the L2 segment.

Why does the CP340 (RS422/485) not work, even though both ports are physically RS-485?

The CP340 implements point-to-point or 3964(R) / Modbus RTU / ASCII / RK512 / USS protocols over RS-485. The S5-95U's SINEC L2 port implements the PROFIBUS FDL layer-2 protocol over the same physical layer, with HDLC framing, token passing, and SAP-based addressing. The CP340 cannot produce or interpret FDL frames, so it is not a viable replacement. Use the CP342-5 instead.

Do the three S5-95U slave programs need to be changed?

No. Leave FB252/FB253 on each slave unchanged. The S7-300 master must impersonate the old master at the L2 level: same baud rate, same station number, same SAPs, same DB offsets. Document the existing parameters from a working slave before the cut-over so the CP342-5 FDL connections can be configured to match.

Can a DP/DP coupler (6ES5 8ME__ on the L2 side) be used instead of a CP342-5?

Yes. A DP/DP coupler lets the S7-300 stay in standard DP master mode and translates DP I/O into FDL frames for the L2 segment. The trade-off is throughput: the coupler is limited to 244 input bytes and 244 output bytes per direction, and the S7-300 side uses standard DP I/O handling rather than FDL SEND/RECV blocks. For a four-station L2 network, the CP342-5 in FDL mode is usually the simpler choice; the DP/DP coupler is preferred when the S7-300 station is shared with other DP slaves.

What is the role of the original SINEC L2 cable, and will it work with PROFIBUS-DP components?

SINEC L2 cable (Siemens 6XV1 830 family) is electrically compatible with PROFIBUS-DP cable. At the low baud rates typical of legacy L2 networks (187.5 kbit/s to 1.5 Mbit/s) and the short segment lengths involved, the existing cable is usually acceptable. Verify shield continuity, characteristic impedance near 150 Ω, and that termination resistors are present at exactly the two physical ends of the segment before powering up the new CP342-5.

Back to blog