Problem: Duration Column Missing or Empty in WinCC AlarmControl
In SIMATIC WinCC V7.3 (and adjacent releases V7.0 through V7.5 SP2), the WinCC AlarmControl selection can be configured to display only the active state of a message by setting a fixed selection with "Status equal to Came In". When the operator then opens the long-term archive view of the AlarmControl (the "Long-Term Archive" or "Historical Alarms" button), the column Duration either does not appear at all, or appears with empty values.
Operators report two distinct symptoms:
- The Duration field is not offered in the list of available message blocks when configuring the AlarmControl columns.
- The Duration field is shown but evaluates to
00:00:00for every message returned by the Came In filter.
Both symptoms are the result of how WinCC Alarm Logging calculates and exposes the duration of a message event, and how the AlarmControl message block list is populated. The fix is purely configuration; no code change or PLC modification is required.
Root Cause: System Block Activation and Event Pairing
WinCC Alarm Logging writes a discrete record into the message archive for each state transition of an alarm. The two events that matter for duration arithmetic are:
| Event | Status Bit | Meaning |
|---|---|---|
| Came In | 0x00000001 | Condition for the message has become true; alarm becomes active. |
| Went Out | 0x00000002 | Condition has cleared; alarm returns to inactive state. |
| Acknowledged | 0x00000004 | Operator has acknowledged the active alarm. |
| Locked / Unlocked | 0x00000010 / 0x00000020 | Message is hidden or re-enabled by operator action. |
| Comment | 0x00000040 | Operator comment attached to the message. |
The Duration field is a derived value, not a stored one. The runtime computes it as TimeOfEvent(WentOut) − TimeOfEvent(CameIn) for the matching message number / instance. If the Went Out event has not yet been written, the duration cannot be computed and WinCC returns a blank or zero time.
That explains the two root causes for the missing duration:
- System block not enabled. In WinCC AlarmControl, the Duration field belongs to the system message blocks group. If the administrator has restricted the available message block set — typically in the Alarm Logging Editor under Properties > Message Blocks — Duration is hidden from the AlarmControl column configuration dialog.
-
Filter excludes the Went Out event. A fixed selection that contains Status = Came In filters the message stream before the duration calculation runs. Without the matching Went Out event in the working set, the duration column renders as
00:00:00.
The standard selection dialog behavior is documented in the Siemens support entry 27202055 — "What do you do if alarms are not displayed at Runtime?". The control offers an Open Selection Dialog button in its toolbar; operators can broaden the selection at runtime without changing the fixed selection configured at design time.
Prerequisites
- Windows engineering station with the full WinCC Configuration Studio installed (not the Runtime-only install). Required to edit Alarm Logging.
- Local administrator or member of the SIMATIC HMI / WinCC Administrators Windows group so the project can be opened in exclusive write mode.
- Access to the WinCC project file (
.MCP) on the project server, or to the local project path on a single-user station. - A long-term archive connection (segmented SQL database or CAS) if the long-term view is to return data beyond the online tag-logging window.
- WinCC V7.3 or any of the versions listed in the affected products note above. The procedure is unchanged across these versions.
Solution Step 1 — Enable Duration in the Alarm Logging Editor
- Open the WinCC Explorer and start the Alarm Logging editor (right-click > Open).
- In the tree on the left, select the Message Blocks node. The right pane lists all available system blocks, user text blocks, and process value blocks.
- Locate the row labeled Duration in the System column. The default value column shows the data type (
Date/Time) and a fixed length of 8 characters in the formhhhh:mm:ss. - If the row is dimmed or absent, the project is open in read-only mode: close Alarm Logging, exit WinCC Explorer, and re-open the project as a single user with write access.
- Confirm that the Selected check box for Duration is ticked. Click Apply or simply close the dialog — changes are written to
SystemMessages.xmlinside the project folder.
Validate the change at the file level if necessary: the project path <ProjectName>\System\Alarm\SystemMessages.xml must contain the element <Block Name="DURATION" Selected="1" Length="8" /> after the edit. If the element is missing, repeat step 5 with the project in write mode.
Solution Step 2 — Assign the Duration Column in the AlarmControl
- Open the Graphics Designer and load the picture that contains the affected WinCC AlarmControl (object type AlarmControl, OCX from
CCAlgControlHost.ocx). - Right-click the control and choose Configuration Dialog > Message lists tab.
- In the Available message blocks list, scroll to System and expand it. Duration now appears in the list (the visibility of this entry is governed by step 1 above).
- Select Duration and click the > button to move it to the Selected message blocks list on the right.
- Reorder the columns as required. A typical column order is: Date, Time, Status, Message text, Duration.
- Confirm with OK and save the picture (
PDL).
Solution Step 3 — Configure the Selection So That Went Out Events Are Visible
The original configuration filtered the AlarmControl to Status = Came In. This filter is correct for the live view but must be broadened for the long-term archive view, otherwise Went Out events — the ones that actually carry the duration — are excluded.
- Open the AlarmControl configuration dialog > Message lists tab > Selection button.
- Use Fixed Selection = Status >= Came In (instead of equal to). This keeps all Came In, Acknowledged, and Went Out events in the working set.
- Click Add to insert an additional rule: Status = Came In AND Date/Time >= (now − Online interval). This reproduces the "active only" behavior the operator expects on the live tab.
- Switch the Message list type from Active list to Long-term archive list and assign a separate selection of Status = Went Out so the long-term view only shows completed events with a valid duration.
- If the application runs against a redundant server pair, repeat the steps on the standby server and resynchronize the project via Project Duplicator.
The behavior of the open-selection dialog is described in the Siemens runtime support entry referenced above: 27202055. The dialog allows the operator to override the fixed selection at runtime, which is the recommended fallback when the design-time selection cannot be loosened without affecting the live view.
Long-Term Archive Configuration
The long-term archive is a separate configuration object under Alarm Logging > Archives. The Duration column is only useful if the archive segment retains the Went Out events:
- Open Alarm Logging > Archives. The default archive AlarmLogging has one or more segments (typically a short-term SQL segment and a long-term CAS segment).
- Ensure the segment configured as Long-term archive has All messages or at least Came In, Went Out, and Acknowledged ticked in the Event selection property.
- Set the Segmentation cadence so that the segment rotates before it fills the configured disk quota. The default is 7 days.
- If the Long-term archive button in the AlarmControl is greyed out, the segment is not linked to the project. Open Computer properties > Alarm Logging > Archive connections and re-link the archive.
WinCC Unified (TIA Portal) Equivalent Configuration
If the plant is being migrated to WinCC Unified (V16 onward, V18/V19/V20/V21 mainstream), the AlarmControl is replaced by the Alarm Control (RT Unified) screen object. The conceptual model is similar but the configuration paths are different. Background is provided in the TIA Portal help at Alarm control (RT Unified) — WinCC Unified V21:
- Open the HMI screen in TIA Portal and insert the Alarm control from the toolbox under Controls.
- In the properties pane, open Columns and tick Duration. In Unified the column is enabled per view (Active alarms, Historical alarms, Logged alarms) — repeat the action for each view where the column is required.
- Open Selection for the Historical alarms view and confirm the status filter includes Came In and Went Out. Unified does not compute duration on rows whose partner event lies outside the configured time window.
- The Alarm statistics view introduced in V18 displays the display duration (i.e. the time the alarm was visible in the active view) — this is a different field from the message Duration and is not the answer to the current issue.
- Compile and download the HMI station. Runtime needs a full project transfer; an OS update is not sufficient when the Alarm Logging structure has changed.
Verification and Functional Test
- Activate the project on the engineering station. Open the runtime picture that contains the AlarmControl.
- Trigger an alarm from the PLC (e.g. set a tag that drives a bit-message to
1). Confirm the row appears in the live view with Status = Came In. - Reset the tag; the row transitions to Status = Went Out and the Duration column updates to a non-zero value.
- Click the Long-Term Archive button. The same row should appear with the duration value preserved.
- If the column still shows
00:00:00, open the Selection dialog from the toolbar, untick the Status = Came In fixed rule, and re-check. The duration calculation is purely a function of the working set. - Export the AlarmControl via the CSV button and verify the
Durationcolumn is populated in the exported file ashh:mm:ss.
Common Edge Cases and Pitfalls
| Symptom | Likely Cause | Remedy |
|---|---|---|
| Duration column missing from Available message blocks | System block Duration not ticked in Alarm Logging > Message Blocks. | Re-enable per Solution Step 1. |
| Duration shows 00:00:00 for active alarms | Fixed selection filters out Went Out events. | Broaden selection per Solution Step 3 or use the runtime selection dialog. |
| Duration missing only on the client | Server is in use; client is reading a stale mirror. | Re-synchronize the project; verify Package on the client includes Alarm Logging. |
| Long-term archive empty for events older than 7 days | Only short-term segment is configured. | Enable a long-term segment per the Long-Term Archive Configuration section. |
| Duration is correct for the live view but wrong for archive | Time-zone mismatch between server and client. | Set the same Time base on all computers in the project. |
Duration appears as --:--:-- in the web navigator |
WebNavigator client does not render the system block when JavaScript fallback is used. | Switch to the ActiveX runtime or upgrade to WinCC Unified WebUX. |
| CSV export shows blank Duration column | AlarmControl is configured to Export selected columns only and Duration is unchecked. | Re-tick Duration in the export profile. |
Operator-Side Workaround When Engineering Is Locked
If the AlarmControl column configuration cannot be edited (for example on a validated plant with frozen picture revisions), the operator can still recover the duration on demand:
- Click the Open Selection Dialog button in the AlarmControl toolbar.
- Set Status to Went Out and tick Show acknowledged.
- Click OK. The control reloads the message set; rows that have a matching Went Out event now display a non-zero Duration.
- To return to the original view, click Reset selection in the toolbar.
This procedure is the standard mitigation recommended in the Siemens runtime knowledge base 27202055.
Why is the Duration column not offered in the AlarmControl message-block list?
Because Duration is a WinCC system block. It must be enabled in Alarm Logging > Message Blocks > System by ticking the row labeled Duration. If the project is open in read-only mode, the row is dimmed and the block is hidden from the column-selection dialog. Re-open the project with write access and save the Alarm Logging configuration.
The Duration column is visible but always shows 00:00:00. Why?
WinCC computes the duration only when a matching Went Out event exists in the AlarmControl working set. A fixed selection with Status = Came In excludes Went Out events, so the runtime cannot compute a duration. Broaden the selection to include Status >= Came In for the live view, and use a separate Status = Went Out selection for the historical view, or use the runtime selection dialog as documented in Siemens KB 27202055.
Does the Duration value come from the PLC or from WinCC?
It is computed entirely inside WinCC Alarm Logging at runtime. The duration equals TimeOfEvent(WentOut) − TimeOfEvent(CameIn) for the same message number and instance. No additional tag or PLC logic is required, provided both events are present in the message stream.
How is Duration configured in WinCC Unified (TIA Portal)?
Open the Alarm control (RT Unified) properties, go to Columns, and tick Duration for each view where the column is needed (Active, Historical, Logged). The historical view must include the Went Out event in its selection; otherwise the column is empty. Reference documentation: Alarm control (RT Unified).
Why does the long-term archive show no alarms older than 7 days?
The default Alarm Logging archive is a single short-term SQL segment. To retain history beyond the segment rotation, configure an additional long-term CAS segment in Alarm Logging > Archives and link it to the computer. Verify the Archive connections under Computer properties reference the long-term segment, then re-activate the project.