Triggering Digital Tags and AS Logic on WinCC Alarm Acknowledgment in SIMATIC PCS 7

Triggering Digital Tags and AS Logic on WinCC Alarm Acknowledgment in SIMATIC PCS 7

To set a digital tag or controller bit when a specific process alarm is acknowledged in SIMATIC PCS 7, you cannot rely on native Alarm Logging properties alone because WinCC does not provide an arbitrary boolean output pin per alarm message. Instead, implement one of three standard mechanisms: 1. Monitor the Group Display tag (.EventState) of the technological block, detecting when the unacknowledged alarm bit clears while the alarm active bit remains set; 2. Utilize the WinCC Open Development Kit (ODK) API or GCS callback MSRTSetMsgQuitCallback to trigger a C-script upon message acknowledgment; or 3. In CFC, evaluate the block's internal operator acknowledgment outputs (such as MsgAckn on APL blocks) to pulse controller logic directly.

Table of Contents

Executive Summary

In specialized process control and safety coordination scenarios, engineers frequently require secondary automation actions—such as silencing physical beacon horns, resetting interlock latching circuits, or informing an external supervisory controller—when an operator acknowledges a specific process alarm on the WinCC Human-Machine Interface (HMI). While WinCC Alarm Logging excels at recording message arrival and acknowledgment timestamps in SQL archives, it does not provide an out-of-the-box tag link to pulse a PLC bit upon operator acknowledgment of an individual message. This article analyzes the software architecture of PCS 7 alarm states, contrasts the Group Display .EventState bitmask with the WinCC ODK callback framework, and provides practical implementation steps for both AS-level and OS-level acknowledgment routing.

Architecture and Fundamental Mechanics

