Resolving WinCC Alarm Comments Not Displayed in User Text Block
Affected products: SIMATIC WinCC V7.x, SIMATIC WinCC Professional / Advanced / Comfort (TIA Portal V15 to V17). Symptom class: Alarm Control display buffer stale on long-term archive list after operator adds a comment. Severity: Operational (cosmetic) — the comment is written correctly, only the on-screen user text block lags.
Problem Description
The WinCC Alarm Control exposes a configurable user text block in the long-term archive list. When the block is configured to show Comment, Computer, and User (the three fields produced by the Add comment dialog), the new comment written by the operator does not appear in the block immediately. It appears only after the operator performs a second list change: e.g. switch from the long-term archive list to the short-term archive list, then back to the long-term archive list. The comment is not lost — it is present in the archive row, in the SQL backend (if any), and in the Audit trail.
Typical operator report:
I enter a comment on a message in the long-term archive. The dialog closes with OK. I switch to the short-term archive list, then back to the long-term archive list. The new comment is not shown in the user text block column. I switch to the message list and back — then it shows.
Affected Versions
| Product Line | Engineering Tool | Runtime / Firmware | Behavior Confirmed |
|---|---|---|---|
| SIMATIC WinCC V7.3 | WinCC Explorer | WinCC RT V7.3 | Yes |
| SIMATIC WinCC V7.4 | WinCC Explorer | WinCC RT V7.4 | Yes |
| SIMATIC WinCC V7.5 / V7.5 SP1 | WinCC Explorer | WinCC RT V7.5 | Yes |
| SIMATIC WinCC Professional | TIA Portal V15, V15.1, V16, V17 | WinCC RT Professional | Yes |
| SIMATIC WinCC Advanced | TIA Portal V15–V17 | WinCC RT Advanced on PC | Yes (no long-term archive on Comfort panels) |
| SIMATIC Comfort Panels (TP, KP, MP) | TIA Portal V15–V17 | Panel firmware 15.x–17.x | N/A — no long-term archive list |
The behavior is independent of the project topology (single-user, client-server, redundant) and the archive backend (file-based ring buffer, SQL Server native archive, WinCC Archive Connector).
WinCC Alarm Control — How the User Text Block Works
Before applying a workaround, understand the components involved. The Alarm Control in WinCC (CCAlarmControl) is a Win32 / WPF control that renders one of three message lists at a time:
- Message list — active messages that have not been moved to the archive.
- Short-term archive list — recently archived messages, retained in volatile memory.
- Long-term archive list — messages that have been moved to the configured long-term archive (SQL database or segmented file).
Each row of the visible list is composed of standard message blocks (date, time, state, number, type, duration, event, acknowledgement) and any number of user text blocks. User text blocks are configured under Alarm Control → Properties → Message blocks → User text (WinCC V7) or AlarmControl → Properties → Columns → User-defined columns (TIA Portal). The available selections for a user text block include Comment, Computer, User, and a number of project-specific selections driven by the user text configuration tool (Textbibliothek / User text blocks editor).
The Comment / Computer / User values are not part of the original alarm row. They are written into a separate comment buffer when the operator confirms the Add comment dialog. The buffer is keyed by the message number and the time-stamp of the original event. The Alarm Control reads the buffer on list load and displays the three fields in the user text block. It does not re-read the buffer for rows that are already in the currently loaded list.
Root Cause
When the operator presses OK in the comment dialog, WinCC runtime writes the comment, the computer name, and the author to the archive row. This write is immediate and durable. The Alarm Control, however, holds the visible row set in an in-memory cache. A successful write to the archive does not invalidate that cache. The next operation that forces a re-read of the rows is a change of the active message list, because each list change triggers a fresh load of the row set. This is why the comment becomes visible after a list toggle and not before.
Siemens documents this in the WinCC Alarm Control Help under the User text blocks topic and in the related Industry Online Support FAQ "How do you display or print the content of the comments dialog box (comment, computer, author)?". The Help states:
The comments on a message can only be allocated within the long-term archive list in WinCC runtime. The Comments on a Message is only displayed in the user text block after a list change (e.g. changing to the short-term archive list or message list). That means, changing back to the long-term archive list.
Reproduction
- Open the WinCC Runtime project on the engineering station or the runtime server.
- Open the Alarm Control and switch to the Long-term archive list.
- Make sure the following user text blocks are configured in the long-term archive list:
Comment,Computer,User. - Select an acknowledged message that is in the long-term archive (it must already be archived, otherwise the comment dialog will not be available).
- Right-click the row → Add comment (or use the Alarm Control toolbar button).
- Enter a comment, e.g.
REPRO-001, confirm with OK. - Switch the list to Short-term archive list and back to Long-term archive list — the comment is not shown in the user text block.
- Switch the list to Message list and then back to Long-term archive list — the comment is shown.
Diagnostic Flowchart
Workaround 1 — Forced List Change (Officially Documented)
This is the workaround Siemens documents in the Alarm Control Help and the linked FAQ. It is a manual operator action and requires no configuration change.
- From the list where the comment was just added, click the Alarm Control list selector and pick any other configured list (for example Message list).
- Wait for the list to finish loading — the status bar shows the number of rows.
- Click the list selector again and pick the original list (e.g. Long-term archive list).
- The Comment, Computer, and User columns now display the values that were just written.
For screen designs where the operator rarely leaves the long-term archive list, add a hotkey or a button that briefly switches to a hidden list and back. In TIA Portal, place two buttons on the screen: Button A sets the Alarm Control property "Index of message list" = 0 (message list); Button B sets it to 2 (long-term archive list). Wire Button A with a one-second delay timer that automatically fires Button B.
Workaround 2 — Add the Comment in the Message List
The message list always re-reads the comment buffer when the row is rendered. If the operator workflow permits, open the comment dialog from the message list rather than from the long-term archive list. The comment then appears immediately on the same screen.
- Configure the Alarm Control so the "Add comment" toolbar button is only enabled in the message list.
- Provide a screen button that selects the message list before the comment dialog is opened.
- After the operator confirms the comment, the message list re-renders the row and the new comment is visible.
Use the Alarm Control function OperatorInputMessageComment from a button click event to open the comment dialog. The same function is available in TIA Portal WinCC Professional under the HMI tags and screen items API.
Workaround 3 — Scripted Refresh of the Alarm Control
The Alarm Control exposes a Refresh method through the runtime automation interface. Force a refresh of the long-term archive list immediately after the comment dialog returns. This is the cleanest fix and is invisible to the operator.
VBScript — TIA Portal WinCC Professional (attach to the OnCommentAdded event of the Alarm Control):
' HMIRuntime is the global runtime object
' The Alarm Control's screen item name is "AlarmControl1"
Sub AlarmControl1_OnCommentAdded(ByVal lMsgNr As Long, _
ByVal lCommentText As String)
Dim oCtrl
Set oCtrl = ScreenItems("AlarmControl1")
' Force the Alarm Control to discard its in-memory row buffer
oCtrl.Refresh
' Re-select the long-term archive list (index 2: 0=Message, 1=Short-term, 2=Long-term)
oCtrl.ActivateListByIndex 2
End Sub
C-Script — WinCC V7 (attach to the OnCommentAdded event of the Alarm Control OLE object):
// Force the Alarm Control to refresh after a comment is added
// OnCommentAdded(lMsgNr, szComment, szComputer, szUser, lTime)
LPOLEOBJECT pAlarm = (LPOLEOBJECT)GetPropWord(lpszPictureName, "AlarmControl");
if (pAlarm != NULL)
{
DISPID dispid = 0;
OLECHAR* szRefresh = L"Refresh";
if (SUCCEEDED(pAlarm->GetIDsOfNames(IID_NULL, &szRefresh, 1, LOCALE_USER_DEFAULT, &dispid)))
{
DISPPARAMS dp = { NULL, NULL, 0, 0 };
pAlarm->Invoke(dispid, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD,
&dp, NULL, NULL, NULL);
}
pAlarm->Release();
}
Refresh dispatch ID varies between WinCC versions. The reliable approach is to call the Alarm Control's automation method Refresh by name. Refer to the WinCC V7.5 / TIA Portal V17 Automation Reference for the current dispatch IDs of the Alarm Control methods.Workaround 4 — VBA Macro (WinCC V7)
On WinCC V7, attach a VBA macro to the Alarm Control's OnCommentAdded event. The macro runs in the WinCC Graphics Designer runtime and has access to the full alarm automation model.
Private Sub AlarmControl1_OnCommentAdded(ByVal lMsgNr As Long, _
ByVal szComment As String, _
ByVal szComputer As String, _
ByVal szUser As String)
' Force a refresh of the long-term archive list
Dim oAlarm As Object
Set oAlarm = HMIRuntime.Screens("Main").ScreenItems("AlarmControl1")
oAlarm.Refresh
End Sub
VBA is the preferred scripting path for WinCC V7 because it does not require rebuilding the C-Script runtime. For TIA Portal WinCC Professional, VBScript inside the screen is the equivalent.
Workaround 5 — Custom Comment Column Driven by a Tag
If the user text block is the only place the operator sees the comment, and the manual list toggle is unacceptable, route the comment through an internal text tag. This bypasses the comment buffer entirely.
- Create three internal text tags in the HMI tag table:
Comment_Buffer(length 255),Comment_Computer(length 32),Comment_User(length 32). - Open the comment dialog from a custom screen button. On OK, a VBScript handler writes the three values to the tags and calls
ScreenItems("AlarmControl1").Refresh. - Configure the Alarm Control user text block to use the three tags as the source (multiplexed selection or user text block with a tag-based selection expression).
This is a heavier change and is only justified when the operator workflow absolutely requires a single-click comment write with no list toggle.
Configuration Reference
| Configuration Step | WinCC V7 (WinCC Explorer) | TIA Portal WinCC Professional |
|---|---|---|
| Open the Alarm Control properties | Right-click the Alarm Control in the Graphics Designer → Properties | Select the AlarmControl in the screen → Properties pane |
| Add a user text block | Message blocks → User text → Add block | Columns → User-defined column → Add |
| Select Comment field | Selection: Comment
|
Selection: Comment
|
| Select Computer field | Selection: Computer
|
Selection: Computer
|
| Select User (Author) field | Selection: User
|
Selection: User
|
| Open comment dialog (runtime) | Alarm Control toolbar → Comment | AlarmControl → OperatorInputMessageComment |
| Wire OnCommentAdded | Right-click Alarm Control → Events → OnCommentAdded → select C function or VBA macro | AlarmControl → Events → OnCommentAdded → select VBScript |
Troubleshooting Matrix
| Symptom | Likely Cause | Verification | Fix |
|---|---|---|---|
| Comment cell empty after list toggle | Alarm Control buffer stale | SQL: SELECT Comment,Computer,User FROM <archive> WHERE MsgNr=...
|
Workaround 3 (scripted Refresh) |
| Comment cell empty before any list toggle | Comment dialog returned Cancel or operator lacks comment permission | Operator's user has "Operator input → Comment message" right | Check user authorization |
| Comment never written to archive | Archive trigger not fired; message still in short-term buffer | WinCC Archive Viewer: message not present | Adjust archive trigger to fire on acknowledgement or on event |
| Comment shown but row count doubled | Script calls Reload instead of Refresh
|
Alarm Control event log shows Reload | Use Refresh
|
| Script runs but Alarm Control does not update | Script refreshes the screen instead of the Alarm Control OLE object | Step through the script and inspect oCtrl
|
Refresh the Alarm Control OLE object, not the screen |
| Comment shown only on the engineering station | Client-server mismatch: client cache not refreshed, server has new value | Check WinCC client diagnostic buffer | Force a manual reload on the client, or apply the script on the client picture |
| Comment dialog greyed out for acknowledged message | Operator authorization for "Comment acknowledged message" missing | User administration | Grant the right under User administration → Authorizations |
Verification
- Switch the Alarm Control to the Long-term archive list and select an acknowledged message that is already in the long-term archive.
- Open the comment dialog and enter a known string, e.g.
VERIFY-COMMENT-001, and press OK. - Apply the chosen workaround (list toggle, scripted refresh, or VBA macro).
- Confirm
VERIFY-COMMENT-001appears in the Comment column without having to close the screen and reopen it. - Verify the value is in the archive by running
SELECT Comment, Computer, User FROM <archive_name> WHERE MsgNr = <number>in SQL Server Management Studio (or the equivalent in the WinCC Archive Viewer). The value must be present before the workaround — this confirms the issue is a display bug, not a write failure. - Repeat the test for the Computer and User columns.
- If the project is a WinCC client-server, repeat the test on both the server picture and the client picture.
Common Pitfalls
-
"My script doesn't refresh anything." The script must call
Refreshon the Alarm Control OLE object (ScreenItems("AlarmControl1")), not on the screen. A screen-level refresh does not invalidate the Alarm Control buffer. -
"The comment appears, but the row is duplicated." The script is calling
Reloadinstead ofRefresh.Reloadre-fetches the entire archive, which can re-emit rows. UseRefreshfor in-place updates; useReloadonly when the archive structure has changed (added / removed columns, switched backend). - "The script fires when the operator presses Cancel." The script is bound to the wrong event. OnCommentDialogClosed fires on every close, including Cancel. OnCommentAdded fires only after OK with a non-empty comment.
- "The user text block is grey." The message has not yet been moved to the long-term archive. Wait until the configured archive trigger (time-based or event-based) has fired before adding the comment, or change the trigger to fire immediately on acknowledgement.
- "The script works on the engineering station but not on the runtime server." The script is bound to a development copy of the picture. Re-compile the picture on the server or re-deploy the project. Confirm the script is present in the runtime picture by opening the picture in the Graphics Designer on the server and re-compiling.
-
"After the workaround, the row jumps position." The list is sorted. Adding a comment does not change the sort key, but a full
Reloadmay. Switch toRefresh.
Performance Note
Calling Refresh on a large long-term archive (tens of thousands of rows) is a heavy operation. In WinCC Professional it issues a fresh SELECT against the configured archive backend. If the long-term archive is bound to SQL Server, verify the index on (MsgNr, TimeCome) exists and is used. If the archive is file-based, the refresh re-reads the segment files from disk. For very large archives, prefer a filter on the Alarm Control (time range, status, area) rather than a full refresh, and add the filter to the script as a property change before calling Refresh.
Edge Cases
- Multi-language operator stations — The Comment field is stored in the database exactly as typed by the operator; the column width must be wide enough for the longest expected comment in the project's working language.
- Redundant WinCC server pair — The comment is replicated to the standby server by the standard archive replication. The Alarm Control buffer is per-station, so the refresh must be applied on the station the operator is using.
- WinCC Audit — If WinCC Audit is enabled, the comment is recorded in the audit trail regardless of the display behavior. The audit row is the source of truth when a dispute arises about whether the operator actually added a comment.
- Comment on an unacknowledged message — Some operator workflows add a comment before acknowledging. The comment is written immediately, but the user text block in the long-term archive list will not show it until the message is archived and the Alarm Control reloads the list.
Related Siemens Documentation
- Siemens Industry Online Support — WinCC Alarm Control Help (search: "WinCC Alarm Control user text block"): support.industry.siemens.com
- SIMATIC HMI product page: simatic-hmi
- TIA Portal Help — Working with the Alarm Control: TIA Portal V17 documentation
FAQ
Why does the new comment not appear in the user text block until I change the message list?
The WinCC Alarm Control caches the visible row set in an in-memory buffer. Adding a comment writes to the archive but does not invalidate the buffer. A list change forces the control to re-read the rows, and the comment is then displayed. This is documented behavior in the WinCC Alarm Control Help.
Is the comment lost when the user text block appears empty?
No. The comment, computer name, and author are written to the archive row when the operator confirms the comment dialog. An empty user text block cell indicates a display buffer issue only. Verify the comment exists by running a SQL query against the archive database or by opening the WinCC Archive Viewer.
Which WinCC versions are affected by the user text block display behavior?
The behavior is confirmed on SIMATIC WinCC V7.3, V7.4, and V7.5, and on TIA Portal WinCC Professional V15 through V17. It applies to single-user, client-server, and redundant projects. Comfort panels do not have a long-term archive list, so the symptom is limited to PC-based runtimes.
Can a script force the Alarm Control to refresh after a comment is added?
Yes. In TIA Portal WinCC Professional, use VBScript on the OnCommentAdded event of the Alarm Control and call ScreenItems("AlarmControl1").Refresh. In WinCC V7, use a VBA macro on the same event. The refresh re-reads the current list and the comment is displayed immediately.
Is there a way to avoid the manual list toggle entirely?
Yes. Add a transparent button on the screen that briefly activates the Message list (index 0) and then reactivates the Long-term archive list (index 2). For a cleaner solution, attach a VBScript or VBA handler to the OnCommentAdded event that calls Refresh on the Alarm Control OLE object — the operator sees the comment without any list change.