Configuring Event-Driven Alarm Popups in Siemens PCS7 WinCC

David Krause16 min read
HMI / SCADASiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Configuring Event-Driven Alarm Popups in Siemens PCS7 WinCC

Process plants running Siemens PCS 7 with WinCC Explorer often require alarm notifications that override the operator's current view, cover 30-40% of the screen, remain draggable, and dismiss themselves only when the underlying process condition is cleared (with hysteresis). The native Alarm Control does not natively satisfy these ergonomic and visibility requirements because it docks to a fixed bar and does not float as a movable overlay. The most maintainable solution is a single, full-screen background work area containing one or more Picture Windows whose visibility is driven by H and HH alarm bits per analog channel. This article documents the architecture, the configuration steps for PCS 7 V8.2 through V9.1, the hysteresis handling on the automation side, and the verification procedure for multi-OS deployments.

Engineering note: Avoid implementing alarm popups with the Windows MessageBox API through VBS or C scripts in WinCC. MessageBox calls block the WinCC runtime thread, can preempt operator acknowledgment, and interfere with the WinCC Alarm Logging redundancy behavior. Use the picture-window method described here instead.

1. Problem Definition and Design Constraints

The reference installation has six analog measurements (for example, vessel pressures, bearing temperatures, or flow rates), each with two limit-class alarms:

  • H (High) - first-tier warning
  • HH (High-High) - second-tier critical alarm

This yields 12 distinct alarm conditions that must each be represented by a unique popup. The design constraints are:

  1. The popup must appear on top of the currently active process picture, on every OS in the project.
  2. Coverage should be 30-40% of the visible screen area.
  3. No operator command buttons (acknowledge is handled by the standard WinCC Alarm Control elsewhere).
  4. The popup must be moveable by the operator so the underlying screen stays accessible.
  5. The popup must self-dismiss only when the process value returns below the H/HH threshold, with hysteresis to prevent chattering.
  6. The solution must scale to 400+ process screens without per-screen configuration.

2. Architecture: One Base Picture, One Picture Window

The scalable approach is to create a single WinCC base picture (@AlarmPopup.pdl) that contains one or more Picture Windows. The base picture is configured as the always-on work area, and the picture window embeds the actual alarm display. Because WinCC only renders the base picture underneath the current process picture, the popup will overlay any active screen.

There are two viable patterns:

Pattern A: Single Picture Window with Variable Tag Selection (Recommended)

One picture window embeds a generic alarm popup picture. A WinCC tag drives the PictureName property of the picture window, selecting which of the 12 alarm graphics to display. Visibility is set by the OR of all 12 H/HH alarm bits. This is the lowest-maintenance approach for 6 channels with 2 limits each.

Pattern B: 12 Picture Windows per Base Picture

12 picture windows, one per alarm (AI1_H, AI1_HH, AI2_H, AI2_HH, ... AI6_H, AI6_HH). Each window's visibility is tied to a single tag. Position them in non-overlapping regions of the screen (grid layout). This pattern is preferred when each alarm needs to remain visible simultaneously (e.g., multiple channels in alarm at once).

Criterion Pattern A (1 window, dynamic picture) Pattern B (12 windows, fixed layout)
Concurrent alarms visible Only the most recent (1) Up to 12 simultaneously
Configuration effort Low - one PDL + 12 picture variants Medium - one PDL + 12 windows + 12 pictures
Runtime tag count 1 visibility bit + 1 picture name tag + 12 H/HH bits 12 visibility bits + 12 H/HH bits
Recommended for Single critical alarm focus Multiple concurrent critical alarms (this case)

For the 6-analog scenario, Pattern B is the right choice because the operator may have several AI channels in HH simultaneously, and all of them must be visible at once.

