WinCC Status Tag Bit Mapping in Alarm Class Groups

David Krause14 min read
HMI / SCADASiemensTechnical Reference
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

WinCC Status Tag Bit Mapping in Alarm Class Groups

The status tag of a WinCC Professional (TIA Portal) alarm class group is a packed bitfield, not a numeric counter. The field returns a single UDINT (or DWORD) value where the low half holds the current status of every configured alarm bit and the high half holds the corresponding acknowledgment flag. This reference decodes the bit layout, explains why 65537, 65536, and 1 appear for a single-bit alarm, and documents the configuration rules that prevent collisions when more than one alarm is mapped to the same class group.

1. Overview: What the Status Tag Reports

Each alarm class group in a WinCC Professional HMI screen (e.g. Errors, Warnings, System) owns a user-defined PLC tag — the status tag. Whenever the HMI raises, clears, or acknowledges an alarm belonging to that group, the runtime updates this tag bit-by-bit. The PLC or supervisory script can poll the tag to:

  • Detect that a particular alarm is currently active (pending / incoming).
  • Detect that an alarm is pending and has been acknowledged by the operator.
  • Detect that an alarm has gone out without acknowledgment (chattering / clear).
  • Drive external indicators, e-readers, or aggregated status word protocols.

The tag value is not a counter, not an alarm number, and not a sequence ID. It is a logical OR of the bit states assigned to the configured alarms at the time the runtime last updated the group.

2. Supported Data Types and Their Layout

WinCC Professional V12 and later lets you select the data type of the class-group status tag in the alarm configuration of the HMI device. The four supported types and their bit partitions are:

Tag type Length (bits) Status bits Acknowledgment bits Maximum alarms per group
BOOL (single bit) 1 bit 0 1
WORD 16 bits 0–7 bits 8–15 8
INT / UINT 16 bits 0–7 bits 8–15 8
DWORD / UDINT 32 bits 0–15 bits 16–31 16
Rule of thumb: the high half is always the acknowledgment half and is exactly 16 bit positions above the matching status bit. Bit 0 ↔ bit 16, bit 1 ↔ bit 17, and so on through bit 15 ↔ bit 31.

For installations that need to route more than 16 alarms into a single class group, split the alarms across multiple class groups rather than re-using bits.

3. Bit Layout Reference (UDINT example)

For a UDINT status tag the runtime uses the layout below. Bit indices are zero-based, MSB-first on the wire but numbered LSB-first in the configuration UI.

Bit range Meaning Bit 0 / 16 Bit 1 / 17 Bit 2 / 18 Bit 15 / 31
0 – 15 Status (1 = alarm currently pending) Alarm 0 Alarm 1 Alarm 2 Alarm 15
16 – 31 Acknowledgment (1 = alarm has been ACKed) ACK 0 ACK 1 ACK 2 ACK 15

The decimal value of the tag is computed as:

StatusTag = Σ (StatusBit[i] × 2^i) + Σ (AckBit[i] × 2^(i+16))   for i = 0 … 15

This is a flat logical-OR. The runtime does not guarantee any particular bit ordering beyond the i / i+16 pair convention; the order of bits in the word is the order in which the alarms were assigned to the class group.

4. Decoding the Three Reference Values

The three values that appear in a freshly configured single-alarm group (65537, 65536, 1) are not arbitrary — each one is the exact sum of the bit weights that are set in the current state. Working through them for an alarm mapped to bit 0:

4.1 StatusTag = 65537 (alarm incoming, not yet acknowledged)

65537 = 0x00010001
  bit  0  = 1   → alarm pending
  bit 16  = 1   → not yet acknowledged
  all other bits = 0

This is the canonical "I have a new unacknowledged alarm" state. Most SCADA graphics use this as the trigger for an audible horn, an annunciator lamp, or an SMS escalation.

4.2 StatusTag = 65536 (alarm outgoing, never acknowledged)

65536 = 0x00010000
  bit  0  = 0   → alarm is gone
  bit 16  = 1   → still not acknowledged
  all other bits = 0

This is the "chattering" or "ghost" state. The trigger condition is no longer present, but the operator never pressed the ACK button. In plants that require mandatory acknowledgment, this state is logged and the event is escalated.

