Monitoring AS-OS Connection Status in WinCC: Internal Channel Tags vs Maintenance Station Basic
In SIMATIC PCS 7 WinCC, while communication link status can be viewed manually via the Channel Diagnosis tool, detecting AS-OS connection failures dynamically to trigger custom HMI warning popups is best accomplished using internal communication quality tags or software watchdogs. When an AS connection drops, all associated technological block tags receive bad quality codes (0x00 or 0x4C), which WinCC can evaluate via dynamic dialogs or C-actions. For automated, zero-license system-wide surveillance, engineers should enable 'Maintenance Station Basic' in Plant Hierarchy Settings, which automatically generates AS diagnostic views and triggers native alarm messages upon connection loss.
Table of Contents
- Architecture of AS-OS Communication Monitoring in PCS 7
- Why WinCC Lacks a Single Universal 'PLC Connected' Boolean Tag
- Method 1: Evaluating Tag Quality Codes via Dynamic Dialogs
- Method 2: Software Watchdog Heartbeat Logic in CFC and WinCC
- Method 3: Maintenance Station Basic (Automated Native Diagnostics)
- Comparison Table: AS Connection Monitoring Approaches in WinCC
- Step-by-Step Procedure to Implement a Connection Loss Popup Screen
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of AS-OS Communication Monitoring in PCS 7
In SIMATIC PCS 7, the plant bus links the Operator Stations (WinCC OS) to the Automation Stations (S7-400 or CPU 410-5H) using Named Connections over the SIMATIC S7 Protocol Suite:
- Standard Built-in Failure Indications:
When a network switch fails, an Ethernet cable is severed, or a controller loses power:
1. The WinCC Alarm Control automatically displays a system alarm:Named Connection to AS_x disconnected.
2. All block icons, trend displays, and digital readouts linked to that controller immediately acquire grayed-out shading with a yellow warning triangle, reflecting a Bad Quality Code (0x00or0x4C). - The Plant Ergonomic Requirement:
Control room specifications frequently mandate an unmistakable, high-priority visual popup or full-screen banner stating "PLC COMMUNICATION LOST" to ensure operators immediately recognize when field updates have ceased.
Why WinCC Lacks a Single Universal 'PLC Connected' Boolean Tag
Engineers opening WinCC Tag Management expecting to find a pre-existing boolean tag like AS1_Connected discover that no such simple variable exists in standard projects:
- Object-Oriented Driver Architecture:
The SIMATIC S7 Protocol Suite operates at the channel level. The driver exposes diagnostic states through internal system APIs and the WinCC Channel Diagnosis tool (WinCCChannelDiagnosis.exe), but does not automatically instantiate public user-level boolean tags in the project tag dictionary. - Redundant Channel Independence:
In multi-controller architectures where an OS server connects to ten independent S7-400 stations, each logical connection maintains an isolated state machine. A single global connection tag would be meaningless.
Method 1: Evaluating Tag Quality Codes via Dynamic Dialogs
The simplest, non-scripted technique to detect connection failure on a graphic screen relies on Quality Code Evaluation:
- How Quality Codes Function:
Every WinCC tag carries an 8-bit IEEE Quality Code alongside its process value: 0x80: Good (Normal communication, valid measurement).0x00: Bad (Non-connected, hardware failure).0x4C: Uncertain / Initial Value (No cyclic data response).- Graphic Object Animation:
On a popup picture window or warning banner: - Set the Visible property to Dynamic Dialog.
- Select any cyclic tag originating from the target S7-400 CPU (e.g.,
AS1_HeartbeatorUnit1/Motor1.Status1). - In Dynamic Dialog, set the evaluation type to Quality Code.
- Result: If Quality Code ==
BadorUncertain, set Visible =Yes; If Quality Code ==Good, set Visible =No.
Method 2: Software Watchdog Heartbeat Logic in CFC and WinCC
For absolute determinism across all operating conditions, industrial facilities implement an Active Software Watchdog:
- Automation Station (CFC):
In a cyclic interrupt task (e.g., OB35 at 100 ms), place an integer increment block (ADD_Ior an SCL counter). Every second, the controller increments a global tag:AS_Watchdog_Counter : DINT. When it reaches 100,000, it rolls back to 0. - Operator Station (WinCC Global Script):
A cyclic C-action or VBScript executes every 2 seconds on the OS:
* ReadsAS_Watchdog_Counter.
* Compares the current reading against the value stored from the previous cycle.
* If the value changes, the watchdog timer resets to 0, confirming active communication.
* If the value remains identical for three consecutive cycles (6 seconds), the script asserts an internal binary tagAS_Connection_Failed = TRUE, triggering the warning popup.
Method 3: Maintenance Station Basic (Automated Native Diagnostics)
Siemens provides a fully integrated, automated solution that requires zero custom scripting and zero extra licensing costs: Maintenance Station Basic:
- Native Plant Hierarchy Integration:
In SIMATIC Manager, right-click the Multi-project > Plant Hierarchy > Settings. - Enable Derive diagnostics screens from the plant hierarchy.
- Select Maintenance Station Basic.
- Compilation Automation:
During AS and OS compilation, the wizard automatically parses the hardware configuration and generates a dedicated Diagnostics Area in WinCC. - Automatic System Alarms and Views:
The system creates standardized diagnostic pictures displaying the operational state of all AS controllers, fieldbuses, and CP cards. If a controller drops offline, the Maintenance Station engine raises a high-priority system alarm and illuminates the diagnostic header bar across all client screens.
Comparison Table: AS Connection Monitoring Approaches in WinCC
The following table compares the different methods for monitoring AS connection status:
Step-by-Step Procedure to Implement a Connection Loss Popup Screen
Follow this verified engineering workflow to build an automated connection loss warning popup:
- Create the Watchdog Counter in CFC:
* Open a CFC chart in the target AS program.
* Insert an integer counter block that increments a double word tag (AS1_Heartbeat) every 1 second in OB35.
* Set the attribute{ S7_m_c := 'true' }so the tag transfers to WinCC. - Execute AS and OS Compilation:
* Compile the CFC chart and compile the OS to generateAS1_Heartbeatin WinCC Tag Management. - Configure the Warning Popup Window in Graphic Designer:
* Create a new process screen:@PLC_Connection_Lost.pdl(dimensions: 400x150 pixels).
* Insert a red rectangular panel with bold text: "WARNING: AS1 COMMUNICATION LOST".
* Add an acknowledgment button to close the window. - Embed Picture Window on Master Screen (
@screen.pdl):
* Open the master screen in Graphic Designer.
* Insert a Picture Window object pointing to@PLC_Connection_Lost.pdl.
* Set Window Title, Border, and Movable properties. - Animate Visibility via Quality Code:
* Under Picture Window > Properties > Miscellaneous > Visible, open Dynamic Dialog.
* Tag:AS1_Heartbeat.
* Select Quality Code.
* If Quality Code isBad (0x00)orUncertain (0x4C)-> Set Visible = Yes.
* If Quality Code isGood (0x80)-> Set Visible = No.
* Save the screen.
Verification
Verify that connection failure detection operates reliably:
1. With the plant running normally, verify that @PLC_Connection_Lost.pdl remains hidden and all process graphics update with green indicators.
2. Disconnect the plant bus Ethernet cable from the target S7-400 CPU (or stop S7-PLCSIM); verify that within 2 seconds:
* The warning popup @PLC_Connection_Lost.pdl appears centered on the operator screen.
* All block icons linked to that CPU acquire grayed overlays.
3. Reconnect the Ethernet cable; verify that the connection re-establishes, process values resume dynamic updates, and the warning popup closes automatically.
Limitations and Operational Precautions
- Avoid Excessive Script Polling: Never write tight, high-frequency C-scripts (e.g., executing every 250 ms) to poll dozens of tags for connection health. This overburdens the WinCC script processing queue and slows down operator screen navigation.
- Transient Disconnections: Industrial network re-routing (e.g., MRP ring switchover) can drop communication for 50 to 200 ms. Incorporate a 2-second debounce filter before displaying intrusive modal popup dialogs.
- Redundant AS Controllers (S7-400H): In fault-tolerant systems with redundant CPUs, dropping communication on CPU A while CPU B takes over is a bumpless switchover, not a complete connection loss. Ensure connection monitoring evaluates the Fault-Tolerant S7 Connection rather than an individual physical rack.
- Commercial Accuracy: Maintenance Station Basic is included free with PCS 7. Maintenance Station Standard or Professional requires dedicated license packages (
6ES7658-7BX08-2YB0). Validate software options with an authorized Siemens distributor quotation.
Engineer FAQ
Can I query the WinCC Channel Diagnosis status directly from a C-action?
While possible using internal Siemens DLL function calls (dmclient.dll), it relies on undocumented APIs that can change across service packs. Using Tag Quality Codes or software watchdogs is the supported, future-proof method.
What happens to operator buttons when connection to the AS is lost?
By default, WinCC APL block icons and faceplates automatically disable operator control elements (pushbuttons and setpoint entry fields) when the underlying tag quality code transitions to Bad (0x00), preventing operators from issuing uncommitted commands.
Does Maintenance Station Basic require a separate PC station?
No. Maintenance Station Basic is engineered directly into the existing OS Single Station or OS Server project, utilizing standard WinCC process screens.
Why did my Dynamic Dialog on Quality Code not trigger when the PLC stopped?
If the PLC stopped without severing the network connection, the S7-400 CPU may still respond to S7 communication frames, reporting the last held values. To detect a CPU in STOP mode, evaluate the watchdog counter or monitor the CPU operating state via Maintenance Station.
Technical References
- SIMATIC Process Control System PCS 7 Maintenance Station Manual - Siemens AG
- SIMATIC WinCC V7.4 / V7.5 Communication Manual - S7 Protocol Suite
- SIMATIC Process Control System PCS 7 Advanced Process Library (APL) Manual
Related Articles
- Diagnosing S7 Connection Rejection (Error 0xFFDF 4116) on Redundant WinCC OS Servers
- Establishing Preventative Maintenance Schedules and Condition Monitoring via PCS 7 Maintenance Station
- Restoring Missing Menus and View Toolbars in PCS 7 APL Faceplates in WinCC Runtime
Related Tags
- WinCC Connection
- Quality Code
- Maintenance Station
- Watchdog
- Plant Hierarchy
- Connection Loss