Configuring WinCC Alarm Status Tags for Group Alarm Indication

David Krause19 min read
SiemensTutorial / How-toWinCC
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 WinCC Alarm Status Tags for Group-Based Alarm Indication

This reference documents how to map hundreds of discrete WinCC alarms into a small number of status tags so that a single screen object (a button, an area highlight, or a navigation pictogram) can react to "any active alarm" within a functional group, without touching the PLC program. The technique uses the native User-Defined Group mechanism in WinCC Alarm Logging and the Status Tag property that links a group to a 32-bit tag whose individual bits mirror the alarm group's active/acknowledged state.

Audience: HMI/SCADA engineers migrating legacy InTouch, Citect, or iFIX projects into WinCC 7.x or TIA Portal WinCC Professional/Comfort, or any engineer building plant-floor overview screens that must react to alarm presence without per-alarm PLC logic.

1. Problem Definition

Most plant overview screens must indicate whether any alarm is currently active in a subsystem (e.g., "Filter Skid 1", "Reactor Bay", "Boiler Feed", "Conveyor Line A") even when the operator has not opened the alarm page. Typical symptoms of the problem:

  • An InTouch migration leaves a window whose background turns red when any alarm from a list is active.
  • A navigation button on a root picture must change color or show an indicator when its area has an unacknowledged alarm.
  • An area highlight on a plant mimic must glow red/amber/green depending on whether alarms are active, acknowledged, or cleared.
  • The PLC already supplies a discrete bit per alarm; the engineer wants to avoid creating N extra PLC bits or N extra WinCC tags.

A brute-force solution (an IF ladder evaluating 250 Boolean tags per picture) is impractical and creates a maintenance burden because every new alarm requires new logic. WinCC Alarm Logging already knows the active state of every alarm; the goal is to surface a compact group-level view of that state to the picture layer.

2. Architecture: How WinCC Alarm Logging Stores State

WinCC Alarm Logging (component CCAlgLogging.exe) is a circular message archive backed by the Microsoft SQL Server database CC_AlgLog_<ComputerName>_<Date>. It serves two parallel roles:

  1. Display: the AlarmControl and AlarmView OCXs read message rows and render them.
  2. Aggregation: it maintains counters and per-message state vectors (active, acknowledged, cleared, disabled) that drive the runtime API (MSRTGetMsgStatus, AXC_OnMsg...), user-defined groups, and the status tags bound to those groups.

The status tag feature is the part most engineers miss. A status tag is a 32-bit signed or unsigned integer tag (typically declared as DWORD) whose bit pattern is written by Alarm Logging, not by the PLC. Each alarm in the group owns two consecutive bits:

Bit offset Meaning Cleared state Set state
Bit 0 Alarm active state Alarm not active / cleared Alarm currently active
Bit 1 Alarm acknowledged state Alarm acknowledged Alarm not yet acknowledged (unack)
Bit 2 Alarm active state (2nd alarm) Cleared Active
Bit 3 Alarm acknowledged state (2nd alarm) Acknowledged Unacknowledged
... ... ... ...
Bit 30 Alarm active state (16th alarm) Cleared Active
Bit 31 Alarm acknowledged state (16th alarm) Acknowledged Unacknowledged

That is, a single 32-bit tag encodes up to 16 alarms. The lower 16 bits form the "active" mask, and the upper 16 bits form the "not-yet-acknowledged" mask. This dual mask is the basis for the classic WinCC "red blinking for active, amber steady for unacknowledged-but-cleared" HMI convention.

Note on bit ordering: The exact bit-to-alarm mapping is defined when you create the group and select the Status Tag and Status Bit. The first alarm added to the group occupies bit 0 / bit 16, the second occupies bit 1 / bit 17, and so on. Reordering alarms in the group later re-binds the bits, which is a common source of broken screens after a database migration.

3. Prerequisites

  • Software: WinCC 7.4 SP1 or later, or TIA Portal V15.1 or later with WinCC Professional/Comfort/Advanced. Earlier V7.0 / V7.2 versions expose the same properties but with a slightly different Alarm Logging editor path.
  • Licensing: A valid WinCC Alarm Logging runtime license (bundled with the standard RT 2k/4k/8k/64k packages). Status tags do not require an additional option.
  • Authoring rights: Edit access to the WinCC project (or TIA Portal project) and write access to the project's tag database.
  • Project state: Alarms already configured with discrete message classes, message numbers, trigger tags, and user text blocks.
  • Tag database quota: Free internal tags of type DWORD (32-bit). Plan one tag per 16 alarms per group.

