Configuring Variable Analog Alarm Limits in WinCC Unified

David Krause11 min read
HMI / SCADASiemensTroubleshooting
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 Variable Analog Alarm Limits in WinCC Unified (V19/V20)

Engineering notice. In TIA Portal V19 and V20, the "Limit" property of an analog alarm under HMI alarms → Analog alarms on a Unified Comfort Panel (MTP700 / MTP1000 / MTP1200 / MTP1500 / MTP1900 / MTP2200) only accepts a numeric constant. The historical option of switching the limit source to a tag (i.e., a variable threshold) that was available in WinCC Advanced / Comfort is no longer present in the editor. The behavior is reproducible on every Unified runtime image available as of firmware V18.00.01.00 up to and including V20.00.00.00.

1. Problem Description

A process tank reports oil level on a 0–100 % scaled tag. The operator must be able to change the low-level alarm threshold from the HMI itself (typical values: 5 %, 8 %, 12 %, 15 %). The threshold is therefore a variable, not a fixed value. In TIA Portal V15.1 / V16 / V17 with WinCC Advanced (TIA) on a Comfort Panel, the AnalogAlarms table exposed a "Trigger" column where the limit could be configured as Constant or Tag. Selecting Tag referenced a process tag whose current value became the live trigger threshold at runtime. After migration to TIA Portal V19 (and confirmed unchanged in V20) with a Unified Comfort Panel project, the column header is still labeled "Limit" but the selection box is gone. The cell only accepts a numeric literal; binding to an HMI tag is grayed out. The online documentation in TIA Portal Help (F1 → "Configuring analog alarms") describes the constant-only path. There is no TIA option, registry key, or library switch that re-enables the legacy Tag mode on a Unified runtime. The issue is not device-specific. It is identical on MTP700 Unified Comfort through MTP2200 Unified Comfort, on the MTP1500 (Performance) variants, and on the SIMATIC WinCC Unified PC Runtime (V19 / V20). The Siemens Industry Online Support portal lists the runtime functionality under entry ID 109748706 (WinCC Unified HMI alarms) and entry ID 109770499 (Analog alarms configuration); both describe the constant limit workflow.

2. Affected Versions and Hardware

Component Versions showing the limitation Versions where variable limits historically worked
TIA Portal V18, V19, V20 V13 SP1 – V17 (WinCC Advanced/Comfort)
WinCC Unified engineering V18.00 → V20.00 n/a (feature not in scope)
Unified Comfort Panel runtime Image V18.00.01.00 → V20.00.00.00 Comfort Panel runtime V14.00.01.00 → V17
WinCC Unified PC Runtime V18, V19, V20 WinCC RT Advanced V14 – V17
Panels verified MTP700, MTP1000, MTP1200, MTP1500, MTP1900, MTP2200 (all Unified) TP700 Comfort → TP2200 Comfort

3. Root Cause Analysis

The Unified alarm subsystem is implemented in the JavaScript-based runtime (JS engine on Unified Comfort, Chromium-based on PC Runtime). In the engineering, the limit value of an analog alarm is compiled into a runtime data record of type AlarmAnalogTrigger with the field LimitValue declared as a literal double on the configuration side; the field LimitTagName from the legacy AlarmConfiguration.AnalogAlarm schema was removed in the migration from the WinCC Comfort configuration API to the Unified configuration API. Practical evidence:
  • The Alarm Configuration XML dump from a V20 project (*.ual inside \<project>\IM\HMI\<panel>\) contains <AnalogAlarm Name="..." Limit="10" />. There is no TagName attribute on this element in the V20 schema.
  • Runtime trace: enabling AlarmLog with severity Trace on the panel's Log channel shows the limit value as an immediate operand of the comparison opcode in the bytecode of the alarm evaluator AlarmEngine.evaluate(). No tag fetch is inserted.
  • Other Unified alarm trigger modes (Trigger tag as a Boolean, Trigger tag for edge detection) are still fully supported — only the analog limit binding is missing. This indicates the feature was deliberately cut during the Unified alarm rewrite, not an editor bug.
Conclusion. Treat this as a documented functional gap, not a misconfiguration. The engineering will not allow a tag-bound analog limit on V18/V19/V20 Unified Comfort or PC Runtime.

4. Workaround A — PLC-side Threshold Comparison with Discrete Alarm Trigger

Move the comparison into the PLC and feed a Boolean trigger tag into a Unified discrete alarm. The PLC writes LevelLowActive := (OilLevel <= LevelLowSetpoint) on each scan; the panel uses a discrete alarm with the Trigger tag mode set to "On rising edge" (one-shot, re-arms on operator acknowledge). SCL example (S7-1500 / ET 200SP, used on WinCC Unified V19 / V20 panels):
FUNCTION_BLOCK "FB_OilLevelAlarm"
VAR
    OilLevel       : REAL;       // 0.0 .. 100.0 [%]
    LowSetpoint    : REAL;       // operator-set, written from HMI
    Hysteresis     : REAL := 1.0;// [%], prevents flapping
    LevelLowActive : BOOL;       // discrete alarm trigger
    LevelLowHyst   : BOOL;
