Overview of System Diagnostics in S7-300 Software Redundancy
System Diagnostics for the SIMATIC S7-300 Software Redundancy (SWR) configuration monitors the health of PROFIBUS DP slaves and the I/O modules installed behind them. When you run two S7-300 stations (or one S7-300 plus one S7-400) linked through a bus system with a redundant user program, the diagnostic view extends to every ET 200M station connected to either CPU via PROFIBUS DP. The diagnostic chain covers three layers:
- Interface Module (IM 153-2 / IM 153-4) operating state and backplane status.
- Signal Module (SM 321 / SM 322 / SM 331 / SM 332) presence, type identification, and parameterization errors.
- Channel-level faults on the SM itself, including wire break, short circuit, and out-of-range values.
System Diagnostics is delivered as a separate optional package within the STEP 7 V5.x environment and is functionally distinct from the ProAgent/ProTool/Pro diagnostics chain that targets HMI panels. It exposes standardized diagnostic data through System Status Lists (SSL) and Standard Diagnostic Data (DD) records that any SCADA front-end can consume, including IEC-104-based systems such as VICOS OC.
Supported Hardware Matrix for S7-300 SWR + ET 200M Diagnostics
| Component | Order Number | Firmware | Diagnostic Capability |
|---|---|---|---|
| CPU 315-2 DP | 6ES7315-2AG10 | V2.x and later | SSL partial lists, OB 82 / OB 86 |
| CPU 317-2 DP | 6ES7317-2AJ10 | V2.x and later | Full SSL, channel diagnostic events |
| CPU 319-3 PN/DP | 6ES7319-3EL00 | V3.x | Full SSL, channel diagnostic events |
| IM 153-2 (FO) | 6ES7153-2BA70 / 2BB00 | V4.x | Station diagnostics, hot-swap events |
| IM 153-4 PN | 6ES7153-4BA00 | V4.x | Station diagnostics via PROFINET |
| SM 321 DI 16x24 VDC | 6ES7321-1BH02 | — | Module + channel diagnostic (with HW Config) |
| SM 321 DI 32x24 VDC | 6ES7321-1BL00 | — | Module diagnostic only |
| SM 322 DO 16x24 VDC/0.5A | 6ES7322-1BH01 | — | Module + channel diagnostic (configurable) |
| SM 322 DO 8x230VAC/2A | 6ES7322-1BF01 | — | Module diagnostic, no channel-level |
| SM 331 AI 8x12 Bit | 6ES7331-7KF02 | — | Module + channel diagnostic (wire break on 4–20 mA) |
| SM 332 AO 8x12 Bit | 6ES7332-5HF00 | — | Module + channel diagnostic (wire break on voltage output) |
| SM 334 AI 4/AO 2x8 Bit | 6ES7334-0CE01 | — | Module diagnostic only |
Verify the catalog number against the Siemens SIMATIC S7-300 Module Data manual before commissioning; diagnostics support varies by hardware revision even within the same MLFB.
How SWR Reports Diagnostics from ET 200M Stations
The S7-300 SWR package reserves PROFIBUS DP slots on each CPU for partner-CPU handshaking and replicates the process image. Diagnostic events from ET 200M stations propagate identically to both redundant CPUs because the SWR user program accesses the same logical DP addresses regardless of which physical CPU is currently MASTER. When the standby CPU takes over, OB 70 (CPU redundancy error) or OB 83 (pull/plug) is triggered on the new master, and the diagnostic buffer receives a timestamped entry.
For more detail on the underlying redundancy architecture, see the Siemens reference Software redundancy for SIMATIC S7 (PDF). The S7-1500R/H documentation describes the equivalent mechanism for the newer platform; while the CPU generation differs, the conceptual handling of Loss of redundancy CPU events documented at TIA Portal: Loss of redundancy CPU confirms that OB 70 / OB 86 handling patterns apply to both generations.
System Diagnostics Package Installation and Licensing
The optional System Diagnostics package installs under Start > SIMATIC > STEP 7 > System Diagnostics once the licensed setup runs. It is licensed separately from STEP 7 and from the SWR option (order number 6ES7862-1AC00-0YA5 for SWR V2.x). Activation requires:
- Insert the System Diagnostics CD into the engineering station.
- Run
Setup.exeas administrator and select the matching STEP 7 V5.x version. - Transfer the license key to the local USB license dongle or hard-disk key using the Automation License Manager.
- Restart the STEP 7 SIMATIC Manager; the System Diagnostics node appears under the S7 project.
Reading Channel-Level Diagnostics from Standard S7-300 I/O
Channel-level diagnostics are available on standard S7-300 SM modules provided the diagnostic interrupt is enabled in HW Config and OB 82 is loaded on the CPU. The procedure is as follows:
- Open the ET 200M station in HW Config and select the SM (e.g., SM 331 AI 8x12 Bit).
- In the Inputs tab, set Diagnostic Interrupt = Enabled for each channel where wire break or overflow detection is needed.
- Confirm that Hardware Interrupt is configured for the upper/lower limit if process alarms are also required.
- Download the HW Config to both redundant CPUs.
- Insert OB 40 (hardware interrupt) and OB 82 (diagnostic interrupt) into the offline block container; both must exist or the CPU goes into STOP on the first fault.
When the SM raises a channel fault, the operating system writes a standardized diagnostic record starting at byte 0 with the following structure (per EN 50170 / IEC 61158):
| Byte | Content | Example (SM 331 wire break on Ch 4) |
|---|---|---|
| 0–5 | Header (station, slot, module type, sequential number) | 00 00 12 03 84 80 |
| 6–7 | Channel-related diagnostic identifier (W#16#8000 type) | 00 10 |
| 8–9 | Channel number | 00 04 |
| 10–11 | Channel error type (W#16#0006 = wire break) | 00 06 |
| 12+ | Extended error / manufacturer-specific data | 00 00 |
Call SFC 13 "DPNRM_DG" in OB 82 with the slot address from OB82_MDL_ADDR to read the full record into a user DB:
CALL "DPNRM_DG"
REQ := TRUE
LADDR := #stat_LADDR // W#16#0xxx from OB82_MDL_ADDR
RET_VAL := #stat_RetVal
RECORD := P#DB100.DBX 0.0 BYTE 32
BUSY := #stat_Busy
END_CALL
Line Monitoring on Standard S7-300 Digital Modules
Line monitoring — automatic detection of wire break, sensor supply short circuit, or load voltage loss on individual channels — is implemented as a subset of channel-level diagnostics and is only present on certain SM 321 / SM 322 variants.
| Module | Line Monitoring Capability | Configuration |
|---|---|---|
| SM 321 DI 16x24 VDC (6ES7321-1BH02) | Wire break on Ch 0–7 only when configured as NAMUR | HW Config > Diagnostics enabled per channel |
| SM 321 DI 16xNAMUR (6ES7321-7TH00) | Wire break + short circuit per channel | HW Config > Channel diagnostics = ON |
| SM 322 DO 16x24 VDC/0.5A (6ES7322-1BH01) | Wire break detection when output type = P-switching | HW Config > Diagnostics enabled per channel |
| SM 322 DO 8x230 VAC/2A (6ES7322-1BF01) | No line monitoring (relay output) | — |
| SM 322 DO 8x30 VDC/2A (6ES7322-1BF00) | Fuse blown diagnostic only | Module-level diagnostic |
Confirm the catalog number is one of the variants supporting line monitoring. If the module is the standard SM 321-1BH02 without NAMUR, wire break cannot be reported at channel granularity; only a loss of process voltage at the module terminals is announced as a module-level diagnostic.
Integrating Diagnostics with VICOS OC over IEC-104
VICOS OC is the ABB substation controller SCADA front-end used in energy and traction substations. It does not consume Siemens S7 proprietary diagnostics directly; it expects IEC 60870-5-104 information objects mapped to internal data points. The pattern below extracts diagnostics into a STEP 7 DB and exposes the bits over IEC-104.
- Define a global diagnostic DB (e.g., DB 200) with one DWORD per ET 200M slot and one BOOL per channel fault.
- Program OB 82 to set the bit corresponding to the faulty slot/channel and write a timestamp from
OB82_DATE_TIME. - Cycle the data through an S7 communication block — typically
PUT/GETto an S7-400 protocol gateway running IEC-104 firmware (e.g., ABB RTU 560 series or SAT 143). - Map the DB bits to IEC 104 ASDUs in the gateway configuration:
| IEC 104 ASDU Type | Meaning | Mapping Example |
|---|---|---|
| Type 1 (M_SP_NA_1) | Single-point indication with quality | DB200.DBX0.0 = ET 200M #1 IM present |
| Type 3 (M_DP_NA_1) | Double-point indication | DB200.DBX0.1/.2 = redundant CPU state (00=both RUN, 01=master RUN, 10=standby) |
| Type 30 (M_SP_TB_1) | Single-point with CP56Time2a timestamp | DB200.DBX10.0 = SM 321 Ch0 wire break |
| Type 31 (M_DP_TB_1) | Double-point with CP56Time2a | DB200.DBX10.2/.3 = breaker position |
| Type 45 (M_NC_NA_1) | Step position (for transformer tap) | DB200.DBD12 = tap value (–32..+32) |
The CP56Time2a format used by IEC-104 is a 7-byte BCD timestamp. Build it from OB82_DATE_TIME using the standard Siemens date-and-time conversion functions (FC 6 / FC 7) before writing to the gateway DB.
System Status List (SSL) Partial Lists Used by SWR Diagnostics
SFC 51 ("RDSYSST") provides indexed access to the partial system status lists that contain diagnostic information about modules and racks. The following SSL IDs are particularly relevant for SWR + ET 200M diagnostics:
| SSL ID (W#16#) | Index | Content |
|---|---|---|
| 00B2 | Slot | Module status (correct / incorrect / not parameterized / faulty) |
| 00B3 | Slot | Logical address assignment for the module |
| 00B4 | Slot | Module identification (MLFB and firmware) |
| 0111 | Slot | Channel-specific diagnostic state |
| 0092 | CPU | Communication status (number of connections) |
| 0013 | — | Diagnostic buffer entries (newest first) |
| 0132 | — | Diagnostic buffer entries in CSV format |
CALL "RDSYSST"
REQ := TRUE
SSL_ID := W#16#0B2 // Module status
INDEX := W#16#0008 // Slot 8
RET_VAL := #stat_RetVal
BUSY := #stat_Busy
SSL_HEADER:= P#DB201.DBX0.0 BYTE 4
DR := P#DB201.DBX4.0 BYTE 32
END_CALL
Step-by-Step Commissioning Procedure
- Hardware check: Confirm both redundant CPUs, both IM 153-2 modules (one per ET 200M), and all SMs are seated and bolted. Verify PROFIBUS termination at both cable ends with the standard Siemens PROFIBUS connector (6ES7972-0BA12 with PG socket, or 6ES7972-0BB12 with diagnostics LED).
- HW Config upload: Open STEP 7 SIMATIC Manager, connect online to each CPU, and run PLC > Upload Station to PG to capture the actual configuration. Compare against the offline project.
- Enable diagnostic interrupts: For every SM where channel-level diagnostics are required, open the module properties and tick Diagnostic Interrupt. Save and download to both CPUs.
- Load OB 82 and OB 86: Insert OB 82 (diagnostic interrupt) and OB 86 (rack failure) into the offline project. If SWR is configured, also load OB 70 (redundancy error) and OB 83 (pull/plug). At minimum OB 82 must be present; the CPU otherwise enters STOP on the first diagnostic event.
- Build diagnostic DBs: Create DB 200 (bit-mapped module status) and DB 201 (SSL header + data buffer). Cross-reference each bit to the channel number from the HW Config diagnostic address list.
- Configure System Diagnostics package: If ProAgent HMI blocks are needed, open the project node System Diagnostics, click Generate Block, and assign the resulting FB 126 / FB 127 to the OB 82 call.
- Wire DB bits to IEC-104 gateway: Configure PUT/GET access rights in the CPU properties (no password for the gateway partner). Build the IEC-104 point list in the gateway's configuration tool using the bit-to-ASDU table above.
- Force test fault: Remove a digital input wire to simulate wire break. Verify that DB 200 updates, OB 82 executes, the gateway reports the change to VICOS OC, and the timestamp is present in the IEC 104 event list.
Verification Checklist
- OB 82 executes on both CPUs; diagnostic buffer entries are timestamped and identical in content.
- DB 200 reflects the active fault within one OB 82 cycle (typically < 50 ms).
- VICOS OC event log shows the corresponding IEC 104 information object with CP56Time2a timestamp accurate to 1 ms.
- Loss of a complete ET 200M station triggers OB 86 with
OB86_EV_CLASS = B#16#39; DB 200 marks the slot as station failed. - Standby CPU takes over within the SWR watchdog window (default 400 ms) and continues diagnostics without operator intervention.
- CPU diagnostic buffer can be read via SFC 51 ID 0132 in CSV for offline post-mortem.
Troubleshooting Matrix
| Symptom | Probable Cause | Diagnostic Action | Resolution |
|---|---|---|---|
| DB 200 stays all-zero despite physical fault | OB 82 not loaded on this CPU | Open the online block list; verify OB 82 exists | Download OB 82 with STEP 7 > Download
|
| VICOS OC reports wrong slot | Bit mapping in gateway offset incorrectly | Force a single SM and trace the IEC 104 ASDU | Re-map the IEC 104 point list with the correct bit offset |
| CPU enters STOP on first diagnostic event | OB 82 missing or OB 86 missing | Check diagnostic buffer entry "OB not loaded" | Insert and load OB 82 / OB 86 |
| Wire break reported only on master CPU | Standby CPU's process image is not updated by SWR for diagnostics | Read OB 82 start info from both CPUs | Use SFC 13 in OB 1 on both CPUs; SWR replicates the result |
| Channel-level diagnostic bit toggles continuously | Sensor supply unstable or contact bouncing | Measure voltage at the module terminals | Stabilize supply, add input filter, adjust HW Config debounce |
| System Diagnostics blocks (FB 126/127) not generated | License missing or wrong STEP 7 version | Check Automation License Manager | Install license key matching STEP 7 V5.x release |
| PROFIBUS DP slave drops out intermittently | Termination resistor missing or wrong IM firmware | Check termination voltage and IM firmware version | Enable termination on last node, update IM firmware to V4.x |
| Standby CPU does not take over after IM failure | SWR watchdog too tight for diagnostic load | Review SWR block parameters in FB 101 | Increase SWR monitor time in HW Config (CPU properties > Redundancy) |
FAQ
Does System Diagnostics support IMs and IO/CP modules installed in ET 200M racks of an S7-300 SWR configuration?
Yes. System Diagnostics covers the IM 153-2 / IM 153-4 station, every SM 321/322/331/332 module on the ET 200M backplane, and any CP (e.g., CP 341) configured in the station, provided OB 82 is loaded and the modules have diagnostic-interrupt capability enabled in HW Config. The SWR user program accesses logical PROFIBUS addresses identically on both CPUs, so diagnostic events propagate to both stations.
Is System Diagnostics a separate software package or a built-in feature of STEP 7?
System Diagnostics is a separate optional package installed alongside STEP 7 V5.x. It supplies the ProAgent overview blocks (FB 126 / FB 127) and standardized diagnostic display symbols. The underlying diagnostic data is always available through SFC 13 (DPNRM_DG) and SFC 51 (RDSYSST) regardless of whether the package is licensed.
Can diagnostic status be extracted as DB / flag bits so it can be mapped to IEC-104 for VICOS SCADA?
Yes. Program OB 82 (and OB 86 for station-level events) on both redundant CPUs to copy OB82_MDL_ADDR, channel number, and error type into a dedicated DB such as DB 200. Expose this DB to the IEC-104 gateway via S7 PUT/GET, then map each bit to an ASDU (Type 1 single-point, Type 30 single-point with timestamp, Type 3 double-point) in the gateway configuration.
Is channel-level diagnostics possible on standard S7-300 I/O modules?
Channel-level diagnostics are supported on specific SM variants — for example SM 321-1BH02 (DI 16), SM 322-1BH01 (DO 16), SM 331-7KF02 (AI 8), and SM 332-5HF00 (AO 8). Configure per-channel diagnostic interrupt in HW Config and ensure OB 82 is present. Modules that only support module-level diagnostic (e.g., SM 321-1BL00, SM 334-0CE01) report faults aggregated to the module slot without individual channel identification.
Is line monitoring possible with standard S7-300 I/O modules?
Line monitoring — wire-break and short-circuit detection at the channel — is available only on specific SM 321/SM 322 variants such as the SM 321-7TH00 NAMUR input or the SM 322-1BH01 output configured for P-switching. The standard SM 321-1BH02 24 VDC input does not support per-channel line monitoring; only a loss of the module's process voltage is announced as a module-level diagnostic event.