3.1 Planning Worksheet

Before opening the editor, prepare a worksheet that documents how many alarms per group you need. With 250 discrete alarms organized into functional areas, a typical breakdown looks like:

Group name Alarm count Tags required Status tag name(s)
Boiler_Feed 18 2 Status_BoilerFeed_1, Status_BoilerFeed_2
Filter_Skid_1 14 1 Status_FilterSkid1_1
Filter_Skid_2 22 2 Status_FilterSkid2_1, Status_FilterSkid2_2
Reactor_Bay 31 2 Status_ReactorBay_1, Status_ReactorBay_2
Conveyor_A 12 1 Status_ConveyorA_1
Conveyor_B 9 1 Status_ConveyorB_1
HVAC 24 2 Status_HVAC_1, Status_HVAC_2
Utility_Water 16 1 Status_UtilityWater_1
Packaging_Line 20 2 Status_Packaging_1, Status_Packaging_2
Common_Alarms 84 6 Status_Common_1 ... Status_Common_6
Total 250 20 —

Note that 20 tags replace what would otherwise be 250 IF conditions, and each tag is read by the picture layer with a single tag access rather than 16.

4. Step-by-Step Configuration in WinCC 7.x Alarm Logging

4.1 Step 1: Create the Internal 32-Bit Status Tag

  1. In WinCC Explorer, right-click Tag Management and select Open.
  2. Select the Internal Tags folder.
  3. Right-click and choose New Tag.
  4. Name the tag following a consistent convention, e.g. Status_BoilerFeed_1.
  5. Set Data Type to Unsigned 32-bit value (DWORD).
  6. Confirm with OK. Repeat for every group chunk (16 alarms per tag).
Tag type: Although Alarm Logging writes the tag as a 32-bit mask, you may declare it as Signed 32-bit value if your C/VBS scripts perform signed arithmetic. The bit layout is identical; only the interpretation of the high bit (bit 31) as "negative" changes when comparing whole-tag values.

4.2 Step 2: Open the Alarm Logging Editor

  1. In WinCC Explorer, expand Alarm Logging.
  2. Right-click Alarm Logging and choose Open (or double-click). The Alarm Logging editor appears.
  3. In the navigation tree on the left, locate the User-Defined Groups node. If the node is hidden, enable it via View → Toolbar or right-click the tree and select Show User-Defined Groups.

4.3 Step 3: Create the User-Defined Group

  1. Right-click User-Defined Groups and choose New Group.
  2. Enter a descriptive name, e.g. BoilerFeed_Group_1. The name appears in AlarmControl filters, so choose a name operators will recognize.
  3. Click OK.

4.4 Step 4: Assign Alarms to the Group

  1. Switch to the Messages view (or All Messages) and select the first 16 discrete alarms that belong to this group (use Ctrl+click / Shift+click for multi-select).
  2. Drag the selection onto the new group node, or right-click and select Add to Group → BoilerFeed_Group_1.
  3. Verify the group now lists those messages under its node. The order in which you add them determines the bit assignment: the first alarm becomes bit 0 / bit 16, the second becomes bit 1 / bit 17, and so on.
  4. If you accidentally add alarms in the wrong order, remove them, then re-add them in the correct sequence. There is no "renumber" command.
Capacity: A user-defined group is limited to 16 messages per status tag. If your group has more than 16 alarms, create BoilerFeed_Group_2 and bind it to Status_BoilerFeed_2, continuing the bit numbering from where Group 1 stopped.

4.3 Step 5: Bind the Status Tag and Status Bit

  1. Right-click the new group and select Properties.
  2. On the Status Tag tab, click the Select button.
  3. Browse the tag database and select the internal DWORD tag created in step 4.1.
  4. In the Status Bit field, enter 0 for the first group (start at bit 0). For a second group covering the next 16 alarms, leave the bit at 0 - each new tag already accounts for 16 alarms via its own bit 0..15 / 16..31 mask.
  5. Click Apply, then OK.