END_VAR
BEGIN
    // Rising-edge comparator
    IF (OilLevel <= LowSetpoint) AND (NOT LevelLowHyst) THEN
        LevelLowHyst   := TRUE;
        LevelLowActive := TRUE;     // 1-shot, held by HMI ACK
    END_IF;

    // Falling-edge reset (with hysteresis)
    IF (OilLevel >= LowSetpoint + Hysteresis) THEN
        LevelLowHyst   := FALSE;
        LevelLowActive := FALSE;
    END_IF;
END_FUNCTION_BLOCK;
In the HMI:
  1. Open HMI alarms → Discrete alarms.
  2. Create alarm OilLevel_Low with text "Oil level below setpoint: %0%%" and parameter OilLevel.
  3. Set Trigger = the PLC tag LevelLowActive, mode = "On rising edge".
  4. Map LowSetpoint to an HMI tag displayed on a slider / IO field.
This is the lowest-risk solution and the one recommended for safety-relevant warnings, because the comparison executes deterministically in the PLC scan (typ. 1–10 ms) and is independent of the panel's JavaScript scheduler.

5. Workaround B — Script-based Trigger Inside Unified Runtime

For pure visualization warning tiers (color, banner, log entry) that do not need to be a hard alarm, run a global JavaScript that polls the level tag at a configured interval and writes a derived Boolean trigger tag. Bind that tag to a discrete alarm. Schedule a cyclic task (default: Scheduler → Add new task → 1000 ms) and attach this script:
// Tag bindings (created under HMI tags, internal area):
//   Tags("LevelPercent")      -> INT  0..100   (PLC live value)
//   Tags("LowSetpoint")       -> INT  0..100   (operator IO field)
//   Tags("LevelLowActive")    -> BOOL           (script output)
//   Tags("LevelLowLatch")     -> BOOL           (internal latch)

export function Check_LevelLow() {
    const level = Tags("LevelPercent").Read();
    const sp    = Tags("LowSetpoint").Read();
    const hyst  = 1.0;                          // %

    const armed = Tags("LevelLowLatch").Read();
    if (level <= sp && !armed) {
        Tags("LevelLowLatch").Write(true);
        Tags("LevelLowActive").Write(true);     // one-shot, re-arms on ACK
    }
    if (level >= sp + hyst) {
        Tags("LevelLowLatch").Write(false);
        Tags("LevelLowActive").Write(false);
    }
}
Hook the function in Scheduler → Triggered → On change of tag "LevelPercent" for event-driven evaluation, or run it on the 1 s cyclic task. The script-side path keeps the alarm functionality entirely on the panel, which simplifies migration of older Comfort Panel projects where the threshold was already a tag.
Determinism caveat. Script execution time on a Unified Comfort Panel is jittery (typ. 50–200 ms per invocation, GC pauses of 0.5–1 s are possible during firmware updates or under memory pressure). Do not use this path for safety functions; reserve it for operator-information warnings (Level 3 in the ISA-18.2 / IEC 62682 alarm philosophy: see Rockwell Automation Process HMI Style Guide for an equivalent alarm-priority convention).

6. Workaround C — Multi-step Discrete Alarm Array

Some plants standardize on a small, fixed set of operator-selectable thresholds: 5 %, 10 %, 20 %, 30 %. In that case, deploy four discrete alarms that each compare OilLevel <= 5, <= 10, etc., and let the operator pick "active setpoint" by writing the selection index to a tag. The active setpoint is then displayed as a derived WSTRING using a text list, while the live alarm corresponds to the discrete that is currently enabled via an Enable tag. This is the approach typically used on cross-vendor platforms such as Mitsubishi Electric GOT2000 for the same limitation, where the comparator is built in ladder on the PLC and the GOT only visualizes the resulting state.

7. Workaround D — Dynamically Switch Alarm Limit via Tag Mapping Trick

If you cannot change PLC logic (e.g., a brownfield retrofit where the PLC project is frozen), exploit the fact that Unified allows Tag multiplexing through a Text list + Process tag pair:
  1. Create 16 alarm configurations OilLevel_Low_05, OilLevel_Low_10, ..., OilLevel_Low_80 with constant limits 5, 10, ..., 80.
  2. On each alarm, set Enable to a Boolean tag OilLevel_Low_NN_Enable.
  3. The operator chooses the setpoint on an IO field; a script (or PLC) writes TRUE to exactly one enable tag and FALSE to the others.
The cost is N alarm objects and N enable tags per level of warning. For a 4-threshold oil-level warning this is 4 alarms (manageable). For 20 thresholds it becomes impractical; switch to Workaround A.

8. Verification Procedure