3. Prerequisites

  • PCS 7 V8.2 SP1 or later (V9.0 / V9.1 recommended); verified on V9.0 SP2 with WinCC V7.5 SP1 runtime
  • WinCC Explorer with the OS project open on the engineering station
  • CFC/SFC library access to the CH_AI (or technology-equivalent) channel driver block for the 6 analog signals
  • Configured AS-AS connection (S7 connection) to the OS server
  • Read/write access to the OS server database for the engineer
  • OS client licenses that support the picture window count you will deploy (typical PCS 7 OS client RT licenses include 16 picture windows per screen; verify in your license audit)

4. AS-Side Configuration: Generating the H and HH Bits

Each of the 6 analog inputs uses the standard PCS 7 CH_AI channel block (or CTRL_PID if part of a control loop). The H and HH alarms are evaluated inside the CFC chart and exposed as boolean tags to WinCC.

Step 4.1 - Configure limits on CH_AI

  1. Open the CFC chart that contains the CH_AI block for AI1.
  2. Double-click the block, open the Signals tab, and enter:
    • HH_LIM = 95.0 (High-High limit, engineering units)
    • HH_DLY = 2 s (debounce delay)
    • H_LIM = 88.0
    • H_DLY = 5 s
  3. On the Messages tab, enable the standard messages for the H and HH limits (message class Process control - Error for HH, Process control - Warning for H).

Step 4.2 - Add hysteresis

The built-in CH_AI limit messages do not include a configurable hysteresis value. To prevent alarm chattering around the threshold, insert a small CFC network per alarm output:

     +-------+
MV -->| LIMIT |---Q_HH_raw
     | (HYS)|
     |  2 % |
     +-------+
        |
        v
   +---------+
   | SR flip |---Q_HH_latched
   | (RS FF) |
   +---------+
        |
        ^
        +-- (NOT Q_HH AND MV < HH_LIM - HYS)

Concretely, in a CFC chart add a AND_8 block feeding an OR_8 to combine the threshold and the dropout condition, then drive a SR_FF (set-reset flip-flop) block. The flip-flop Q output is the tag exposed to WinCC as the visibility trigger. Use these parameter values:

Parameter Value (typical) Description
HYSTERESIS_HH 2.0 % of span Dropout margin for HH to clear
HYSTERESIS_H 3.0 % of span Dropout margin for H to clear
DEBOUNCE_HH 2 s (CH_AI.HH_DLY) Onset delay
DEBOUNCE_H 5 s (CH_AI.HDLY) Onset delay

Repeat for all six channels; you will have 12 latch tags named, for example:

  • AI1_H_alarm, AI1_HH_alarm
  • AI2_H_alarm, AI2_HH_alarm
  • ... through ...
  • AI6_H_alarm, AI6_HH_alarm

Compile the S7 program and download to the AS. Verify in CFC test mode that the bits set and reset correctly when the simulated input crosses the limits.

5. OS-Side Configuration: Building the Alarm Popup

Step 5.1 - Create the popup picture for one alarm

  1. In WinCC Explorer, right-click Graphics → New Picture, name it POP_AI1_H.pdl.
  2. Size the picture window to 640 x 480 pixels (about 33% of a 1920 x 1080 OS client monitor).
  3. Add a red background rectangle covering the entire picture.
  4. Add a static text field at the top: CRITICAL ALARM - HIGH HIGH with white text, bold, 18 pt.
  5. Add an I/O field showing the live process value of AI1 (connect to the AI1.PV tag).
  6. Add a second I/O field showing the HH limit (AI1.HH_LIM).
  7. Add a third I/O field showing the alarm timestamp. Use a dynamic dialog or a C script bound to the alarm's TimeCome attribute (see Section 7).

Save and close. Repeat 11 more times, customizing the text and tag bindings for each alarm. Use distinctive colors per severity:

Severity Background color (RGB) Flashing Audible signal
H (Warning) 255, 200, 0 (amber) Yes, 1 Hz Single beep
HH (Critical) 255, 0, 0 (red) Yes, 2 Hz Repeating horn