4.6 Step 6: Repeat per Group

For every functional area in the worksheet, repeat Steps 1 through 5. After completion, save the project. The Alarm Logging database will rebuild the group / status binding on the next project activation.

5. Step-by-Step Configuration in TIA Portal (WinCC Professional/Comfort)

The mechanics in TIA Portal differ slightly because the Alarm Logging editor lives inside the HMI device configuration rather than in a standalone Explorer.

  1. Open the TIA Portal project and navigate to the HMI device.
  2. Expand HMI tags and add a new internal tag of data type DWord or Word (a Word gives 8 alarms, a DWord gives 16 alarms per tag).
  3. Open the HMI device's Alarms editor (under Runtime settings → Alarms, or directly via the project tree).
  4. Switch to the Alarm groups tab. Create a new user-defined group.
  5. Drag the discrete alarms into the group as before.
  6. Open the group's properties. On the Status section, assign the internal DWORD tag and the Status Bit offset (typically 0).
  7. Compile and download.
Difference between WinCC 7.x and TIA Portal: TIA Portal sometimes exposes the high/low masks on separate tabs (Status bit for "active" vs Status bit for "unacknowledged") because the property pages were redesigned for the unified data model. The underlying bit semantics are identical.

6. Bit Mapping Reference Table

Use this table when writing C-scripts, VBScripts, or faceplate expressions that interpret a status tag.

Bit Bit 0 of DWORD Bit 16 of DWORD Interpretation
Bit 0 / Bit 16 0 0 Alarm #1 not active
Bit 0 / Bit 16 1 0 Alarm #1 active and acknowledged
Bit 0 / Bit 16 1 1 Alarm #1 active and unacknowledged
Bit 0 / Bit 16 0 1 Alarm #1 cleared but unacknowledged (rare, occurs during acknowledge flow)

For multiple alarms in the same tag, the same logic applies per bit. To test "is any alarm in the group unacknowledged?" in C:

// WinCC C-script example
DWORD dwMask = GetTagDWord("Status_BoilerFeed_1");
DWORD dwUnackMask = (dwMask >> 16) & 0xFFFF;   // upper 16 bits = unack flags
DWORD dwActiveMask = dwMask & 0xFFFF;            // lower 16 bits = active flags

if (dwActiveMask != 0)         { SetBackColor(lpszPictureName, "BtnArea", CO_RED); }
else if (dwUnackMask != 0)      { SetBackColor(lpszPictureName, "BtnArea", CO_YELLOW); }
else                           { SetBackColor(lpszPictureName, "BtnArea", CO_GREEN); }

The same logic expressed in VBScript:

' WinCC VBScript example
Dim dwMask, dwActive, dwUnack
dwMask   = HMIRuntime.Tags("Status_BoilerFeed_1").Read
dwActive = dwMask And &HFFFF
dwUnack  = (dwMask \ 65536) And &HFFFF

If dwActive <> 0 Then
    HMIRuntime.Screens("Main").ScreenItems("BtnArea").BackColor = RGB(255,0,0)
ElseIf dwUnack <> 0 Then
    HMIRuntime.Screens("Main").ScreenItems("BtnArea").BackColor = RGB(255,200,0)
Else
    HMIRuntime.Screens("Main").ScreenItems("BtnArea").BackColor = RGB(0,180,0)
End If

7. HMI Integration: Driving Picture Objects

Once the status tags are written by Alarm Logging, the picture layer only needs to read them. There are three common display patterns.

7.1 Direct Property Binding (WinCC 7.x)

  1. Select the picture object (button, rectangle, or status indicator).
  2. Open the object's Properties dialog.
  3. Right-click the Background Color property and choose Dynamic → Tag/Expression.
  4. Use the Formula dialog to evaluate the bit. For example: (Status_BoilerFeed_1 & 0x0000FFFF) != 0 ? CO_RED : CO_DK_GRAY.
  5. WinCC recomputes the expression every time the tag changes; combined with the bitmap-level update interval of Alarm Logging (default 250 ms, configurable in Computer → Properties → Alarm Logging), this gives sub-second reaction.

7.2 Indirect via Global Script Action