4.3 StatusTag = 1 (alarm still active, but acknowledged)

1 = 0x00000001
  bit  0  = 1   → alarm still pending
  bit 16  = 0   → operator pressed ACK
  all other bits = 0

The horn is silenced, the message is removed from the active list, but the alarm text remains visible until the underlying process bit returns to the safe state.

5. Bit-Pair Reference Table for the Lowest 8 Bits

The table below lists every combination of (status, ack) for the first 8 alarm slots of a UDINT tag. It is the same data a WinCC alarm log prints, just in tabular form.

Alarm slot Status bit Ack bit Pending + not ACK Pending + ACK Gone + not ACK Gone + ACK
0 0 16 65537 1 65536 0
1 1 17 131073 2 131072 0
2 2 18 262145 4 262144 0
3 3 19 524289 8 524288 0
4 4 20 1048577 16 1048576 0
5 5 21 2097153 32 2097152 0
6 6 22 4194305 64 4194304 0
7 7 23 8388609 128 8388608 0

For multiple simultaneous alarms, the tag is the bitwise OR of all active rows. For example, alarms 0 and 1 both pending, only alarm 0 acknowledged:

  bit  0 = 1   (alarm 0 pending)
  bit  1 = 1   (alarm 1 pending)
  bit 16 = 0   (alarm 0 acknowledged)
  bit 17 = 1   (alarm 1 not acknowledged)
  → StatusTag = 0b10…10 0000 0000 0000 0011 = 131075

6. Configuring the Status Tag in TIA Portal

6.1 Prerequisites

  • TIA Portal V12 SP1 or later (HMI engineering).
  • WinCC Professional / Comfort runtime license for the HMI device.
  • A PLC tag of type UDINT, DWORD, WORD, or BOOL already declared in the PLC data block or HMI tag table.
  • The HMI device must be configured with at least one alarm class group (default groups: Errors, Warnings, System).

6.2 Step-by-step configuration

  1. In the project tree open HMI TagsDefault tag table and add a new external tag, e.g. HMI_AlarmStatus_Errors, of type UDINT, pointing at the PLC DB word you have reserved.
  2. Open AlarmsClasses. The runtime delivers three predefined classes; double-click the one you want (typically Errors).
  3. In the class properties, set the Status tag property to the tag created in step 1.
  4. For each individual alarm belonging to the class (in Alarms → Discrete Alarms or Analog Alarms), open the alarm properties and select a free bit in the Status bit dropdown (0 … 15 for UDINT). The acknowledgment bit is automatically assigned to bit n+16.
  5. Compile the HMI and download the runtime to the panel or PC.
  6. Trigger the alarm from the PLC and verify the value as shown in Section 4.

6.3 Verification

Use a watch table in STEP 7 / TIA Portal to force the alarm trigger bit high. After the alarm is raised by the runtime, read the HMI tag — it should jump from 0 to 65537 within one polling cycle. Acknowledge the alarm on the runtime and the tag should fall to 1. Clear the trigger bit; if the alarm was not acknowledged, the tag should sit at 65536 until the operator ACKs it.

7. Bit Assignment Rules per Class

Within a single class group, each alarm must use a unique status bit. Re-using a bit inside the same class is the supported pattern — both alarms set the same bit, so the bit goes high when either alarm is pending and falls when both are gone. Re-using a bit across different classes is a different topic and is discussed in Section 8.

Scenario Allowed? Outcome
Same bit, two alarms in the same class Yes Logical OR of the two alarms. Correct behavior, recommended for "either of these trips the horn" use cases.
Different bits, two alarms in the same class Yes Each alarm has its own status + ack pair. Use this when you need per-alarm ACK state.
Same bit, two alarms in different classes Discouraged See Section 8 — the second class will clear the bit while the first is still pending.
Same bit, same alarm appears twice No Configuration error; the HMI compiler warns about duplicate IDs.

8. The "Same Bit in Different Classes" Anti-Pattern

