1. Problem Overview
A PROFIBUS DP segment headed by a SIMATIC S7-416-3 DP (master, address 2) loses its OP170B HMI (master, address 1) the moment a third-party device equipped with a Siemens CM 1242-5 communications module (slave, address 99) is brought online. Tags on the HMI collapse to ##### and the operator panel stops refreshing the values read from the master's DB49. Pulling the new device off the bus restores normal HMI behavior immediately.
The fault is not triggered by a defective CM 1242-5: the same CM 1242-5 module has been running for months on three other S7-400 master systems that include their own HMIs. The fault is also not triggered by a bad cable: a PROFIBUS tester confirms signal levels are within the RS-485 mask and both nodes (1 and 99) are present on the wire. The fault is triggered by an incorrect PROFIBUS token passing situation on the segment.
2. Affected Components and Configuration
| Role | Device | PROFIBUS Address | Configured Function | Behavior Seen on Bus |
|---|---|---|---|---|
| DP Master Class 1 | SIMATIC S7-416-3 DP (CPU 416-3 DP, 6ES7416-3XR05-0AB0 family) | 2 | Class 1 master | Holds token, polls slaves |
| HMI / Class 2 master | SIMATIC OP170B (WinCC flexible runtime) | 1 | Class 2 master (read/write via DB49) | Drops off bus when node 99 enters |
| Foreign S7-300 station | SIMATIC S7-300 CPU + CP 342-5 (6GK7342-5DA03-0XE0 family) | (as configured in HW Config) | Configured as DP slave | Tester reports it as active master emitting token frames |
| New device | Third-party device, internal S7-1200 + CM 1242-5 (6GK7242-5DX30-0XE0) | 99 | DP slave, 64 bytes I / 64 bytes O | 64/64 slot, "undefined master" assigned in remote HW Config |
Master process image is set to the maximum 1600 bytes for inputs and 1600 bytes for outputs, well above the 64-byte payload of the new device, so the I/O size is not the limiting factor.
3. PROFIBUS Token Passing Background
On a multi-master PROFIBUS DP segment, only DP Master Class 1 (DPM1) and DP Master Class 2 (DPM2) stations participate in the token ring. The active master that holds the token has the right to poll its assigned slaves; the token is then passed in ascending address order to the next active master, wrapping from the highest address back to address 0 (the passive station). Slaves never emit token frames.
An HMI such as the OP170B running WinCC flexible is a typical DPM2 on PROFIBUS: it never owns slaves but exchanges acyclic read/write services with the S7-416. A device that has been configured in STEP 7 as a DP slave must not be visible on the wire as an active master. If it is, the token passing list built by the active masters will include a "phantom" master and the gap update (GAP) mechanism will time out when the station that owns the GAP list does not receive an answer from the phantom master at the expected slot.
4. Root Cause Analysis
From the discussion trace, three independent observations converge on a single root cause:
- OP170B disappears from the segment the instant node 99 starts to cycle. Bus diagnostics (PROFIBUS tester in monitor mode) confirm node 1 vanishes from the live device list while nodes 2 and 99 remain.
- Three active masters are seen on the wire: the S7-416 (address 2), the OP170B (address 1) and the S7-300 with CP 342-5. The CP 342-5 was configured as a slave in HW Config on the S7-300, but is transmitting token request / token pass frames, which is a slave-config violation.
- The third-party vendor left the CM 1242-5 master assignment as "undefined master". The slave therefore accepts any active master that talks to it, including the rogue CP 342-5.
Combining the three: the S7-300 + CP 342-5 behaves as a stray master. When the new device at address 99 enters the bus, the token ring expands to a three-master ring; the OP170B, which is at the lowest address and the slowest DPM2, loses its gap-update window and is reported offline by the S7-416. The HMI tags fall back to ##### because the OPC-style or S7 connection to DB49 breaks at the cyclic layer.
The other three plants are unaffected because they do not have an S7-300 with a mis-configured CP 342-5 on the same segment.
5. CM 1242-5 Technical Reference
The CM 1242-5 (Siemens article number 6GK7242-5DX30-0XE0) is a communications module that turns an S7-1200 CPU into a PROFIBUS DP slave. Key electrical and protocol parameters for the diagnostics in this article:
| Parameter | Value | Source |
|---|---|---|
| Function | PROFIBUS DP slave (DPM0) | CM 1242-5 manual, "Operating mode" |
| PROFIBUS connector | 9-pin D-sub female | S7-1200 manual collection |
| Baud rate | 9.6 kbit/s to 12 Mbit/s (auto-detect) | CM 1242-5 manual |
| Typical power loss | 0.75 W | S7-1200 manual collection |
| Electrical isolation | PROFIBUS interface to ground and to internal circuitry, 710 V DC for 1 minute | S7-1200 manual collection |
| Max I/O data per slave | 240 bytes I / 240 bytes O (slot-bounded by GSD) | CM 1242-5 manual |
| Configuration in HW Config | Master assignment can be a specific DPM1, a DPM2, or "undefined master" | CM 1242-5 manual, "Operating mode" > "Master" |
The fact that the new device uses the maximum 64/64 byte slot and that the master's process image is sized to 1600 bytes confirms that the slot assignment itself is not the issue. The remaining variable is master assignment.
6. Step-by-Step Diagnostic Procedure
-
Capture a passive bus trace with a PROFIBUS class-2 analyzer (e.g. Softing PROFIbus Diagnostics, Indu-Sol ServiceTool, Siemens BT 200, or any diagnostic tool that decodes
SD1/SD2/SD3telegrams and lists the live device table). Record the trace for at least 30 s with node 99 offline and again for 30 s with node 99 online. - Diff the two live device lists. Expected: identical lists, only addresses 1, 2 and 99 should be active. If node 1 disappears only after node 99 enters, the problem is bus arbitration, not a broken cable.
-
Decode the token sequence. The analyzer should show the token walking in the order
1 → 2 → next active master → 1. Insert the new device and re-check. If the CP 342-5 appears as a master in the token ring, the CP 342-5 has been mis-configured at the S7-300 project level. -
Verify the CP 342-5 operating mode. Open the S7-300 project in STEP 7, locate the CP 342-5, double-click the DP slave symbol, and confirm the operating mode is set to DP Slave (FC
FC1/FC2in the S7-300 program must be loaded;AG_SEND/AG_RECVfor FDL). If the mode field shows DP Master or No DP mode, the CP 342-5 will appear as an active master regardless of the slave wiring in HW Config. - Verify the CM 1242-5 master assignment. On the S7-1200 side, open TIA Portal, go to Devices & Networks > CM 1242-5 > Properties > Operating mode, and change the Master field from "undefined master" to the specific S7-416 master (DPM1 class 1, station address 2). The S7-300 is then no longer accepted as a master of this slave.
- Check bus termination and signal levels. A PROFIBUS segment must be terminated at both physical ends with 220 Ω between the two data lines and 390 Ω from each line to the reference ground (the 9-pin D-sub "terminator on" switch on PROFIBUS connectors and on the CM 1242-5 activates this network). Measure the A-B differential voltage on every segment; a healthy idle level is approximately 1.0 V to 1.2 V (logical "1") with a mark space ratio between 40 % and 60 %.
- Count devices against the segment budget. With 40 slaves plus the masters on a single segment, the repeater rule applies: a maximum of 32 stations per segment and a maximum of 126 stations total on the bus when repeaters are used. If you are above 32, the segment must be split with a PROFIBUS repeater (e.g. 6GK1500-0AA10) and the new device should be placed on a fresh segment.
- Eliminate the S7-300 as a sanity check. With the plant's permission, pull the S7-300 / CP 342-5 connector and re-power the segment. If the OP170B and the CM 1242-5 then coexist, the CP 342-5 is confirmed as the source of the rogue master.
7. Solution
Apply the following actions in order. They are independent and can be applied one at a time to confirm the diagnosis without a plant shutdown.
7.1 Constrain the CM 1242-5 master assignment (primary fix)
On the S7-1200 project of the new device, change the CM 1242-5 "Master" parameter from undefined master to a specific DPM1. The configuration path in TIA Portal is:
- Project tree > [CPU 121x] > Properties > Communication interfaces > CM 1242-5
- Switch to the Operating mode tab
- Set Master to the actual DPM1 (the S7-416 at address 2)
- Compile and download the S7-1200 project, then power-cycle the CM 1242-5
Result: the CM 1242-5 only accepts the S7-416 as its master and rejects any token frame from the CP 342-5. The token ring is now a clean two-master ring (S7-416 + OP170B).
7.2 Fix the CP 342-5 operating mode
On the S7-300 station, open STEP 7 HW Config, double-click the CP 342-5, and verify the Operating mode selection:
- For a pure slave: DP Slave
- For FDL S7 communication only: No DP, FDL S7 connection (the CP 342-5 is then invisible to the DPM1)
If the S7-300 only uses PUT/GET or S7 connections to the S7-416, change the CP 342-5 to No DP, FDL S7 connection to remove it from the token ring entirely.
7.3 Split the segment if the station count is too high
If the segment carries 32 or more stations, install a PROFIBUS repeater and place the new device on a downstream segment. The repeater electrically isolates the two segments and the OP170B is no longer in the same arbitration domain as the rogue master.
7.4 Verify wiring and termination
Ensure PROFIBUS connectors at the two physical ends of each segment have the termination switch set to ON and that all intermediate connectors are OFF. Use a 9-pin D-sub connector with integrated termination (e.g. 6GK1500-0FC10) and confirm the shield is bonded to ground at every cabinet entry.
8. Verification
After applying any of the fixes above, perform the following checks before restoring production:
- Re-take the bus trace with the new device online. The live device list should now show all four expected addresses (1, 2, the S7-300 CP 342-5 as a slave or absent, and 99) with no token passing from a non-master station.
-
Watch the OP170B tags for at least one hour of normal production. The values in
DB49must refresh continuously and never collapse to#####. -
Confirm diagnostics on the S7-416:
DP Diagnosticsin STEP 7 (orRD_RECon the diagnostic slot of the CM 1242-5) should report no Station failure or Diagnostic interrupt events related to node 1. - Cycle the test: power-cycle the CM 1242-5 a few times. The OP170B must keep its connection every time, confirming the master constraint is permanent.
9. Prevention and Best Practices
- Always assign a specific DPM1 to a CM 1242-5 in vendor projects. The "undefined master" setting is intended for use cases where the slave is on a single-master bus; on multi-master segments it must be tightened to a real DPM1 address.
- Audit every PROFIBUS segment for its master list at commissioning. Tools such as Softing PROFIbus Diagnostics, Indu-Sol PROFINET/PROFIBUS Diagnostics and Siemens SINEC NMS produce a master list from a passive trace; compare the trace to the planned topology and resolve any extra master immediately.
- Respect the 32-station rule. PROFIBUS DP EN 50170 caps the address space at 126 but a single electrical segment is limited to 32 stations. With 40 slaves in the original plant, segmentation with repeaters is mandatory.
- Document the segment: keep a single line drawing with the addresses, masters and the location of the terminators. Reviewers can spot a stray master much faster when the topology is current.
- Schedule an annual PROFIBUS health check with a class-2 analyzer. Repeater counters, signal levels and error counters per station will surface degrading terminations or rogue masters before they take a station down.
10. Diagnostic Flowchart
11. Key Technical Values Reference
| Parameter | Value | Source |
|---|---|---|
| CM 1242-5 article number | 6GK7242-5DX30-0XE0 | Siemens CM 1242-5 manual |
| Max PROFIBUS baud rate | 12 Mbit/s | CM 1242-5 manual |
| Max stations per segment | 32 (repeater splits the segment) | EN 50170 / PROFIBUS standard |
| Idle A-B differential voltage | 1.0 V to 1.2 V | PROFIBUS physical layer spec |
| Bus termination | 220 Ω line-to-line, 390 Ω to ground at each segment end | PROFIBUS connector data sheet |
| OP170B class | DP Master Class 2 (DPM2) | WinCC flexible device integration |
| CP 342-5 in DP slave mode | Must be loaded with FC1/FC2; otherwise appears as master | SIMATIC CP 342-5 manual |
Why does the OP170B show ##### as soon as the CM 1242-5 comes online?
The CM 1242-5 itself is not the cause. The plant's S7-300 + CP 342-5 is mis-configured and behaves as a stray DP master. When the new slave at address 99 enters the bus, the token ring expands to three active masters and the OP170B, which is the slowest DPM2 at address 1, loses its gap-update window. The S7-416 marks the HMI as offline, the S7 connection to DB49 breaks, and the HMI tags fall back to #####.
Is the CM 1242-5 configured as undefined master a defect?
No, it is a valid vendor default for single-master segments. In a multi-master segment it must be tightened to a specific DP Master Class 1 (in this case the S7-416-3 DP at address 2) to prevent stray masters from establishing a connection to the slave.
What is the fastest way to confirm the diagnosis without stopping production?
Run a passive PROFIBUS trace with a class-2 analyzer (Softing PROFIbus Diagnostics, Indu-Sol tool or Siemens BT 200) for 30 seconds with the new device offline, then 30 seconds with it online. If the trace shows the CP 342-5 of the S7-300 transmitting token frames, and if address 1 disappears from the live list only when address 99 is online, the diagnosis is confirmed.
Can the segment carry 40 slaves with a CM 1242-5 added?
Yes, but only if a PROFIBUS repeater is used to split the segment. PROFIBUS DP allows a maximum of 32 stations per electrical segment and 126 stations on the bus. With 40 slaves plus masters, the segment must be divided by a repeater such as the Siemens 6GK1500-0AA10.
Does the process image size of 1600 bytes explain the issue?
No. 1600 bytes of input and 1600 bytes of output is well above the 64-byte payload of the CM 1242-5, so the slot fits. The failure is in the token arbitration, not in the I/O sizing.