Step 5.2 - Create the base picture that hosts the picture windows

  1. Create a new picture named @AlarmBase.pdl.
  2. Set its Window Properties → Window Size to Full Screen.
  3. Set Window Properties → Layer to a high value, e.g. Layer 0 (this is the base layer for the always-on work area; see Section 8 for layer detail).
  4. From the Standard palette, drag the Picture Window object 12 times onto the base picture.
  5. Configure each picture window:
    • Picture Name property: hardcode the corresponding POP_AIx_H.pdl or POP_AIx_HH.pdl.
    • Position: arrange in a 4 x 3 grid covering the upper half of the screen, with 10-pixel padding.
    • Size: 480 x 270 each (fits a 4-column x 3-row grid inside 1920 x 1080 with margins).
    • Display → Moveable: Yes. This enables the operator to drag any popup to a different location.
    • Display → Closable: No. The popup must never be closed by the operator.
    • Display → Border: Yes, 2 px, color matches severity.

Step 5.3 - Bind visibility to the latch tags

Select the first picture window (the one for POP_AI1_H). In the properties pane, find Display → Visible. Click the small lightning-bolt icon to create a dynamic dialog or a tag connection:

Direct tag connection:
  Property:  Display → Visible (BOOL)
  Tag:       AI1_H_alarm
  Inversion: No

Repeat for the other 11 picture windows. After this step, the popup becomes visible the moment the AS sets the corresponding latch tag, and disappears the moment the hysteresis-based reset clears it.

Step 5.4 - Make the base picture the always-on work area

  1. In WinCC Explorer, open the OS project editor (right-click OS project → Properties).
  2. On the User Interface tab, set Start Picture to @AlarmBase.pdl.
  3. On the same tab, disable the Change Picture on... behaviors that would tear down the base picture.
  4. To allow the base picture to remain visible even when a process picture is open, set the process picture's Window Properties → Independent Window to Yes, and set its Layer to 1 (one above the base picture's layer 0).

This creates the z-order: process pictures on layer 1, popup picture windows on layers inherited from the base picture (layer 0, but picture windows are always rendered above their parent base picture in WinCC), giving the popups the correct overlay behavior.

Z-Order Stack (bottom to top) Layer 0 - @AlarmBase.pdl (12 Picture Windows inside) Layer 1 - Process Picture (active area) Picture Window render - AIx_H / AIx_HH popups (visible only when tag = 1) Layer 31 - WinCC system dialogs (login, language switch)

6. Optional: Moveable but not Closeable

WinCC's picture window object exposes a Moveable boolean property. When set to Yes, the operator can click the title bar of the picture window and drag it anywhere within the parent base picture. Combined with Closable = No, the popup cannot be dismissed by the user - it can only be moved.

Tip: In PCS 7 V8.2 and earlier, the Closable property is part of the picture window configuration dialog rather than the runtime property sheet. If the option is not visible in the editor, open the picture window configuration via the right-click context menu and select Properties → Operator Control → Display.

7. Capturing the Alarm Timestamp

To display the time the alarm became active (so the operator can see how long the condition has been present), use a C script in the popup picture that subscribes to the alarm's TimeCome attribute:

// C script on the popup picture - event "Open Picture"
#include "apdefap.h"
void OnOpenPicture(char* lpszPictureName, char* lpszObjectName, char* lpszPropertyName)
{
    // Subscribe to the alarm message number, e.g. MSG_AI1_HH
    MSRTCreateMsg( GetTagDWord("MsgNumber_AI1_HH") );
    // Set the static text field "AlarmTime" to current PLC time
    SetTagChar("Popup_AI1_HH_TimeText",
               GetTagChar("SystemTimeString"));
}

Alternatively, use a WinCC Alarm Control inside the popup picture in Display Only mode to show the originating alarm entry with its native timestamp, status, and acknowledgment state. This is the most code-free path and is recommended for V9.0+ projects.