For complex animations, a scheduled C-action with a 1-second cycle is preferred over per-property dynamics because it scales better when many picture objects depend on the same mask.

// Global C-action - scheduled every 1 s
void OnTime(void)
{
    DWORD dwMask;
    dwMask = GetTagDWord("Status_AllAreas");
    SetTagBit("Alarm_AnyActive",   (dwMask & 0x0000FFFF) != 0);
    SetTagBit("Alarm_AnyUnack",    (dwMask & 0xFFFF0000) != 0);
    SetTagBit("Alarm_RedFlash",    (dwMask & 0x0000FFFF) != 0);
    SetTagBit("Alarm_YellowSteady",((dwMask & 0xFFFF0000) != 0) && ((dwMask & 0x0000FFFF) == 0));
}

7.3 Faceplate / Library Object

In TIA Portal, build a reusable AlarmAreaIndicator faceplate that takes a status tag as an interface tag. Drop one faceplate instance per functional area. The faceplate internally masks bits and exposes a Bool property like IsActive, IsUnacknowledged, and a color enum. This pattern avoids property scripts in every picture and centralizes the bit logic for easier maintenance.

8. Alternative Implementation: Per-Alarm Tag Aggregation via C-Script

If your project pre-dates the user-defined group feature (rare; the feature has existed since WinCC 6.0) or if the Alarm Logging editor is read-only on a deployed runtime, you can replicate the aggregation entirely with a scheduled C-action. Each alarm's trigger tag is read individually and a synthesized DWORD is built.

// Scheduled C-action - per-alarm aggregation
DWORD dwActive   = 0;
DWORD dwUnack    = 0;
DWORD dwMask;

if (GetTagBit("Alarm_F1_Pump1_HiTemp"))  dwActive |= (1 << 0);
if (GetTagBit("Alarm_F1_Pump1_LoPress"))  dwActive |= (1 << 1);
if (GetTagBit("Alarm_F1_Valve1_Open"))    dwActive |= (1 << 2);
// ... up to bit 15 ...

dwMask = dwActive | (dwUnack << 16);
SetTagDWord("Status_FilterSkid1_1", dwMask);

This approach has the advantage of working in any WinCC version, but it does not pick up the acknowledged state automatically because WinCC does not expose a "this alarm is unacknowledged" Boolean per message through the standard tag API - that bit is only available through the status tag mechanism. If you require the acknowledged bit, the user-defined group approach is mandatory.

9. Alternative: External Alarm API (V7.4+)

WinCC 7.4 introduced an ODK / scripting API (AXC_OnMsgAlarmGone, AXC_OnMsgAlarmCame, AXC_OnMsgAlarmAcked) and the modern HMIRuntime.Alarms collection in TIA Portal. These can subscribe to per-message events from C/VBScript and accumulate state in user-defined tags, which is the equivalent of the status tag mechanism but built into custom code. It is useful when:

  • The alarm group must span multiple Alarm Logging databases (multi-server projects).
  • The aggregation logic must include cross-system alarms (e.g., a PLC tag from a non-WinCC source).
  • The runtime must perform conditional acknowledgement or shelving that the AlarmControl cannot do.
Performance caveat: Subscribing to per-alarm events at 1 kHz rates is more expensive than reading a status tag. For sub-100-alarm groups, the status tag approach is faster; for 10 k+ alarms across redundant servers, the event API scales better when combined with a hash-based event router.

10. Migration Notes: InTouch → WinCC

The original problem statement was a conversion from InTouch Application Server (WindowMaker / WindowViewer) to WinCC. InTouch has its own analog: the $InUse, $New, and $Ack system attributes on a chained alarm group. The mapping below helps when porting an existing InTouch alarm strategy:

InTouch mechanism WinCC equivalent Bit/tag behavior
$InUse tag (alarm present) Status tag, low 16 bits 1 = alarm active
$New tag (unacknowledged) Status tag, high 16 bits 1 = unacknowledged
$Ack tag (acknowledgement) AlarmControl acknowledgement button / API WinCC clears high bit when acknowledged
Alarm group filter (InTouch alarm DB) User-Defined Group in Alarm Logging Same conceptual filter
WindowMaker color animation script WinCC property dynamics Use boolean expressions on the masked DWORD

