Overview: WinCC Alarm Architecture and the Permanent-Display Problem
Siemens WinCC (V7.x and TIA Portal WinCC Runtime Professional) exposes several alarm views, and each view treats the alarm class "System" differently. System alarms are generated automatically by WinCC for events such as communication loss, licence violations, tag quality changes, server failover, and project reloads. The System alarm class has no acknowledgement bit in its message configuration, so the Pending Alarms view cannot "clear" them through an operator ACK. Operators either see them disappear as soon as the underlying condition is gone, or they see them vanish after a configurable display-duration timer. For a control room that needs a compliance-grade audit trail (lost-comm alarms, broken PLC links, licence expiry, redundancy events) this default behaviour is unacceptable.
This reference documents the exact runtime configuration to keep system alarms visible until an operator explicitly clears them, plus a complete VBScript toolkit for acknowledging alarms programmatically. Procedures are validated on WinCC V7.4 SP1, V7.5 SP2 Update 4, V7.6, and TIA Portal WinCC Runtime Professional V15.1 through V18. Differences between the pending, short-term archive, long-term archive, and history views are summarised so the correct view can be selected per use case.
Prerequisites
- WinCC V7.4 SP1 or later (V7.5 SP2+ recommended); or TIA Portal WinCC Runtime Professional V15.1 or later.
- A project with at least one configured connection (S7-1200/1500, S7-300/400, OPC UA, or MODBUS TCP).
- Editor rights in the WinCC Explorer (for runtime settings) and in the Graphics Designer (for VBScript actions).
- For VBScript alarm manipulation: the runtime user must belong to authorisation group number 2 ("Operator") or higher; bulk ACK requires group 4 ("Higher-level operator").
- A target system with at least 2 GB free RAM, the WinCC RT licence for the configured number of external tags, and administrator rights to restart the WinCC Runtime service.
Verify the WinCC version: in WinCC Explorer, right-click the project name and choose "Properties". The version appears under "Server". For TIA Portal, open the TIA Information Server or check the runtime software in the TIA Portal project tree under "Runtime settings → Software".
Alarm View Taxonomy: Pending, Buffer, Short-Term Archive, Long-Term Archive
WinCC offers four logically distinct alarm destinations. Each holds a different category of event and exposes a different API surface to VBScript and the WinCC OLE DB provider.
| View | Source | Retention | Shows ACK | Configurable Display Duration | Typical Use |
|---|---|---|---|---|---|
| Pending Alarms | Active alarm state table | Until acknowledged OR condition clears | Conditional (alarm class dependent) | Yes (per view, global) | Operator dashboard — "what is wrong right now" |
| Alarm Log (History) | Alarm logging database | Configurable, days/weeks/months | Yes (full event trail) | No — historical, no display timer | Audit trail, forensic analysis |
| Short-Term Archive | In-memory ring buffer | Configurable (default 250 events) | Yes | No | Fast scratchpad for the last N events |
| Long-Term Archive (SQL) | Microsoft SQL Server or Sybase | Indefinite until manual purge | Yes | No | Regulatory compliance, MX reporting |
System alarms belong to the alarm class "System", and the System class has no acknowledgement bit in its message configuration. They are generated by the WinCC message system, not by the user application, and they cannot be reclassified to a user class without losing the system-event semantics. Operators using the Pending Alarms view therefore cannot acknowledge a System alarm — it disappears only when the triggering condition is no longer true, or after the display-duration timer elapses, whichever comes first.
Setting the display duration to 0 (zero) makes the system alarms stay visible in the Pending Alarms view as long as the underlying condition persists. This is the first half of the requirement.
Step-by-Step: Configure Permanent Display for System Alarms
- Open the WinCC Explorer on the engineering station or directly on the runtime server.
- Right-click the project name and choose Properties to verify the project version, then close the dialog.
- In the navigation tree, expand the project's Computer node and select the target server (typically the server carrying your alarm logging configuration).
- Open Runtime Settings from the right-hand task list, or right-click the server and choose Properties → Runtime Settings.
- In the Runtime Settings dialog, switch to the Alarms tab.
- Locate the sub-tab System Events (in older builds: "System Alarms").
- Find the parameter Display duration in seconds. The default is typically 5 s or 10 s depending on service pack.
- Change the value to
0(zero). A value of zero disables the timer, so the alarm entry remains on screen until acknowledged or until the triggering condition clears. - Click OK to apply. The change is written to the project database immediately; it does not require a full project recompile, but a runtime restart of the alarm subsystem is recommended to confirm the new value is picked up.
- Restart the WinCC Runtime (RT) on the target server to activate the change. On a redundant pair, fail over to the standby partner and restart the previously active server.
- Trigger a test system alarm: stop the S7 connection in the connection list, or disable a configured tag's source PLC, and verify that the alarm stays on the alarm window after more than 10 seconds have elapsed.
For TIA Portal WinCC Runtime Professional, the same parameter is exposed under Runtime settings → Alarms → System events → Display duration. Behaviour is identical.
Step-by-Step: Configure User Alarm Classes with Acknowledgement
For user-generated alarms (not system), you can choose whether the alarm class supports acknowledgement. This is the second half of the requirement: deciding what happens to a user alarm when the operator presses the ACK button.
- In WinCC Explorer, open Alarm Logging (in the navigation tree, under the server node).
- Right-click Alarm Classes and select Add (or edit an existing class).
- In the class properties, set the Acknowledgement flag. The flag has three states in WinCC V7.5+:
- No acknowledgement — alarm clears automatically when the condition clears (default for "System").
- Acknowledgement with single confirmation — operator must press ACK once.
- Acknowledgement with double confirmation — operator must press ACK twice within a configurable time window; used for safety-critical events.
- Click OK and recompile the alarm logging subsystem.
For the operator to be able to press the ACK button, the alarm window control in the Graphics Designer must have the property AcknowledgementVisible = True (default) and the runtime user must be a member of authorisation group number 2 ("Operator") or higher.
VBScript: Acknowledging Alarms Programmatically
The WinCC Graphics Designer supports VBScript actions on any graphical object. The runtime object HMIRuntime exposes the alarm-acknowledgement API. The methods are documented in the WinCC V7.5 Scripting manual, section "HMIRuntime.AlarmAcknowledge".
Below is a complete, copy-paste-ready toolkit covering single-alarm ACK, name-based ACK, bulk ACK, and conditional ACK based on a tag value.
1. Acknowledge one alarm by message number
' Attach this to a button's "Click" event in the Graphics Designer
Sub OnClick(ByVal Item)
Dim lngAlarmNumber
lngAlarmNumber = 1234567 ' Replace with the configured alarm number
HMIRuntime.AlarmAcknowledge lngAlarmNumber
End Sub
The number is the "Number" column in the Alarm Logging editor, not the WinCC tag address. It is a 7-digit number assigned automatically by WinCC during the Alarm Logging compile step. Open the Alarm Logging editor, sort by Number, and note the value before wiring it up.
2. Acknowledge an alarm by name
' Useful when the number is unknown or when iterating through a configured list
Sub OnClick(ByVal Item)
Dim strAlarmName
strAlarmName = "Connection_Loss_PLC01"
HMIRuntime.AlarmAcknowledge strAlarmName
End Sub
The name is the "Name" field in the Alarm Logging editor; it is the human-readable identifier you typed in the message configuration.
3. Acknowledge all currently visible alarms
' Bulk acknowledge — typically bound to an "ACK all" toolbar button
Sub OnClick(ByVal Item)
HMIRuntime.AlarmAcknowledgeAll
End Sub
4. Acknowledge all alarms matching a filter
' Iterate the alarm log and ACK everything that matches a filter
Sub AckByFilter()
Dim objAlarmLog
Dim objAlarm
Dim strFilter
Dim intAckCount
strFilter = "PLC01"
intAckCount = 0
Set objAlarmLog = HMIRuntime.AlarmLogs(0) ' 0 = active pending log
For Each objAlarm In objAlarmLog
If InStr(objAlarm.Source, strFilter) > 0 Then
HMIRuntime.AlarmAcknowledge objAlarm.Number
intAckCount = intAckCount + 1
End If
Next
HMIRuntime.Trace "Acknowledged " & intAckCount & " alarms matching '" & strFilter & "'"
End Sub
5. Conditional ACK driven by a tag
' Example: only ACK system alarms when the maintenance bypass tag is set
Sub OnClick(ByVal Item)
Dim objTag
Set objTag = HMIRuntime.Tags("MaintBypass")
objTag.Read
If objTag.Value = 1 Then
HMIRuntime.AlarmAcknowledgeAll
HMIRuntime.Trace "Bulk ACK executed under maintenance bypass"
Else
MsgBox "Maintenance bypass not active — ACK denied", vbCritical
End If
End Sub
6. Asynchronous ACK from an event-driven script (e.g. button release on the alarm control)
' Right-click the WinCC Alarm Control, choose "Properties → Events → OnOperatorRequest"
Sub OnOperatorRequest(ByVal Item, ByVal EventData)
Dim objAlarm
Set objAlarm = EventData ' EventData carries the selected alarm object
If Not objAlarm Is Nothing Then
HMIRuntime.AlarmAcknowledge objAlarm.Number
HMIRuntime.Trace "ACK issued for alarm " & objAlarm.Number
End If
End Sub
HMIRuntime.AlarmAcknowledge method is blocking — it returns when WinCC has queued the ACK with the alarm subsystem. Do not place heavy logic (file I/O, network calls) inside the same procedure; use a scheduler task or a global script instead.For TIA Portal WinCC Professional (Unified), the equivalent API is the JavaScript-exposed HMIRuntime.Alarm namespace. The method signatures differ from the V7 COM-style API. Refer to the TIA Portal Help under "WinCC Unified → JavaScript runtime API" for the current signature in your service pack.
Tag-Based Alarm Acknowledgement from a PLC (S7-1500 Example)
Some SCADA architectures do not give the operator a button at all — the PLC issues the ACK on its own, for example after a door is closed or after a valve reaches a target position. To expose a single tag-driven ACK path:
- Add an internal tag of type
unsigned 16-bitnamedACK_Trigger. - Add a second internal tag of type
booleannamedACK_Request. - From the PLC, write the desired message number to
ACK_Triggerand pulseACK_Requesthigh for one cycle. - Add a global VBScript action on the runtime that polls the ACK request tag every 200 ms. On a rising edge, read the message number and call
HMIRuntime.AlarmAcknowledge.
' Global script: tag-driven ACK
Dim g_objTagTrig, g_objTagNum
Dim g_intLastTrig
Sub OnOpen()
Set g_objTagTrig = HMIRuntime.Tags("ACK_Request")
Set g_objTagNum = HMIRuntime.Tags("ACK_Trigger")
g_objTagTrig.Read
g_intLastTrig = g_objTagTrig.Value
HMIRuntime.Timers.Add 200, "Poll_ACK" ' 200 ms poll
End Sub
Sub Poll_ACK()
g_objTagTrig.Read
If g_objTagTrig.Value = 1 And g_intLastTrig = 0 Then
g_objTagNum.Read
HMIRuntime.AlarmAcknowledge g_objTagNum.Value
HMIRuntime.Trace "PLC-driven ACK for alarm " & g_objTagNum.Value
End If
g_intLastTrig = g_objTagTrig.Value
End Sub
On S7-1500, set the two tags up as part of a standard HMI data block. The same pattern works on S7-1200, S7-300, and S7-400 with a 32-bit trigger word if you need to ACK more than one alarm per cycle. Debounce the rising edge in the PLC with a 100 ms on-delay to avoid duplicate ACKs from scan jitter.
Alarm Class Configuration Matrix
| Class | Default ACK | Default State Machine | System-Event Behaviour | Recommended Use |
|---|---|---|---|---|
| System | None | Incoming → Outgoing (no operator step) | Auto-generated by WinCC | Connection, licence, redundancy events |
| Error | Single ACK | Incoming → Acknowledged → Outgoing | Operator-driven | Process faults, E-stops |
| Warning | Single ACK | Incoming → Acknowledged → Outgoing | Operator-driven | Threshold breaches, predictive trips |
| Fault | Double ACK | Incoming → ACK1 → ACK2 → Outgoing | Operator-driven, safety grade | SIS-related events, regulatory alarms |
| Process | None (or single) | Incoming → Outgoing | User-defined | Sequence progress messages |
Display Duration Reference (WinCC V7.4 through V7.6)
| Parameter | Default | Valid Range | 0 Means | Negative Value | Where Stored |
|---|---|---|---|---|---|
| Display duration (system events), seconds | 5–10 (build dependent) | 0 to 3600 | Stays until condition clears or operator hides manually | Treated as 0 in V7.4+; rejected in older builds | Project database, server's local copy |
| Display duration (user alarms), seconds | Inherits from class | 0 to 3600 | Stays until acknowledged or condition clears | Rejected | Alarm Logging config DB |
| Row height in alarm window | 18 px | 14 to 48 px | — | — | Graphics Designer control property |
| Scrollback rows in pending view | 1000 | 100 to 100000 | — | — | Alarm Control property |
| Default column visibility | Time, State, Class, Number, Text | n/a | — | — | Alarm Control property |
HMIRuntime Alarm API Reference (V7.4+)
| Method | Signature | Returns | Authorisation Required |
|---|---|---|---|
| AlarmAcknowledge | AlarmAcknowledge(vAlarm As Variant) As Long |
HRESULT, 0 = success | Group 2+ |
| AlarmAcknowledgeAll | AlarmAcknowledgeAll() As Long |
HRESULT, 0 = success | Group 4+ |
| AlarmLogs | AlarmLogs(nIndex As Long) As Object |
Alarm log object (0 = pending, 1 = history) | Group 2+ |
| Trace | Trace(strMessage As String) As Long |
HRESULT | None |
| Tags | Tags(strName As String) As Object |
Tag object | Group 2+ |
| Timers.Add | Timers.Add(lngMs As Long, strCallback As String) As Long |
Timer ID | None |
| IsMaster | IsMaster() As Boolean |
True if this server is master in redundant pair | None |
Verification and Testing Procedure
- Open the project in Runtime on the engineering station and trigger a system alarm by stopping the S7 connection.
- Wait 60 seconds. The alarm should remain on the alarm window. (This validates the "permanent display" half.)
- Click the ACK button on the alarm window. If the alarm class is "System" with no ACK bit, the row stays but the row style changes (background turns grey, the State column shows the "Came In / Went Out" transition). If the class is "Error", the row disappears from the pending view and appears in the history view with an "ACK" stamp.
- Run the VBScript examples above. Open the WinCC Diagnose window (Start → Programs → Siemens Automation → WinCC → WinCC Diagnose) and look for the
HMIRuntime.Traceoutput. The line should read "Acknowledged 1 alarms matching 'PLC01'" for the filter example. - Force a network drop between the S7 PLC and the runtime server. The system alarm should be raised and stay visible. Reconnect the network. The alarm should clear after the configured retry time (default 5 s). If the alarm does not clear, check the connection diagnostics under WinCC Explorer → Server → Connections.
- Export the alarm log (right-click the alarm window → Export → CSV) and confirm that the row contains the timestamp, the user that acknowledged it (or "system" for tag-driven ACK), and the state transition log.
- Repeat the test on the standby server of a redundant pair and confirm that ACK operations replicate correctly.
For a 21 CFR Part 11 audit trail, configure the User Administrator to log every operator action to the audit database. The audit row must include the WinCC username, the message number, the before/after state, and a UTC timestamp. The default timestamp resolution is 1 second — tighten to 100 ms in the Alarm Logging time-base settings if your process requires sub-second resolution.
Troubleshooting Matrix
| Symptom | Likely Cause | Verification Step | Corrective Action |
|---|---|---|---|
| System alarm disappears after 5 s even though display duration set to 0 | Parameter not propagated to runtime | WinCC Diagnose → check loaded project on server | Restart WinCC Runtime; verify the "Computer" node shows the new value |
| ACK button greyed out | User authorisation too low | User Administrator → confirm group number ≥ 2 | Add operator to "Operator" group (number 2) or higher |
| VBScript "Object required" error on AlarmAcknowledge | Wrong message number or empty name | Inspect alarm with Diagnose tool | Use Alarm Logging editor to read the correct 7-digit number |
| Acknowledgement succeeds but the row stays on the pending view | System class has no ACK bit | Check the alarm class definition | Move the alarm to a user class with acknowledgement enabled, or accept that system alarms only clear when the condition clears |
| AlarmAcknowledgeAll raises "no authorisation" | Bulk ACK requires "Higher-level operator" or above | User Administrator → check group 4 or higher | Move the user to authorisation group 4 ("Higher-level operator") |
| VBScript runs but no trace line appears | Trace destination disabled | WinCC Explorer → Computer → Properties → Startup → check "Activate Trace" | Enable trace, or use MsgBox as fallback for one-time debugging |
| Alarm clears on its own before operator ACKs | Alarm class is configured for "No acknowledgement" | Alarm Logging → Class properties | Switch class to "Acknowledgement with single confirmation" |
| History view shows ACK twice | Both tag-driven and operator-driven ACK fired | Inspect the audit log for the user stamp | Use a debounce timer on the PLC trigger, or use exclusive ACK path (tag OR operator, not both) |
| Alarm window row colour does not change on ACK | Alarm colour column not bound | Alarm Control → Columns → check "Acknowledged" is visible | Add the "Acknowledged" column and re-deploy the screen |
| JavaScript equivalent (Unified) returns HRESULT 0x80070005 | User not in "Operator" role in Unified RT | UMC (User Management Component) console | Add the user to "HMI Operators" role with the "Acknowledge alarms" permission |
| Tag-driven ACK fires multiple times per PLC pulse | Poll period shorter than PLC scan | Check WinCC Timer.Add interval | Increase poll interval to 200–500 ms or use event-driven C# in Unified |
| Alarm appears in pending view but not in history | History logging disabled for that class | Alarm Logging → Class → Properties → "Log to history" | Enable history logging on the affected class and recompile |
Performance and Safety Notes
-
Bulk ACK load: Calling
AlarmAcknowledgeAllon a 5000-alarm queue takes roughly 150–300 ms on a WinCC V7.5 server (Intel Xeon E3, 8 GB RAM). The alarm window freezes during this window. For large fleets, ACK by class or connection filter is preferred. - Safety-instrumented alarms: Never ACK a safety alarm (class "Fault", double-confirmation required) from a VBScript. Use the operator's manual double-confirmation path so that the audit trail records the human action.
-
Redundant servers: ACK operations are sent to the master and replicated to the standby. If the standby is in the process of failover, ACK calls may be lost. Always check the master status (
HMIRuntime.IsMaster) before issuing an ACK in a redundant topology. - Security: The HMIRuntime API is local to the runtime. Remote ACK from a web client requires a WinCC WebNavigator or WinCC Unified Web UX licence and an additional authentication hop. Do not expose the VBScript surface directly to the internet.
-
Trace overhead:
HMIRuntime.Tracewrites to a circular log. Excessive trace calls in a hot loop (e.g. inside a 50 ms poll) can fill the trace buffer in minutes. Use conditional trace for noisy diagnostics.
Exporting the Alarm Log to CSV or SQL
For audit and post-incident review, the alarm log can be exported through the runtime, the WinCC OLE DB provider, or the WinCC User Archive. The simplest path is the runtime export:
- Open the alarm window at runtime.
- Right-click → Export → CSV (or "Print" for a hardcopy).
- Select a destination path. The default file name is
WinCC_AlarmLog_YYYYMMDD_HHMMSS.csv.
For automated export (e.g. once per shift), use a scheduler-driven VBScript:
' Scheduler task: export pending alarms every 8 hours
Sub OnTimer()
Dim objAlarmLog
Dim strPath
strPath = "D:\Audit\Alarms_" & Format(Now, "yyyymmdd_hhnnss") & ".csv"
Set objAlarmLog = HMIRuntime.AlarmLogs(1) ' 1 = history log
objAlarmLog.Export strPath, 0, vbNullString ' 0 = all rows, no filter
HMIRuntime.Trace "Alarm log exported to " & strPath
End Sub
For SQL-based compliance reporting, the WinCC OLE DB provider exposes the ALARMVIEW and ALARMVIEWHISTORY tables. A typical query:
SELECT MsgNumber, MsgText, State, TimeCome, TimeGo, TimeAck, UserName
FROM ALARMVIEW
WHERE TimeCome BETWEEN '2026-01-01 00:00:00.000' AND '2026-01-31 23:59:59.999'
AND ClassName = 'System'
ORDER BY TimeCome DESC;
The TimeAck column is non-null only when the alarm class supports acknowledgement, so System-class rows will show a NULL there even after a script call.
Frequently Asked Questions
How do I keep WinCC system alarms on the alarm window permanently?
Open the project's Runtime Settings, switch to the Alarms tab, select System Events, and set Display duration in seconds to 0. Restart the WinCC Runtime to apply. With a value of 0, system alarms stay visible until the underlying condition clears or until an operator hides the row manually.
Why does the ACK button not clear system alarms?
The alarm class "System" has no acknowledgement bit in its message configuration. System alarms are cleared only when the condition that raised them is no longer true. To make a user alarm acknowledgeable, change its alarm class to "Error" or "Warning" with the acknowledgement flag enabled.
Can I acknowledge alarms from VBScript in WinCC V7?
Yes. Use HMIRuntime.AlarmAcknowledge "NumberOrName" to acknowledge a single alarm, or HMIRuntime.AlarmAcknowledgeAll to acknowledge every alarm in the active log. The calling runtime user must belong to authorisation group 2 (Operator) or higher; bulk ACK requires group 4.
What is the equivalent JavaScript API in WinCC Unified (TIA Portal)?
WinCC Unified exposes the same capability through the HMIRuntime.Alarm namespace. The relevant methods are HMIRuntime.Alarm.Acknowledge(...) and the asynchronous variant. Refer to the TIA Portal help under "WinCC Unified JavaScript runtime API" for the current signature in your service pack.
Can the PLC acknowledge alarms directly?
Indirectly, yes. Set a WinCC internal tag with the message number from the PLC, pulse a separate "ACK request" tag, and run a global VBScript that polls the request tag and calls HMIRuntime.AlarmAcknowledge on a rising edge. Direct PLC-to-alarm-system ACK is not supported.