8. Layer and Z-Order Best Practices

WinCC supports 32 layers (0-31). The standard layer assignments in PCS 7 are:

Layer Typical use Notes
0 Base / work area Always rendered, lowest z
1 Process pictures Standard plant screens
2-15 Reserved for process graphics Free for use
16-30 Custom overlays (popup, faceplates) Used here for popups if picture window approach is not used
31 System dialogs Top-most, non-overridable

The picture-window-on-base-picture approach described in this article does not require assigning a custom layer to the popups because picture windows are rendered as children of their parent base picture and always appear above the contents of any process picture opened on top of the base picture. If you prefer to use the Open Picture function for the popups themselves (Pattern A), set the popup's Window Properties → Layer to a value above 15 (e.g., 20) so it floats above all process graphics.

9. Cross-OS Deployment

PCS 7 OS projects are often split into a server (WinCC Server) and multiple clients (WinCC Clients). The configuration in this article is stored in the OS server project; clients receive the picture definitions during package download. To deploy:

  1. In WinCC Explorer on the server, run OS Project Editor → Standby / Client → Server data and confirm the new pictures are exported to the server's package.
  2. On each client, perform a Package Download from the server.
  3. Verify that the @AlarmBase.pdl picture and the 12 POP_AIx_?.pdl files are present in the client's GraCS directory after download.
  4. Restart the WinCC Client Runtime on each station.

The 12 H/HH latch tags are read from the AS by the OS server and mirrored to clients via the standard OS server-to-client mechanism, so no additional configuration is needed at the client level.

10. Verification Procedure

  1. Static verification: Activate the OS project. Force the tag AI1_H_alarm = 1 in the WinCC tag simulation (or set the corresponding bit in the S7 PLCSIM). Confirm that the POP_AI1_H picture window appears in the upper-left of the screen, with the correct amber background.
  2. Moveability test: Click and drag the popup to the lower-right. It must follow the cursor and stay on top of the active process picture.
  3. Concurrent alarm test: Force all 12 latch tags to 1. All 12 popups must render in the configured grid without overlap, and the operator must be able to drag each one independently.
  4. Hysteresis test: With AI1_HH_alarm = 1, drop the simulated PV to HH_LIM - 1 %. The popup must remain visible (within hysteresis). Drop further to HH_LIM - 2.5 %. The popup must auto-dismiss.
  5. Multi-OS test: Force a single alarm and verify that it appears on every OS client connected to the server, with the same content and same timestamp.
  6. Redundancy test: If you have a redundant OS server pair, perform a server failover while an alarm is active. The popup must continue to display on all clients without flicker after the failover completes.

11. Troubleshooting Matrix

Symptom Likely cause Remediation
Popup never appears Tag is not being read by OS server; H/HH bits not compiled into S7 download Check tag connection in WinCC tag management, force the bit in PLCSIM, recompile and re-download the S7 program
Popup appears but does not dismiss Hysteresis logic in CFC is wrong; the SR flip-flop reset condition is not being met Open CFC test mode, monitor the reset input of the SR block, verify the dropout threshold
Popup flashes rapidly on/off Threshold without hysteresis, or hysteresis too small for the process noise Increase the hysteresis value, increase the debounce delay in CH_AI
Popup is hidden behind process picture Process picture opened with a higher layer than the picture window parent Confirm the base picture is on layer 0, process pictures on layer 1, and the base picture remains loaded as the work area
Popup is not moveable Moveable property is not enabled, or the picture window is inside another picture window with a non-moveable parent Set Moveable = Yes on the picture window; verify the parent base picture is not configured with Independent Window = No
Popup does not appear on some OS clients Package download was not performed on those clients, or the picture files are missing from the client's GraCS directory Re-run package download; check the client's GraCS folder for the popup PDL files
Performance is degraded with multiple popups Picture windows are heavy when too many graphics are animated; CPU load on the OS client Reduce the number of dynamic elements in each popup; disable unnecessary animations; consider switching to a single combined popup (Pattern A) if concurrency is rare
Popup timestamp is wrong OS server and AS clocks are not synchronized; C script reads local time instead of PLC time Enable time synchronization between AS and OS (NTP or S7 time); bind timestamp tag to a PLC-derived time string