When migrating, document each InTouch alarm group's tag list and member count, then recreate them as user-defined groups in WinCC with the same naming convention so existing operator procedures remain valid.

11. Troubleshooting Matrix

Symptom Likely root cause Verification Fix
Status tag stays at zero even though alarms are active Group's status tag not assigned, or status bit field is wrong Alarm Logging editor → Group → Properties → Status Tag tab Re-assign tag, ensure Status Bit = 0
Active bit (low) sets correctly, unack bit (high) never sets Tag type declared as signed and WinCC is treating bit 31 sign extension Tag Management → Properties → Data type Change to Unsigned 32-bit value
Some alarms set the wrong bit Alarm order in the user-defined group changed after a database import Compare message numbers in the group against the bit assignment Remove and re-add alarms in the correct sequence
Picture does not react to tag changes Property dynamics uses an expression that reads the wrong mask Use the WinCC Tag Simulator to force 0x00010001 and verify Recompute mask: (Tag & 0x0000FFFF) != 0 for active
Tag shows correct bit pattern but screen flashes red/green every cycle Round-trip via PLC: alarm trigger tag is also being written from HMI and PLC toggles it back Trend the trigger tag and the status tag simultaneously Ensure trigger is a read-only HMI tag or read from PLC area only
Status tag holds last value after alarm cleared Status bit "active" not cleared because the alarm was disabled, not cleared Right-click alarm in AlarmControl → Status Use Enable / Disable vs Acknowledge / Clear correctly; status reflects "active" only for messages that came and went through the normal lifecycle
Group works in ES but not in RT Project not fully compiled; Alarm Logging database not regenerated Compare project size in ES vs RT, or check CC_AlgLog_*.mdf timestamp Stop runtime, recompile, restart. On TIA Portal, do a full "Compile → Software (rebuild all)"
Number of alarms per group exceeds 16 Status tag can only carry 16 alarms (32 bits) Count members in the user-defined group Split into two groups and bind each to its own DWORD tag

12. Performance, Capacity, and Reliability Considerations

  • Update rate: WinCC Alarm Logging updates status tags synchronously with the message processing queue. The default cycle is 250 ms, configurable down to 100 ms in Computer Properties → Alarm Logging → Update Cycle. Below 100 ms the SQL archive can become the bottleneck.
  • Tag write rate: Each active alarm sets a bit, so a tag with 16 simultaneously active alarms triggers 16 single-bit writes per change. Although Alarm Logging coalesces these into a single DWORD write, monitor the tag's "change count" to ensure you do not exceed the project licensing of tag changes per second.
  • Redundant servers: In WinCC Redundancy, status tags must be configured on both servers. Alarm Logging replicates the group definition but the status tag values are server-local; clients in a redundant pair receive the active server's values via the standard redundancy swap.
  • Archive growth: The status tag feature writes no archive entries itself; it only drives the runtime tag value. Long-term archiving is unaffected.
  • Migration safety: Avoid renumbering alarms in a user-defined group after commissioning. If a new alarm must be inserted "in the middle" of the bit order, document the change in the project change log because downstream faceplates and dynamic properties will reference the wrong bit.

13. Validation Procedure

  1. Open WinCC Runtime and navigate to the picture that uses the status tag.
  2. Open the Alarm Logging online overview (Start → Programs → Siemens Automation → Alarm Logging → Alarm Logging Online).
  3. Trigger one alarm in the test group (force the trigger tag, or use the Simulate action).
  4. Verify the assigned DWORD's low bit transitions to 1 within one update cycle.
  5. Confirm the corresponding high bit (bit 16) is also 1, indicating "active and unacknowledged".
  6. Acknowledge the alarm in the AlarmControl. The high bit should clear to 0 while the low bit stays 1.
  7. Clear the alarm (return the trigger tag to normal). Both bits should return to 0.
  8. Repeat steps 3-7 for every alarm in the group to confirm correct bit assignment.
  9. Force all 16 alarms simultaneously and verify the DWORD reads 0xFFFF0000 (all unacknowledged) or 0x0000FFFF (all acknowledged).

14. Cross-Reference: Modern Alarm Status Approaches in Other HMI Suites