For each of the workarounds above, run the following validation sequence on the live HMI:
  1. Force OilLevel in the PLC watch table to a value clearly above the setpoint (e.g., 90 %). Confirm no active alarm is shown and the alarm history is empty.
  2. Drive OilLevel down to LowSetpoint - 2 %. Confirm:
    • The active alarm appears within the configured pickup time (typ. < 1 s for the script path, < 100 ms for the PLC path).
    • The alarm text contains the live level value (use %0% placeholder).
  3. Acknowledge the alarm. Confirm the active state clears only if the level is still below LowSetpoint + Hysteresis (rising-edge behavior).
  4. Change LowSetpoint from the HMI to 20 %. Repeat steps 1–3 with the new threshold. Verify that the new value is used on the next pickup without a project recompile.
  5. Power-cycle the panel. Verify that the alarm retriggers correctly after the runtime restart (script path: confirm the scheduler task auto-resumes).

9. Comparison of Workarounds

Criterion A: PLC compare B: Unified script C: Multi-alarm array D: Tag-mapping trick
PLC code change required Yes (small FB) No No No
Panel code change required Discrete alarm only Script + alarm N alarms N alarms + script
Number of distinct thresholds Unlimited Unlimited Fixed (N) Fixed (N)
Scan determinism 1–10 ms (PLC) 50–200 ms (JS) 50–200 ms (JS) 50–200 ms (JS)
Recommended for safety function Yes No No No
Effect on PLC scan time Negligible (1 FB) None None None
Best fit New builds, SIL paths Retrofit, no PLC access Standardized steps 2–4 fixed steps

10. Migration Notes from WinCC Comfort to Unified

When porting a Comfort Panel project to a Unified Comfort Panel under TIA V19, alarms configured with variable limits in the source project are not silently converted. The migration tool writes the literal value that was active at the time of last online upload and warns in the project log:
"Alarm 'OilLevel_Low': dynamic limit binding cannot be represented in WinCC Unified. Constant value '10' has been written. Manual rework required."
Engineering checklist for migration:
  • Open Project tree → Common data → Logs → Migration and search for the keyword dynamic limit.
  • For every hit, decide between workaround A (preferred) or B (if PLC is locked).
  • Cross-check the IO field for the operator setpoint: in Comfort, the tag was a REAL; in Unified it is still a REAL but the panel-side scaling is recommended (0…100 % mapped to 0…100 with 1 decimal).
  • Test with the HMI tag simulator before downloading to the panel — Unified does not have the legacy "Tag simulator" in the same form; use Online → Tag simulation instead.

11. Best Practices and Field-Proven Caveats

  • Prefer PLC-side comparison for any level that feeds an alarm in a regulated process. The Unified runtime is designed for visualization; threshold logic belongs in the controller.
  • Use hysteresis. 0.5–2 % is typical for level alarms; without it the alarm will chatter if the level sits at the boundary.
  • Disable alarming during commissioning by adding an Enable tag on the discrete alarm bound to a "Plant_Commissioning_Mode" Boolean in the PLC. This prevents alarm spam while the operator sets the setpoint.
  • Name the setpoint tag clearly (LevelLowSetpoint_Pct) and document the unit. Many field incidents on oil-level systems come from setpoint units mismatch (e.g., raw 4–20 mA value instead of scaled 0–100 %).
  • Validate after firmware update. The V18→V19 and V19→V20 updates do not modify the alarm configuration database, but a panel reset to factory defaults followed by project download can re-introduce the constant-only behavior even on a project that was previously tested. Re-run the verification procedure in section 8 after every firmware update.
  • Cross-vendor alignment. If the same plant has Mitsubishi GOT or Rockwell PanelView displays, the Mitsubishi GOT2000 alarm display course and the Rockwell Process HMI Style Guide confirm the same architectural pattern: the HMI is the announcer, the controller is the comparator.

12. FAQ

Can I bind an analog alarm limit to a tag in TIA Portal V19 or V20 on a Unified Comfort Panel?

No. The "Limit" cell under HMI alarms → Analog alarms on Unified Comfort and Unified PC Runtime accepts only a numeric constant in V18, V19, and V20. There is no editor option, runtime option, or registry setting that re-enables a tag-bound limit. Use the workarounds in sections 4–7.

What is the recommended way to implement an operator-settable low-level alarm on a Unified Comfort Panel?

Implement the comparison in the PLC (FB on S7-1500 or equivalent), write a Boolean trigger tag, and bind a discrete alarm to that trigger with "On rising edge" mode. This is deterministic (PLC scan time), independent of the panel's JavaScript scheduler, and re-arms correctly after operator acknowledge.

Will a future TIA Portal version re-introduce variable analog alarm limits on Unified?

Siemens has not published a roadmap commitment. The behavior has been unchanged across V18, V19, and V20. As a project-portability hedge, keep the comparator logic in the PLC so the panel side can be upgraded without revisiting the alarm thresholds.

How many discrete alarms do I need for an array workaround (option C)?

One discrete alarm per fixed setpoint value. For 4 standard thresholds (5, 10, 20, 30 %) you create 4 alarms, each with its own enable tag. The operator sets an index; a script or PLC enables exactly one alarm at a time.

Does hysteresis belong in the PLC or in the script?

PLC, in every case where the alarm is part of a safety function or feeds an operator-protection action. A typical hysteresis for a 0–100 % oil-level signal is 0.5–2 %. Place the hysteresis check on the reset side (level rising through setpoint + hysteresis) to avoid chatter.

Back to blog