12. Field-Proven Caveats

  • When you have 6 channels with H and HH, consider pre-allocating a 4 x 3 grid even if you only need 2 x 2 today. Operators will request more alarms over the life of the plant, and re-laying out the grid during a live alarm is disruptive.
  • The base picture should never contain any process controls. If the operator attempts to click through a popup to a control, the click is intercepted by the picture window. Keep all control graphics on the process pictures opened above the base picture.
  • Avoid using SetPictureName in a global C script that swaps popup pictures on every alarm. The swap can introduce a one-frame black flash on the OS client. Either use Pattern B (12 static windows) or pre-render all 12 pictures and toggle only visibility.
  • WinCC picture windows consume one of the 16 runtime licenses per client session for picture window technology. An OS client with multiple monitors can be configured with multiple independent base pictures, but each base picture counts against the license pool.
  • If you migrate the project to PCS 7 V9.1 or later, the picture window Closable property is preserved, but new Always On Top and Transparency properties become available. The transparency property is useful for non-critical H alarms that should not fully occlude the process picture.

13. Performance and Sizing Reference

For a 1920 x 1080 OS client monitor running PCS 7 V9.0 SP2 on a typical industrial PC (Intel Core i5-10500T, 16 GB RAM, Windows 10 IoT LTSC 2019), the following are observed loadings:

Configuration CPU at idle CPU with 12 popups active RAM delta per popup
Pattern B (12 picture windows, simple I/O fields) 8-12 % 14-18 % ~3 MB
Pattern B with alarm control inside each popup 10-15 % 25-35 % ~12 MB
Pattern A with dynamic picture swap 8-12 % 10-14 % ~3 MB

These values are representative; verify in your specific installation with the WinCC Performance Monitor and the OS server's Performance → Process Monitoring diagnostics.

How do I make a PCS 7 alarm popup that stays on top of every process picture?

Create a base picture (@AlarmBase.pdl) set as the OS Start Picture, then place the alarm popup as a Picture Window on that base picture. Open the process pictures on a higher layer (e.g., layer 1) and leave the base picture on layer 0. The picture window renders above the parent base picture, so it always overlays the active process picture.

How do I prevent a WinCC picture window popup from being closed by the operator?

Set the picture window's Closable property to No. The popup will still be Moveable if the Moveable property is Yes, but the close (X) button is removed. This is the standard approach for safety-critical alarm notifications that must not be dismissed manually.

What hysteresis value should I use to prevent HH alarm chattering in PCS 7?

Use 2-3 % of the measurement span for the dropout, combined with the CH_AI block's HH_DLY onset delay of 2-5 seconds. For temperature loops with slow dynamics, 1 % is usually sufficient. For fast pressure or flow signals, increase to 3-5 % and a 3-second onset delay.

Can I use one picture window to display multiple alarms in PCS 7 WinCC?

Yes, use Pattern A: one picture window with a dynamic PictureName property bound to a WinCC string tag, and the visibility bound to the OR of all H/HH bits. This shows only the most recent alarm but uses fewer runtime resources. For 6 channels with 2 limits each and possible concurrent alarms, Pattern B (12 picture windows) is recommended instead.

How do I bind a picture window's visibility to an alarm bit in WinCC?

Select the picture window, open the properties pane, click the lightning-bolt icon on the Display → Visible property, and create a direct tag connection to the boolean tag (e.g., AI1_HH_alarm). When the tag transitions to 1, the picture window renders; when it returns to 0, the window hides. Combine this with hysteresis on the AS side to prevent flicker.

Back to blog