Engineers porting projects between suites will encounter similar concepts. As a reference comparison (not a substitute for the actual product documentation):

Suite Group-level mask Bit-to-alarm mapping Notes
Siemens WinCC 7.x / TIA Portal Status Tag (32-bit) Bit 0..15 = active, 16..31 = unack Native feature of Alarm Logging; no scripting required
Inductive Automation Ignition Tag alarm properties; Is Active, Is Acknowledged boolean expressions Driven via tag bindings or expression functions on the tag itself Refer to the Ignition user manual for the Is Active / Is Acknowledged properties when configuring tag alarms. See the Inductive Automation user manual entry on Tag Alarm Properties for the current property names and event bindings.
Rockwell FactoryTalk View HMI tag derived from alarm log event detection Macro or VBA aggregates per-alarm state into one DINT Requires FactoryTalk Alarm & Event Server; macro per group
Wonderware InTouch $InUse / $New / $Ack system tags per alarm group Predefined per group, but no native bit mask Use $New for unack, $InUse for active

For engineers evaluating Ignition for a greenfield project, the relevant reference is the Inductive Automation user manual entry on Tag Alarm Properties, which documents the boolean Is Active and acknowledgement properties available on any tag-bound alarm. These can be bound directly into expressions to drive background colors, without the manual bit-mask arithmetic that WinCC's status tag requires.

15. Best-Practices Checklist

  • Use a single naming convention across the project: Status_<AreaName>_<ChunkN>.
  • Limit groups to 16 alarms each; split rather than overflow.
  • Document the bit-to-alarm mapping in a project spreadsheet committed to source control.
  • Prefer property dynamics over scheduled C-actions for simple "red if any active" objects to minimize CPU.
  • Use scheduled C-actions (1 s cycle) when the same status tag drives many picture objects; cache the masked value in a derived Bool tag.
  • Validate bit assignment after every Alarm Logging export / import cycle; re-add alarms in the correct order if the order changed.
  • Keep the Alarm Logging update cycle at 250 ms or higher to avoid SQL archive contention.
  • Verify redundant server behavior by simulating a failover while alarms are active.

How many alarms can one WinCC status tag encode?

Sixteen. A 32-bit status tag carries the active mask in bits 0-15 and the unacknowledged mask in bits 16-31, giving one bit per alarm per state. Groups with more than 16 alarms must be split into additional user-defined groups, each bound to its own 32-bit internal tag.

Can the status tag mechanism work without modifying the PLC program?

Yes. The status tag is an internal WinCC tag that Alarm Logging writes based on the alarm's lifecycle (active / acknowledged / cleared). The PLC only needs to provide the discrete alarm trigger tags already required to generate the alarms; no additional PLC logic is needed to populate the status tag.

Why does bit 16 stay set when an alarm is acknowledged?

By design. The high 16 bits represent the "unacknowledged" mask: bit 16 stays at 1 until the operator acknowledges the corresponding alarm. After acknowledgement the high bit clears while the low (active) bit remains 1 until the alarm itself clears. This dual-mask pattern is what enables red-flashing-for-active and steady-amber-for-still-unacknowledged HMI conventions.

What happens if I add a 17th alarm to a user-defined group that already has 16?

WinCC silently truncates or rejects the 17th alarm depending on version; in practice the alarm does not get a status bit. To avoid silent failure, always plan the grouping so each user-defined group contains at most 16 alarms and bind additional groups to separate status tags following the documented naming convention.

Can I use this technique in TIA Portal WinCC Professional / Comfort?

Yes. The user-defined group and status tag feature is available in TIA Portal from V13 SP1 onward for WinCC Professional, and from V14 onward for WinCC Comfort / Advanced (with reduced message counts). The configuration lives under the HMI device's Alarms editor rather than the legacy Alarm Logging standalone editor, but the bit semantics are identical.

How do I confirm in WinCC Runtime that the status tag is being written correctly?

Open WinCC Tag Simulator (or a Trend view bound to the status tag) and force an alarm by setting its trigger tag. The assigned DWORD should transition from 0x00000000 to 0x00010001 for a single unacknowledged alarm, then to 0x00000001 after acknowledgement, then back to 0x00000000 after the trigger clears. Any other pattern indicates a misconfigured group or bit assignment.

Back to blog