Alarm State Architecture, Group Display Bitmasks, and WinCC ODK Callback Mechanics:

  • APL Alarm State Representation and the .EventState Tag:
  • Every technological block in PCS 7 (e.g. MonAnL, VlvL) communicates with WinCC Alarm Logging via standardized ALARM_8P messages.
  • To visualize collective alarm statuses on graphics, the block maintains an internal 32-bit status tag named .EventState.
  • The .EventState double-word utilizes specific bit assignments according to NAMUR standards:
    • Bits 0-3: Active alarm states (16#01 = Alarm High, 16#02 = Alarm Low, etc.).
    • Bits 16-19: Unacknowledged alarm states (Came In / Unacknowledged).
  • When an alarm arrives, both the Active bit and the Unacknowledged bit turn TRUE.
  • When the operator presses the Acknowledge button on the faceplate or toolbar, the Unacknowledged bit transitions to FALSE, while the Active bit remains TRUE until the physical process condition clears.
  • By attaching a tag-triggered script to .EventState, WinCC can detect this specific transition and set an AS digital tag.

  • Method 1: The Group Display (@EventState) Tag-Triggered VBScript:

  • A background Global Action or hidden graphic object monitors the technological block's .EventState tag.
  • When the script evaluates that the unacknowledged mask transitions from 1 to 0 while the alarm active mask is 1, it asserts a boolean write (SetTagBit) to an S7-400 controller tag.

  • Method 2: WinCC Open Development Kit (ODK) / GCS Acknowledgment Callback:

  • For plant-wide scalability without creating individual tag triggers for hundreds of blocks, WinCC ODK provides the message runtime callback MSRTSetMsgQuitCallback.
  • A custom C-application or global DLL registers this callback with the WinCC Alarm Logging service.
  • Whenever any message is acknowledged, WinCC passes the unique Message Number (MsgNr) to the callback function. The function checks if the MsgNr matches the designated critical alarm and immediately pulses the required PLC bit.

  • Method 3: AS-Level Evaluation via APL Block Inputs/Outputs:

  • If the acknowledgment occurs via the standard APL faceplate, the faceplate writes to the block's internal acknowledgment input.
  • In CFC, certain technological blocks expose acknowledgment feedback or can be interconnected with the EventTs (Time-Stamped Event) block to reflect acknowledgment pulses directly inside the controller program.

Step-by-Step Implementation Procedure

  1. Implement EventState Transition Detection in WinCC Global Script (VBScript Method):
    * In WinCC Explorer, open Global Script -> VBS-Editor.
    * Create a new Global Action: CheckAlarmAck.bap.
    * Configure the trigger as Tag Trigger linked to <Chart>/<Block>.EventState on cycle type 'Upon Change'.
    * Write the script logic to evaluate acknowledgment bitmask transitions:
    vbscript Dim currentState, lastState currentState = HMIRuntime.Tags("Area/FIC101/MonAnL.EventState").Read lastState = HMIRuntime.Tags("@FIC101_LastEventState").Read ' Check if unacknowledged bit (bit 16) went from 1 to 0 while alarm bit (bit 0) remains 1 If ((lastState And &H10000) <> 0) And ((currentState And &H10000) = 0) And ((currentState And &H1) <> 0) Then HMIRuntime.Tags("Area/PLC_Tag_AckPulse").Write 1 End If HMIRuntime.Tags("@FIC101_LastEventState").Write currentState
    * Save and activate Global Script Runtime in WinCC Startup properties.

  2. Configure Auto-Reset Pulse in the Controller (CFC):
    * In the CFC chart receiving PLC_Tag_AckPulse, connect the signal to a Pulse block (or timer) to automatically clear the bit back to 0 after 1 second.

  3. Alternative: Using WinCC Horn Acknowledgment Actions:
    * If the goal is acoustic signaling or external beacon silence, open the Horn configuration editor in WinCC Explorer.
    * In the 'Message Assignment' tab, map the critical alarm class to a Horn group.
    * In the 'Signal Assignment' tab, link the acknowledgment trigger to a WinCC tag connected directly to the hardware beacon.

Verification

  1. In CFC test mode, simulate an alarm condition on the target block (e.g. drive PV_In above AH_Lim).
  2. Verify in WinCC Alarm Logging that the critical alarm appears in red as 'Active / Unacknowledged'.
  3. Observe in CFC that PLC_Tag_AckPulse remains 0.
  4. On the WinCC operator console, click the Acknowledge button on the alarm line or faceplate.
  5. Verify in CFC test mode that PLC_Tag_AckPulse immediately pulses to 1 and resets, confirming successful detection.

Limitations and Operational Precautions

Creating hundreds of individual tag-triggered VBScripts on .EventState tags can introduce noticeable CPU load on the WinCC OS Server; reserve tag-triggered scripts for critical alarms, or utilize WinCC Horn / ODK for bulk plant-wide routing. Never use alarm acknowledgment signals as an automatic safety bypass or interlock reset without physical safety reviews.

Engineer FAQ

Does WinCC Alarm Logging have an output tag for alarm acknowledgment?

No, Alarm Logging logs events to SQL but does not provide an automatic PLC output tag per individual message.

What is the .EventState tag in PCS 7?

It is a 32-bit status tag generated by APL technological blocks that encodes active and unacknowledged alarm states for Group Displays.

How can I detect when an alarm is acknowledged via script?

By monitoring the .EventState tag and detecting when the unacknowledged bitmask (bits 16-19) transitions from 1 to 0.

Can WinCC Horn set a tag when an alarm is acknowledged?

Yes, WinCC Horn configuration allows assigning digital tags that toggle or reset upon global horn acknowledgment.

What is MSRTSetMsgQuitCallback?

It is a WinCC ODK C-API function that registers a callback function invoked whenever any message is acknowledged in runtime.

Technical References

Related Articles

Related Tags

  • Alarm Acknowledgment
  • WinCC Alarm Logging
  • EventState
  • Group Display
  • VBScript
  • WinCC ODK
  • Horn Configuration
  • PCS 7 V9.0
20 respuestas