Detecting PROFINET Interruption Zones in WinCC 7.2 with S7-400 PLCs
Engineers running a Siemens Distributed Control System (DCS) made up of multiple S7-400 CPUs on PROFINET, supervised from one or more WinCC 7.2 Operator Stations (OS), frequently need a single graphic that visualizes the interruption zone of the plant: that is, the exact pair of CPUs whose S7 or PROFINET connection has failed. The goal is a PDL picture where every healthy CPU-to-CPU line is drawn in green, and any line whose underlying connection has dropped flashes red in runtime until the fault is cleared. This reference walks through the complete implementation: S7 channel configuration, diagnostic tag mapping, PROFINET IO status acquisition, PDL picture construction, and the VBScript that drives the color animation.
1. Problem Definition
A typical plant topology comprises 6 S7-400 automation stations (AS), 1 Engineering Station (ES), and 4 Operator Stations (OS). Every AS exchanges data with its neighbors through S7 connections over PROFINET, and each OS reads data from every AS through a redundant S7 connection pair. The control room needs a single overview picture that shows:
- The 6 AS rectangles laid out geographically (or rack-by-rack).
- Lines between AS pairs that represent the S7 connections.
- One consolidated line per OS to each AS representing the OS-AS connection.
- A green color when the connection is established and quality code = Good.
- A flashing red color when the connection is interrupted, time-out, or quality is Bad.
The challenge is that the WinCC picture only knows the connection state if a tag is configured to expose it. Out of the box, WinCC 7.2 does not provide a per-connection Boolean "Connected/Disconnected" tag. The connection state must be derived either from the AS using system function blocks, or from the OS side by reading the S7 channel's internal connection status, or by evaluating quality codes on cyclic tags.
2. Architecture and Topology
| Station | Count | Role | PROFINET Interface | WinCC Connection |
|---|---|---|---|---|
| AS-1 … AS-6 | 6 | S7-400 CPU 414-3 PN/DP or 416-3 PN/DP | PN-IO (X5 / X8) | S7 Protocol Suite, named "AS_n" |
| ES | 1 | SIMATIC Manager / STEP 7 V5.5 or TIA Portal V13 SP1 | — | Not a runtime target |
| OS-1 … OS-4 | 4 | WinCC 7.2 Runtime + Server | — | Local channel + S7 redundancy |
| Switch layer | — | SCALANCE XC-200 or X-300, DCP-named | PROFINET | Topology discoverable from AS |
2.1 Logical connection map
Each AS is a PN-IO controller. AS-to-AS communication is implemented as S7 connections using the BSEND/BRCV (SFB12/13) or PUT/GET (SFB14/15) family over the ISO-on-TCP transport. A connection name (e.g., "AS_1_to_AS_3") and a local/remote TSAP pair are configured in NetPro. The OS connections are separate S7 connections; they do not share the AS-AS link state. The interruption zone must therefore be evaluated at the OS side by polling the status of each S7 channel instance.
3. Prerequisites
- WinCC 7.2 Update Rollup 1 or later (tested with WinCC 7.2 SP2 HF3) installed on each OS server and client.
- STEP 7 V5.5 SP4 or TIA Portal V13 SP1 Update 4 for the AS project.
- S7-400 CPU firmware V6.0.4 or higher (PN-IO stack ≥ V6.0) to expose the diagnostic records referenced below.
- S7 Protocol Suite channel license on each OS (WinCC Option).
- Read access to the following S7-400 system data areas from WinCC (password/firewall permitting):
- SZL W#16#0x0121 (PROFINET IO status, partial list).
- SZL W#16#0x0131 (PROFINET diagnostics, port and station status).
- Diagnostic buffer of the CPU (read via SFB51 / SFC51).
- OPC UA or named-connection access enabled in the OS firewall for redundant OS pairs.
- VBScript execution rights enabled in the OS runtime user administrator.
4. WinCC 7.2 S7 Channel Configuration
- Open WinCC Explorer on the OS server and expand Tag Management → SIMATIC S7 PROTOCOL SUITE → PROFInet.
- Right-click PROFInet → New Connection. For each AS, create one logical connection with a unique name (e.g.,
AS_1,AS_2, …,AS_6). - Set the Connection Properties:
- IP Address: PROFINET interface of the S7-400 CPU (e.g.,
192.168.10.11for AS-1). - Rack/Slot: 0 / 3 (CPU 414/416 in rack 0, slot 3 is typical for PN-IO).
- Connection Type: S7 Connection (TCP/IP) with ISO-on-TCP, port 102.
- Cycle: 1 s (recommended for diagnostics; faster than 500 ms wastes CPU resources).
- IP Address: PROFINET interface of the S7-400 CPU (e.g.,
- For each OS-to-AS connection, repeat the steps above. Redundancy is implemented by adding a second logical connection to a standby AS or a second physical interface of the same AS and selecting Connection Redundancy in the channel properties.
4.1 Channel diagnostic variables
Once the connections are saved, the channel automatically exposes the system tag @. This tag is a hidden DWORD that reports the raw S7 channel state. The mapping is:
| Bit / Value (DWORD) | Meaning | Color decision |
|---|---|---|
| 0x00000000 | No connection attempt, channel disabled | Gray |
| 0x00000001 | Connecting, hand-shake in progress | Yellow |
| 0x00000002 | Connection established, data cycling | Green |
| 0x00000004 | Connection broken, awaiting retry | Red |
| 0x00000008 | Connection disabled by configuration | Gray |
| 0x00000010 | Connection terminated by remote | Red |
| 0x00000020 | Authentication failed (security on) | Red |
Although WinCC 7.2 documents the existence of @ConnectionState, it is not user-readable by default. To make it accessible to VBScript, add a derived Boolean tag AS_1_OK using the Tag Simulation wizard or expose it manually by following the procedure in section 5.
5. Detecting S7 Connection State at the OS
Two robust methods are commonly combined. Use both, and treat the OS-side state as the primary trigger, with the AS-side heartbeat as a secondary confirmation.
5.1 Method A — Quality Code evaluation on a heartbeat tag
Configure one Boolean tag per AS, e.g., AS_1_Heartbeat, on a 1 s cycle. The AS program toggles this bit in OB1 every cycle, and WinCC evaluates the tag's Quality Code property on every update. In VBScript, HMIRuntime.Tags("AS_1_Heartbeat").Quality returns an integer. The values are:
| Quality Code | Constant | Interpretation |
|---|---|---|
| 0x00000000 | Q_GOOD | Tag is being updated |
| 0x00000040 | Q_GOOD_SUBS | Substituted (substitute value active) |
| 0x00000080 | Q_BAD | Connection lost or device failure |
| 0x000000C0 | Q_BAD_OUT_OF_SERVICE | Tag forced, manual override |
This is the lightest method, since it does not require additional blocks on the CPU side. A stale heartbeat read in WinCC reveals a failed S7 connection almost immediately, because the Quality Code flips to Q_BAD after the configured time-out (default 4 s for an S7 channel, tunable in Connection Properties → Time-out).
5.2 Method B — CPU-side status word via SFC51 / SFB52
For higher fidelity, especially to identify a single failed port while the rest of the network is healthy, expose the CPU diagnostics. In the S7-400 program:
- Create DB
DB_WinCC_Diagwith the following structure:DATA_BLOCK DB_WinCC_Diag STRUCT AS_Quality : DWORD; // 0 = OK, <>0 = error code PN_Status : WORD; // SZL W#16#0131 low word PN_Stations : WORD; // number of reachable PN stations OB86_Count : DWORD; // OB86 invocations since last power-on OB82_Count : DWORD; // OB82 invocations Last_Error : DWORD; // last diagnostic event ID Heartbeat : BOOL; // toggled every OB1 cycle END_STRUCT; END_DATA_BLOCK - Call
SFC51 "RDSYSST"with SZL IDW#16#0131to read PROFINET IO status into the DB on every OB82 / OB86 / OB85 entry, and once at startup. - Call
SFB52 "RDREC"to read the IO device diagnostic record index0xE00Con demand.
WinCC reads the entire DB on a 500 ms cycle. The combination of the heartbeat bit, the OB86 counter, and the SZL W#16#0131 word is more than enough to pinpoint the interruption zone.
6. PROFINET IO Diagnostics
PROFINET provides its own diagnostic model. Each PN-IO device advertises its state in standard records:
| Record Index | Content | Read with | Frequency |
|---|---|---|---|
| 0x8000 | Expected vs. actual PN configuration | SFB52 / SFB53 | Startup |
| 0x800C | NEStationStatus (station failure, line break, port error) | SFB52 | On OB86 |
| 0xE00A | PD Port Data (link, speed, duplex per port) | SFB52 | Every 5 s |
| 0xE00C | PD Port Statistic (frame errors, discards) | SFB52 | Every 30 s |
| 0xF00C | PD Real Identification (vendor, order number) | SFB52 | Startup |
The single most useful field for the interruption zone is the NEStationStatus byte from record 0x800C. Its bits indicate:
- Bit 0 — Station failure (entire device is gone).
- Bit 1 — Reserved.
- Bit 2 — Reserved.
- Bit 3 — Line break on port 1 / port 2 (only for copper).
- Bit 4 — Reserved.
- Bit 5 — Reserved.
- Bit 6 — Reserved.
- Bit 7 — Reserved.
By mapping NEStationStatus into a per-station word in DB_WinCC_Diag, the OS can identify whether an AS is reachable, partially reachable (one port down), or fully disconnected.
7. Configuring Diagnostic Tags in WinCC
The tag set required to drive the network overview picture is summarized in the following table. All tags are read-only from the OS; they live in the AS-side DB DB_WinCC_Diag, except where noted.
| Tag name | Source | Datatype | Cycle | Purpose |
|---|---|---|---|---|
AS_1_HB … AS_6_HB
|
AS DB, byte 16 | BOOL | 1 s | Heartbeat, primary connection indicator |
AS_1_OK … AS_6_OK
|
Derived from AS_n_HB quality |
BOOL | 1 s | OS-side state, drives line color |
AS_1_PNStatus … AS_6_PNStatus
|
AS DB, word 2 | WORD | 2 s | PROFINET NEStationStatus mirror |
AS_1_OB86Cnt … AS_6_OB86Cnt
|
AS DB, dword 6 | DWORD | 5 s | OB86 invocation count |
AS_1_LastErr … AS_6_LastErr
|
AS DB, dword 10 | DWORD | 5 s | Last diagnostic event ID |
OS_1_to_AS_n_OK (24 tags) |
Heartbeat per OS-AS pair | BOOL | 1 s | OS redundancy awareness |
7.1 Creating a derived Boolean tag for quality
- In Tag Management, right-click the parent of
AS_1_HBand choose New Tag…. - Name it
AS_1_OK, datatype Binary Tag. - On the Select dialog, pick Internal Tag and use VBScript to bind it dynamically, or use the Tag Simulation feature with a custom expression
(@[email protected] <> 0x80)returning 0/1. - Alternatively, drive
AS_1_OKfrom a C-script that pollsHMIRuntime.Tags("AS_1_HB").Read().Qualityevery second. This is the most reliable method when the simulation wizard is not expressive enough.
8. Building the Network Picture in Graphics Designer
- Open Graphics Designer on the OS server and create a new picture, e.g.,
NetOverview.Pdl. - Insert six rectangles representing the AS CPUs. Name them
Rect_AS_1…Rect_AS_6in the Object Properties → Name field. - For every AS-AS connection, draw a line object. Name the lines
Line_AS1_AS2,Line_AS2_AS3, etc. Only draw the connections that physically exist in NetPro. - For every OS-AS connection, draw a dashed line. Name them
Line_OS1_AS1,Line_OS1_AS2, …,Line_OS4_AS6. - On each line, configure the Dynamic Dialog for the Line Color property. Bind it to
AS_n_OK/OS_k_to_AS_n_OK:- Value = 0 → Red
- Value = 1 → Green
The Dynamic Dialog returns a Boolean only, so the line is either red or green. To get a flashing effect, use VBScript instead (next section).
9. Implementing the Flashing Animation with VBScript
The animation is driven by a single VBScript action configured on a 500 ms timer in the picture. The script toggles the line color between two reds while the connection is bad, and locks it to green while the connection is good.
9.1 Picture-level script (Global Script or Picture Event)
Open the picture's Event for Open Picture and add the following VBScript to register a 500 ms cycle. (In WinCC 7.2, picture-internal timers are created through the Scheduler wizard in Global Scripts, or you can attach a VBScript to a 500 ms configured Action that runs while the picture is open. The example below uses a Timer Event on a hidden Static Text object whose Output/Input → Event → Timer is fired every 500 ms.)
Sub NetOverview_Timer(Obj)
Dim sLines, sLine, iPhase, oObj, oTag, bOK
sLines = Array( _
"Line_AS1_AS2", "Line_AS1_AS3", "Line_AS2_AS3", _
"Line_AS2_AS4", "Line_AS3_AS5", "Line_AS4_AS5", _
"Line_AS5_AS6", "Line_AS4_AS6" _
)
' Counter 0/1 toggles on each timer event to produce the flash.
iPhase = (iPhase + 1) Mod 2
For Each sLine In sLines
Set oObj = ScreenItems(sLine)
' Tag name is "AS_a_OK" / "AS_b_OK" — derive from line name.
oTag = HMIRuntime.Tags(SplitName(sLine))
oTag.Read
bOK = (oTag.Value = 1) And (oTag.Quality <> 128)
If bOK Then
oObj.LineColor = RGB(0, 200, 0) ' Solid green
Else
If iPhase = 0 Then
oObj.LineColor = RGB(255, 0, 0) ' Bright red
Else
oObj.LineColor = RGB(120, 0, 0) ' Dim red
End If
End If
Next
End Sub
Function SplitName(sLine)
Dim a, p, t1, t2
a = Split(Replace(sLine, "Line_", ""), "_")
t1 = "AS_" & a(0) & "_OK"
t2 = "AS_" & a(1) & "_OK"
SplitName = t1 ' use the source AS for the link state
End Function
9.2 Alternative: per-line direct tag binding
If you prefer a no-script approach, the Line Color property of each line can be bound to a Direct Tag Connection of datatype WORD where bit 0 is green, bit 1 is red. The application controls the bit pattern in the AS, and WinCC applies a discrete mapping (bit pattern → color). Use a custom C-script function block FC_PN_Status in the AS to compute the bit pattern from the heartbeat, the SZL status, and the OB86 counter.
9.3 Line thickness and width as additional cues
For operators sitting far from the monitor, color alone is not enough. Bind the Line Width property of each line to a tag whose value doubles from 2 px to 4 px when the connection is bad, and from 2 px to 6 px when the connection has been bad for more than 30 s. This is implemented by a separate VBScript action with a 1 s cycle that reads the same AS_n_OK tags.
10. Step-by-Step Implementation
- Build the diagnostic DB in STEP 7 as described in §5.2 and download to every AS.
- Configure the WinCC S7 Protocol Suite channel with one connection per AS (§4).
- Create the tag set from §7 in WinCC Tag Management. Verify the Quality Code of
AS_1_HBwith the online tag diagnostics — a wrong rack/slot typically produces Quality Code0x80with a value of 0. - Open Graphics Designer and construct the network picture (§8).
- Add the 500 ms timer action to drive the flash (§9).
- Save the picture and run WinCC Runtime in simulation mode. Click Connection → Diagnosis in the S7 channel to manually toggle a connection into Stop state and verify the line color change.
- Restore the connection and verify the line returns to green within the configured time-out window (default 4 s, recommend 6 s for PROFINET).
11. Verification
| Check | Expected result | Tool |
|---|---|---|
Tag AS_1_HB is updating at 1 Hz |
Quality Code = 0 (Good), value toggling | WinCC Online Tag Diagnostics |
| Diagnostic DB is filled |
AS_Quality = 0, OB86_Count = 0 in steady state |
STEP 7 Monitor/Modify |
| PROFINET SZL readable | SZL W#16#0131 returns 0x0000 in steady state | SFC51 watch table |
| Network picture reflects healthy state | All lines solid green, no flicker | Visual |
| Forced connection stop on AS-3 |
Line_AS1_AS3, Line_AS2_AS3, Line_AS3_AS5 flash red within 6 s |
WinCC Channel Diagnosis + visual |
| Alarms generated | WinCC Alarm Logging raises "Connection to AS-3 interrupted" message | Alarm Logging viewer |
12. Troubleshooting Matrix
| Symptom | Probable root cause | Fix |
|---|---|---|
| All lines red, even on healthy network | Wrong rack/slot configured in S7 channel | Set Rack 0, Slot 3 (CPU 416) or 0/4 (CPU 414). Verify with Tag Diagnostics. |
| Quality Code = 0x80 permanently | Firewall on OS blocks TCP/102 | Open TCP/102 inbound/outbound. On Windows Server 2012 R2, allow SIMATIC WinCC S7 Channel in the firewall rules. |
| Line flickers red for 1 s then green, repeatedly | CPU scan time > configured cycle (1 s) of heartbeat | Increase cycle of AS_n_HB tag to 2 s, or move heartbeat into OB35 with 100 ms phase. |
| Color change not visible in Runtime | VBScript timer not firing | Check Global Script → Actions: the action must be associated with the picture and the trigger must be Picture Cycle. |
| One line permanently gray | Connection is disabled in the S7 channel (state 0x08) | Open Connection Properties and clear Disable Connection. |
| All lines red after OS restart, green after 30 s | OS cold start, channel initialization delay | Configure OS startup script to delay display of NetOverview.Pdl for 30 s. |
| OB86 invoked but line stays green | AS still reachable at TCP level, SZL W#16#0131 not updated | Add explicit SFC51 call inside OB86 to refresh the diagnostic DB. |
| NEStationStatus bit 3 set but link up | Optical/electrical port mismatch, e.g., SFP not seated | Check SCALANCE port LEDs, replace SFP, verify fiber budget. |
13. Field-Proven Caveats
- Quality Code
0x40(substitute value active) is silently treated as Good by most operators. Add an explicit Line Width multiplier when Quality Code ≠ 0 to surface the substitute state visually. - The S7-400 PN-IO stack reports a port failure up to 60 s after the physical link drops. Do not trust a 1 s heartbeat for fast port-flap detection; rely on the OB86 event timestamp.
- If the OS uses WinCC redundancy (Server 1 + Server 2), the channel quality may differ between the two servers when the active server has not yet reconnected. Use the redundant server's heartbeat tag for the picture only after both servers report the connection healthy.
- WinCC 7.2's Graphics Designer has a known bug where dynamic Line Color bindings silently fail if the picture is opened from Process Tag Logging and not from the main menu. Re-open the picture from Graphics → Open to recover.
- Operators typically want the picture to open automatically on every alarm. Use Alarm Logging → Function Trigger on message number
50011-50019to callOpenScreen("NetOverview.Pdl", "Popup")whenever a connection error is raised.
14. Summary
The "interruption zone" in a WinCC 7.2 + S7-400 PROFINET DCS is best detected by combining a low-cost OS-side Quality Code check on a CPU heartbeat tag with a richer AS-side diagnostic record that mirrors the PROFINET SZL W#16#0131 and the OB86 invocation count. The Picture Designer is then a thin layer that binds the Line Color property to those tags, with a small VBScript timer driving the red flash. The pattern is portable to WinCC 7.3, 7.4, and 7.5 with no source change beyond the picture file, and it scales to dozens of AS-AS links without flooding the operator with pop-ups because the picture is a single overview rather than per-link screens.
15. FAQ
What is the "interrupt zone" in a WinCC 7.2 S7-400 system?
The interrupt zone is the set of PLC-to-PLC or OS-to-PLC S7 connections that have failed and that the operator picture is highlighting in flashing red. It is a SCADA visualization concept, not a system-defined attribute, and is built from per-connection diagnostic tags in the S7-400.
Which WinCC 7.2 channel should I use for an S7-400 PN/DP CPU?
Use the SIMATIC S7 Protocol Suite → PROFInet channel. The newer SIMATIC S7-1200/S7-1500 Channel does not support S7-400 CPUs. Configure one logical connection per AS with rack 0, slot 3 or 4 depending on the CPU type.
How fast does WinCC detect a lost PROFINET connection?
Default time-out is 4 s for the S7 channel; with a 1 s heartbeat tag the operator picture updates within 5-6 s. The S7-400 OB86 fires within 1 s of a port or station failure, so DB-side detection is faster than the OS-side Quality Code flip.
Can I detect a single-port failure (only port 2 down) on a ringed PROFINET network?
Yes. Read record 0x800C (NEStationStatus) with SFB52 inside OB86 and store the result in a DB word. Bit 3 of the station status byte indicates a line break on port 1 or 2 of the affected device, allowing WinCC to surface a partial-failure state rather than a full red.
Does the picture need VBScript, or can Dynamic Dialog do the flashing?
Dynamic Dialog supports only two colors per Boolean value. The flashing effect (alternating bright red and dim red) requires a VBScript action with a 500 ms cycle. C-script with SetPropWord is also supported in WinCC 7.2 and is faster for very large pictures with more than 200 line objects.
Is this the same as the FANUC DCS zone used in robot cells?
No. The Siemens WinCC "interrupt zone" is a SCADA visualization of network failure. The FANUC DCS (Dual Check Safety) zone is a robot safety feature that limits speed and position when a robot enters a defined Cartesian area — see Configuring a Restricted DCS Zone with a Speed Check for the safety system.