It is technically possible in WinCC to assign the same bit number to alarms belonging to two different class groups, because the two groups own independent tags. The danger is conceptual: a maintenance engineer reading a single class status tag will treat the bit as belonging to that class only, and lose track of the cross-coupled alarm.

A second, more concrete failure mode appears when the same physical bit is used as the trigger in two different alarm groups. Consider:

  • Group A, alarm 0, trigger bit = M0.0 → mapped to status bit 0 of tag A.
  • Group B, alarm 0, trigger bit = M0.0 → mapped to status bit 0 of tag B.

M0.0 going high sets both tags to 65537. When M0.0 falls, both tags fall — but the operator may have intended to acknowledge alarm 0 in group A while the second group still had work to do. The set/reset of the bit works correctly for multiple alarms inside one class, but couples state across different classes when bits are shared. The recommended fix is to give every class its own dedicated bit pool, or, when a single trigger needs to feed two classes, create two separate discrete alarms in the PLC and let each class own a distinct bit.

9. State Machine for One Alarm Slot

The four meaningful states for a single (status, ack) pair can be drawn as the following finite state machine. Transitions are triggered by the alarm source (PLC trigger bit) and by the operator ACK key on the runtime.

S0: 0 — quietStatus=0, Ack=0 S1: 65537Status=1, Ack=0 S2: 1Status=1, Ack=1 S3: 65536Status=0, Ack=0 trigger ACK trigger falls ACK trigger falls (no ACK) trigger falls + ACK

The S3 → S0 transition (dashed) only happens when the trigger is already gone and the operator presses ACK. S2 → S0 only happens when the trigger falls and ACK has already been pressed.

10. Diagnostics and Verification in the Runtime

When the bit mapping appears to be wrong, follow the matrix below to localize the fault before assuming a runtime bug.

Observed value Likely cause Where to look
Tag stays 0 even with the trigger forced Wrong PLC address in the HMI connection; alarm not assigned to the class; alarm class is disabled. Connections in the HMI device; Alarms → Classes; Alarms → Settings.
Tag = 65536 immediately on cold start Persisted ACK state from a previous session; the HMI logs an alarm even though the trigger is 0. Clear the alarm archive; reduce the Save persistent alarm buffer size in the runtime settings.
Tag value mixes bits of unrelated alarms Two alarms assigned the same bit; the second alarm is masking the first. Open Alarms → Discrete Alarms, sort by status bit, look for duplicates.
Bit never clears after ACK ACK button bound to the wrong tag; the alarm is configured "ACK required, doesn't clear automatically". Check the Acknowledgment column in the alarm class; rebind the ACK button to AcknowledgeAlarms system function.
UDINT value > 2^32 in the watch table You have a S7-1500 in optimized block access and the tag is being read as a signed DINT. Switch to UDINT or DWORD. Open the PLC data type, change Data type to DWord / UDInt.

11. Migration Notes: V11 → V12 → V15 → V16 → V17

  • V11 → V12: The class-group status tag was already a bitfield in V11, but the UI for selecting a status bit was reorganized in V12. When migrating, double-check that the bit assigned to each alarm was preserved (TIA Portal sometimes re-numbers the bit list when classes are renamed).
  • V12 → V13/14: No change to the bit layout. The runtime performance of alarm updates was improved, but the wire format is identical.
  • V15+: The Alarm ACK with a single tag feature lets a single tag of type UDINT acknowledge all alarms in a class. This is unrelated to the status tag, but the two tags are often wired to the same DB word in older projects — be careful not to use the same tag for both functions.
  • V16 / V17: The OPC UA Alarms & Conditions (A&C) server exposes the same status bits as event fields. The mapping from WinCC status bit to OPC UA event ConditionId is one-to-one, so the same bit-pair table (Section 5) applies.

12. Practical Coding Patterns

12.1 SCL snippet — "is alarm 0 pending and acknowledged?"

// Inputs:  i_AlarmStatus : UDINT  // status tag of the class group
// Outputs: q_PendingAck  : BOOL   // alarm 0 is pending and ACKed
//          q_Horn        : BOOL   // any pending, not-ACKed alarm in the group

