Problem Description
Two Siemens SIMATIC S7-300 CPU 315-2DP controllers (6ES7 315-2AG10-0AB0 or equivalent 2nd-generation variant) are configured in a Software Redundancy (SW Redundancy) pair, supervised by SIMATIC WinCC V6.2 with the Redundancy option. After a cold power-on, the standby CPU-B (MPI address 4) is brought up as the active master, even though CPU-A (MPI address 2) is designated in the STEP 7 hardware configuration and the WinCC project as the primary master. Manual switchover via the control bit at DB5.DBX10.0 from the HMI does not propagate to WinCC, so the SCADA continues to read from the wrong CPU and operator input values are blocked.
Symptoms in the field:
- Power-on always produces CPU-B as active partner, regardless of which rack is energised first.
- STEP 7 > NetPro > Master System on IM 153-2 (Redundant) shows the wrong Profibus master system as active (Profibus-2 / DP master ID-1 instead of Profibus-1 / DP master ID-0).
- WinCC does not follow the bit
DB5.DBX10.0toggle; redundancy partner swap is ignored. - After a controlled switchover, both panels' authority transfers correctly, but the next cold start reverts to the wrong initial master.
System Architecture
The deployment is a classic SW Redundancy configuration: two S7-300 stations connected via MPI for non-redundant data and via Profibus DP for the redundant I/O islands. The I/O layer is built on ET 200M with redundant interface modules IM 153-2 (6ES7 153-2BA00-0XB0 or 6ES7 153-2BA02-0XB0) so that each Profibus master can take over the I/O in the event of a CPU or bus fault.
| Component | CPU-A (designated master) | CPU-B (standby / backup) |
|---|---|---|
| PLC CPU | CPU 315-2DP (6ES7 315-2AG10-0AB0) | CPU 315-2DP (6ES7 315-2AG10-0AB0) |
| MPI address | 2 | 4 |
| Default role | Initial master (preferred) | Initial slave |
| Profibus DP address | 2 | 3 |
| Active DP master system at start-up | Should be PS-1 (DP ID 0) | Should be PS-2 (DP ID 1) |
| Redundant ET 200M interface | IM 153-2 #1 (slot) | IM 153-2 #2 (slot) |
Each CPU hosts a copy of the SWR ZYK (FB 102) cyclic block and the SWR START (FB 101) initialisation block. The redundancy DBs (DB_HALT, DB_SEND, DB_RCV) are mirrored, and partner state is exchanged via MPI / Profibus using the SWR_AG_CN connection table.
Root Cause Analysis
SW Redundancy on S7-300 selects the active partner using a deterministic decision chain. When the active role is wrong at cold start, the failure is almost always in one of the following layers.
1. Initialisation Order / First-Up Wins
The SWR_START (FB 101) call on each CPU contains the input INITIAL_MASTER. With STEP 7 SW Redundancy V1.x / V2.x, both CPUs use the same user program; the first PLC to finish OB 100 (warm restart) and complete FB 101 claims the role Aktiv. If the standby cabinet is energised marginally sooner (for example, by a 24 V rail that rises a few hundred milliseconds before the other cabinet), the swap is permanent for that power cycle. Adjusting the Initial Master marker in the project is the supported way to bias the election when CPUs are dissimilar; however, when both CPUs are identical 315-2DP units, the only reliable levers are:
- The physical power-on sequence (energise CPU-A first, wait for OB 100 completion, then energise CPU-B).
- The MPI / Profibus topology such that CPU-A's interface module negotiates first.
2. IM 153-2 Redundant I/O Master System Selection
When NetPro shows that the IM 153-2 Redundant station is mastered by Profibus-2 / DP master ID 1 instead of Profibus-1 / DP master ID 0, the active PLC and the active DP master system are misaligned. SW Redundancy's DP_MASTER input on FB 101 expects a primary DP master ID (the one driven by the initial master CPU) and an alternate DP master ID (driven by the standby). When the two DP master systems are interchanged in NetPro, the library cannot align the I/O with the active CPU and WinCC reads inconsistent data.
3. WinCC Redundancy Connection and Control Bit
WinCC V6.2 Redundancy uses two logical connections per tag (@Connection1 / @Connection2) plus a system tag @ForceConnection or a user-defined DB5.DBX10.0 bit. The control bit only takes effect when:
- The Redundancy option is licensed on the WinCC server (Authorisation: Redundancy license disk).
- Both logical connections are configured as Redundant partner in Tag Management > SIMATIC S7 PROTOCOL SUITE > MPI/TCP.
- The bit is wired into the Connection monitoring configuration under Computer properties > Redundancy with the right Trigger tag selection.
If any of the above is missing, WinCC silently ignores the toggled bit and the panel never switches authority.
Step-by-Step Solution
Step 1 - Verify Hardware Configuration in STEP 7
- Open SIMATIC Manager > CPU-A > Hardware > HW Config.
- Confirm MPI address = 2 on the CPU properties dialog. The MPI address lives in the CPU's MMC only if "Set MPI address on the module" is unchecked in HW Config > CPU > Properties > MPI. By default the address is stored on the MMC.
- Repeat for CPU-B and confirm MPI = 4. Do not swap MMCs to alter the role - the MPI address travels with the configured project, and the SWR library looks for the configured partner, not for the physical card. Swapping MMCs on 315-2DP will re-bind the project to the new slot and may corrupt the SWR DBs.
- Open NetPro and verify the redundant ET 200M station: Right-click IM 153-2 station > Properties > Master system. The primary master system must be the one driven by CPU-A (Profibus-1, DP master ID 0). Swap the assignment by drag-and-drop if necessary.
Step 2 - Set the Initial-Master Behaviour in FB 101
Open the OB 100 of CPU-A and confirm that SWR_START (FB 101) is called with the correct parameters:
// OB 100 - Restart / Warm restart of CPU-A
CALL FB 101, DB 100 // SWR_START
AG_KENNUNG := DW#16#0001 // any unique 32-bit ID
DB_HALT := 100 // data block for partner state
DB_SEND := 101 // send data image
DB_RCV := 102 // receive data image
VERBINDUNG := 0 // index into SWR_AG_CN table
DP_MASTER := 0 // primary DP master ID (CPU-A)
INITIAL_MASTER := TRUE // bias this CPU for cold start
For CPU-B, the same FB is called with DP_MASTER := 1 (alternate DP master) and INITIAL_MASTER := FALSE. STEP 7 SW Redundancy treats INITIAL_MASTER as a tie-breaker only when the partner PLC is unreachable; it does not override the first-up rule. Therefore:
- Keep
INITIAL_MASTER = TRUEon CPU-A andFALSEon CPU-B. - Re-download both stations to the MMC and perform a complete power-off / power-on.
Step 3 - Control the Power-Up Sequence
The most reliable way to make CPU-A the active master at every cold start is to control the cabinet energisation order:
- Close the main breaker on Cabinet A (CPU-A) only.
- Wait until the CPU's
RUNLED is steady green and theSF/BFLEDs are off. With CPU 315-2DP, this takes roughly 5 to 8 seconds from 24 V application. - Close the main breaker on Cabinet B (CPU-B). The standby detects the active partner via MPI and settles into passive state.
- Verify in STEP 7 Online > Accessible Nodes that the active role is reported by CPU-A.
If both cabinets must be powered from a single 24 V supply (no separate breakers), insert a soft-start delay on the CPU-B side using a timing relay (for example, 3RP1505 or 7PV1508) sized to 10 s. The delay is short enough to keep the application in RUN but long enough that FB 101 on CPU-A has finished its initialisation handshake.
Step 4 - Configure WinCC V6.2 Redundancy Properly
- Open WinCC Explorer > Computer properties > Redundancy on the WinCC server.
- Enable Activate Redundancy. Insert both logical connections:
- Connection 1: MPI / TCP → CPU-A (MPI 2 / IP 192.168.0.2)
- Connection 2: MPI / TCP → CPU-B (MPI 4 / IP 192.168.0.4)
- Map Connection 2 as the redundant partner of Connection 1.
- Under Trigger tag, select
DB5.DBX10.0. This tag must be a boolean process tag with the Update attribute set to On change and the S7 protocol suite address pointing to DB 5, byte 10, bit 0. - Install the WinCC Redundancy authorisation (soft key on USB or floppy) on the server. Without it, the option silently disables itself in the runtime.
- Save and restart the WinCC runtime. Confirm in WinCC > Tools > Status of Redundancy that both connections show OK and the active partner equals CPU-A.
DB5.DBX10.0 must be writable from the operator panel. If the bit is in a read-only or write-protected area, WinCC reads the value but cannot update the HMI authority. Check the DB 5 access flags in HW Config > CPU > Properties > Protection.Step 5 - Wire the Control Bit to SWR Logic
Map DB5.DBX10.0 to the SWR switchover input. The cleanest way is to write it to the partner request byte of the SWR library:
// OB 1 - cyclic section
U DB5.DBX10.0
= DB100.DBX0.0 // SWR partner switchover request
CALL FB 102, DB 200 // SWR_ZYK - cyclic call
MODE := B#16#0
DB_HALT := 100
DB_SEND := 101
DB_RCV := 102
RETVAL := MW 250
On a positive edge of DB100.DBX0.0, SWR_ZYK executes a controlled switchover and WinCC's @ForceConnection follows automatically when the redundancy option is licensed. The control bit is then reset by the operator (or the SCADA script) to allow a new switchover.
Verification Procedure
- Power-cycle both cabinets in the correct order (CPU-A first).
- In STEP 7 Online > CPU-A > Module Information > Diagnostic Buffer, confirm the entry Redundancy: CPU-A active, CPU-B passive.
- In WinCC Graphics Designer, embed the system tag
@ActiveConnectionon a diagnostics screen; it should display Connection 1 (CPU-A). - Force
DB5.DBX10.0 = 1from the operator panel. The HMI should swap to Connection 2 (CPU-B) within two to four seconds and the redundancy partner should be marked active in the WinCC status dialog. - Reset
DB5.DBX10.0 = 0, power-cycle again, and re-verify that CPU-A is the initial master.
Troubleshooting Matrix
| Symptom | Likely Cause | Check / Fix |
|---|---|---|
| CPU-B always active at cold start | CPU-B 24 V rail rises first | Add timing relay; energise CPU-A first |
| IM 153-2 master system is Profibus-2 (ID 1) | NetPro assignment swapped | Drag master system to Profibus-1; re-download both CPUs |
| WinCC ignores DB5.DBX10.0 | Redundancy option not licensed or trigger tag not mapped | Install WinCC Redundancy authorisation; map bit under Redundancy > Trigger tag |
| Operator cannot write values after switchover | DB 5 access protection in CPU | Open CPU > Protection; remove write-protection for that DB |
| Both CPUs report "active" simultaneously (double-master) | MPI cable between cabinets broken | Check MPI connector pin-out (3 = DATA B, 8 = DATA A); replace lead |
| Switchover succeeds, but next cold start picks wrong CPU again | SWR AG_CN connection table not downloaded to B | In NetPro, Compile and Download Objects > Partner Pair to both stations |
| BF LED lit on the standby CPU | Profibus address conflict (e.g. 3 used twice) | Set unique DP addresses; run Online > Accessible Nodes |
Common Pitfalls and Field Notes
- MMC swap is not a fix. The MPI address and the SWR partner configuration are stored in the project on the MMC. Exchanging the cards to move the role simply rebinds the project to a different rack and breaks the partner handshake at the next restart.
- Identical CPU order numbers matter. Mixing a CPU 315-2DP (6ES7 315-2AG10) with a CPU 315-2DP (6ES7 315-2EH13) on the same SWR pair is not supported. Always pair same-order-number, same-firmware CPUs.
- Watch the 24 V rise time. Switching power supplies with long ramp-up times can cause both CPUs to believe they are the first up within a 100 ms window. Use regulated SITOP 24 V supplies with a rise time below 50 ms.
- Redundancy licence is per-server. If WinCC runs in a redundant server pair, each server needs its own Redundancy authorisation; the runtime silently falls back to a single connection otherwise.
-
Operator-authority tag direction. The control bit
DB5.DBX10.0must be written by the panel. A read-only panel HMI, even with the bit mapped, will not trigger the switchover.
Reference Material
For deeper background on redundancy behaviour in industrial controllers, the manufacturer training manual Mitsubishi Programmable Controllers Training Manual - Redundant Systems provides useful context on role negotiation, hot-standby, and the importance of deterministic power-up sequencing. SCADA-level redundancy concepts (for comparison with WinCC's approach) are covered in the Inductive Automation Ignition - Setting Up Redundancy manual, which describes master/backup election, connection monitoring, and trigger-tag hand-off in a different platform.
FAQ
Will swapping the MMC cards between CPU-A and CPU-B make CPU-A the master?
No. The MPI address and SWR partner configuration are stored on the MMC as part of the project, so swapping the cards re-binds the project to a different rack and breaks the SWR handshake. Use the power-up sequence and FB 101 parameters (DP_MASTER, INITIAL_MASTER) instead.
Why does NetPro show the IM 153-2 station mastered by Profibus-2 (ID 1) instead of Profibus-1 (ID 0)?
The two DP master systems were created in the wrong order, or a download to only one CPU applied a new NetPro image to CPU-A only. Re-assign the redundant station to Profibus-1 in NetPro, then compile and download the partner pair to both CPUs.
Why does WinCC 6.2 ignore the control bit DB5.DBX10.0?
Three common reasons: the WinCC Redundancy option is not licensed, the bit is not mapped as the trigger tag under Computer properties > Redundancy, or the bit resides in a write-protected data block. Verify all three before debugging the PLC code.
Does the SWR library guarantee that CPU-A is always the initial master?
No. SWR resolves the initial active role by which CPU finishes OB 100 first, with the INITIAL_MASTER flag acting only as a tie-breaker. Control the energisation order (or add a 10 s delay on the standby cabinet) to make the result deterministic.
What is the minimum STEP 7 version for SW Redundancy on CPU 315-2DP?
STEP 7 V5.3 SP3 with the SW Redundancy library V1.2 or higher is the typical minimum. Newer service packs add additional status codes but the FB 101 / FB 102 interface and behaviour shown in this article remain valid up to STEP 7 V5.5.