IF (i_AlarmStatus AND 16#00000001) <> 0 AND
   (i_AlarmStatus AND 16#00010000) = 0 THEN
    q_PendingAck := TRUE;   // S2 in the state machine
END_IF;

q_Horn := (i_AlarmStatus AND 16#0000FFFF) <> 0 AND
          (i_AlarmStatus AND 16#FFFF0000) <> 0;
// Horn is on only when at least one status bit AND at least one ACK bit are set,
// i.e. an alarm is pending without acknowledgment.

12.2 VB script — log the bit transitions to a CSV

' Run on the "Alarm Occurred" event of the HMI tag
Dim s : s = ""
Dim i : For i = 0 To 15
    If (SmartTags("HMI_AlarmStatus_Errors") And (2 ^ i)) <> 0 Then _
        s = s & "Alarm" & i & "=pending "
    If (SmartTags("HMI_AlarmStatus_Errors") And (2 ^ (i+16))) <> 0 Then _
        s = s & "Alarm" & i & "=ack "
Next
HMIRuntime.Trace "Alarm update: " & s

13. Related Tags You Will Also Configure

When you set the Status tag of a class, the HMI also lets you assign a number of companion tags. Keep them in a single DB so the PLC logic stays consistent:

Tag Type Purpose
Status tag UDINT/DWORD Bitfield of pending + ACK (this article)
Acknowledgment tag UDINT/DWORD Edge-triggered write from HMI to PLC to clear ACKs centrally
State text tag UINT Index of the current highest-priority alarm text
Trigger tag (per alarm) BOOL The PLC bit that drives the alarm condition

14. Field-Proven Caveats

Tag type mismatch. If the PLC declares a WORD but the HMI expects a DWORD, the runtime reads garbage from the high half. Use the same symbolic type on both sides.
Optimized DB access. On S7-1500/S7-1200, optimized data blocks strip the symbolic offset. Always use the symbolic name ("MyDB".MyStatusWord), not an absolute address, when wiring the HMI tag.
Polling vs. event-driven update. WinCC updates the status tag on every alarm state change, but the PLC only sees the change at the next acquisition cycle. If your HMI acquisition is set to 1 s, expect a 1 s lag on the value in the watch table.
No timestamp inside the tag. The status tag tells you that an alarm is pending and whether it has been ACKed, but not when it happened. Use the alarm log for time-correlated diagnostics.

Why does the status tag show 65537 for a single alarm?

65537 is the bitwise combination of status bit 0 (value 1) and acknowledgment bit 16 (value 65536). It means the alarm is pending (status) and has not been acknowledged by the operator (ack). It is the expected value immediately after an alarm is raised.

What does status tag 65536 mean?

65536 means only the acknowledgment bit (bit 16) is still set while the status bit (bit 0) has cleared. The trigger condition has gone away, but the operator has not yet pressed the ACK button. Treat this as a pending acknowledgment that still requires operator action.

What does status tag 1 mean?

Status tag = 1 means the alarm is still pending (bit 0 = 1) but has been acknowledged (bit 16 = 0). The horn is silenced, the message is acknowledged in the log, and the alarm will clear automatically when the trigger bit falls.

Can I assign the same status bit to two different alarms in the same class?

Yes, and it is the supported pattern. Both alarms will OR into the same bit, so the bit goes high when either alarm is pending and falls only when both have cleared. Use this when several process conditions should drive a single horn or one indicator.

Why is the bit field a UDINT, not a UINT?

A UDINT is 32 bits wide, which the runtime splits into 16 status bits and 16 acknowledgment bits. A 16-bit UINT can carry only 8 alarm slots, which is too restrictive for most production lines. If you must use a UINT, you are limited to 8 alarms per class group.

How do I acknowledge an alarm from the PLC?

You do not write to the status tag. The status tag is a read-only output of the HMI runtime. To acknowledge, call the WinCC system function AcknowledgeAlarms on the runtime, or use the Acknowledgment tag of the class group, which is a separate edge-triggered word.

Why does the status bit clear when an unrelated alarm goes away?

You have assigned the same status bit to alarms in two different class groups, or two alarms inside the same class are sharing the bit and one of them cleared first. Re-assign each alarm in a class to a unique bit, and never share a bit between classes.

Back to blog