Implementing EventState and Group Display Relevance on Custom PCS 7 Blocks with ALARM_8P
In SIMATIC PCS 7, standard system block SFB35 (ALARM_8P) transmits alarm messages to the WinCC server but does not generate the local bitmask required for WinCC Group Displays (Sammelanzeige). To make a custom block relevant for group displays and picture hierarchy alarm bubbling, the SCL block must declare an output parameter named 'EventState' of data type DWORD with system attribute 'S7_m_c := 'true''. The block's internal logic must calculate active alarm bits (Bit 0 for Alarm High, Bit 1 for Warning High, Bit 5 for Alarm Low, Bit 6 for CSF) and pack them into 'EventState', which WinCC automatically binds to the Group Display object.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
When developing proprietary technological function blocks in SCL for SIMATIC PCS 7 (such as custom analyzers, packaging skids, or third-party device drivers), engineers integrate system function block SFB35 (ALARM_8P) to generate process alarms. While alarms successfully appear in the WinCC Alarm Logging sequence list, engineers frequently find that the block icon's group display (Sammelanzeige) and the top-level WinCC picture hierarchy buttons remain completely dark when an alarm occurs.
This disconnection occurs because WinCC Group Displays do not poll the Alarm Logging SQL database; instead, they monitor a live PLC-level process tag named EventState. SFB35 has no EventState output pin and does not calculate visual group states. To achieve full integration with PCS 7 Basic Process Control, the custom block must construct the standard 32-bit EventState mask internally. This guide details the bit allocation standards for EventState and provides the exact SCL code implementation.
Architecture and Fundamental Mechanics
The PCS 7 Basic Process Control alarm visualization architecture relies on two independent communication channels:
-
Event-Driven Messaging Channel (SFB35 ALARM_8P):
- When an alarm condition occurs (SIG_1toSIG_8), SFB35 issues an asynchronous S7 communication event to WinCC Alarm Logging.
- WinCC writes the event to the SQL message database and updates the alarm banner text. This channel is purely event-driven and does not drive real-time graphic animations. -
Real-Time Cyclic Status Channel (EventState):
- WinCC block icons feature a 'Group Display' (Sammelanzeige) smart object displaying 5 standard visual states: Alarm (red), Warning (yellow), Tolerance (blue), Fault/CSF (black/yellow), and Operator Prompt/Maintenance (white).
- The Group Display binds directly to<BlockTag>.EventStatevia WinCC cyclic tag polling.
- Picture Hierarchy Bubbling: The PCS 7 Picture Tree Manager monitorsEventStateacross all block icons in a graphic picture. If any block has active alarm bits inEventState, the picture tree coordinates alarm bubbling, turning the plant area navigation button red. -
Standard EventState Bit Structure (PCS 7 APL / Basis Standard):
- Bit 0: Alarm High (AH- 16#00000001)
- Bit 1: Warning High (WH- 16#00000002)
- Bit 2: Tolerance High (TH- 16#00000004)
- Bit 3: Tolerance Low (TL- 16#00000008)
- Bit 4: Warning Low (WL- 16#00000010)
- Bit 5: Alarm Low (AL- 16#00000020)
- Bit 6: Control System Fault (CSF- 16#00000040)
- Bit 7: Maintenance / Process Prompt (16#00000080)
- Bits 16 to 23: Acknowledgment status bits (mirrored from WinCC back to the AS to track whether alarms are acknowledged).
Step-by-Step Implementation Procedure
Follow these steps to implement EventState and group display relevance in a custom SCL block for PCS 7:
-
Declare the EventState Output Parameter in SCL:
- Open your custom block source in the SCL Editor.
- In theVAR_OUTPUTsection, declare theEventStatevariable with mandatory PCS 7 system attributes:
scl VAR_OUTPUT EventState { S7_m_c := 'true'; S7_xm_c := 'Value,true;'; S7_visible := 'false' } : DWORD := 16#00000000; // Other block outputs END_VAR
- Note: The attribute{ S7_m_c := 'true' }is mandatory; it informs the AS-OS compiler to create the tag in WinCC Tag Management. -
Declare Alarm Calculation Variables in SCL:
- InVAR_TEMPor internalVAR, declare boolean flags for your active conditions:
scl VAR_TEMP b_Alarm_High : BOOL; b_Warning_High : BOOL; b_Alarm_Low : BOOL; b_CSF : BOOL; dw_TempState : DWORD; END_VAR -
Calculate Active Alarm Conditions in Logic:
- In the code body, evaluate process values and faults against limit parameters:
scl b_Alarm_High := (PV >= HighHigh_Limit) AND NOT MsgLock; b_Warning_High := (PV >= High_Limit) AND NOT MsgLock AND NOT b_Alarm_High; b_Alarm_Low := (PV <= LowLow_Limit) AND NOT MsgLock; b_CSF := ExtFault OR ModErr; -
Map Bits into the EventState Double Word:
- Construct the bitmask by packing the booleans into the lower byte ofEventState:
```scl
dw_TempState := 16#00000000;
IF b_Alarm_High THEN dw_TempState := dw_TempState OR 16#00000001; END_IF;
IF b_Warning_High THEN dw_TempState := dw_TempState OR 16#00000002; END_IF;
IF b_Alarm_Low THEN dw_TempState := dw_TempState OR 16#00000020; END_IF;
IF b_CSF THEN dw_TempState := dw_TempState OR 16#00000040; END_IF;// Preserve upper acknowledgment bytes written by WinCC
EventState := (EventState AND 16#FFFF0000) OR (dw_TempState AND 16#0000FFFF);
``` -
Connect Signals to SFB35 (ALARM_8P):
- Ensure your SFB35 instance call evaluates the identical booleans:
scl inst_Alarm8P( EN_R := TRUE, ID := 16#EEEE, EV_ID:= MsgEvId, SIG_1:= b_Alarm_High, SIG_2:= b_Warning_High, SIG_3:= b_Alarm_Low, SIG_4:= b_CSF ); -
Compile SCL, Update Block Types, and Compile OS:
- Compile the SCL source into the target FB.
- In SIMATIC Manager, execute 'Options > Charts > Update Block Types...'.
- Run an AS-OS compile ('Entire OS' with 'Tags and messages'). WinCC automatically instantiates the.EventStatetag.
- On the WinCC block icon, ensure the Group Display propertyCollectValueis interconnected to<Tag>.EventState.
Verification
- In CFC Test Mode, force an alarm condition (e.g., set
PV > HighHigh_Limit): confirm thatb_Alarm_HighgoesTRUEandEventStatedisplays16#00000001. - In WinCC OS Runtime, observe the custom block icon: confirm that the Group Display immediately displays a flashing red 'A' (Alarm).
- Check the WinCC picture hierarchy navigation bar: verify that the plant area button hosting this graphic turns red with the active alarm indicator.
- Acknowledge the alarm on the WinCC faceplate: confirm that the Group Display transitions from flashing red to steady red.
- Clear the alarm in CFC: confirm that
EventStateclears to16#00000000and the Group Display indicator goes dark.
Limitations and Operational Precautions
Ensure that the upper word (16#FFFF0000) of EventState is not overwritten with zeros in SCL; WinCC uses the upper word to communicate acknowledgment status. The SCL code must preserve the upper word using bitwise masking (EventState := (EventState AND 16#FFFF0000) OR dw_TempState). Always verify SCL compiler options and PCS 7 engineering licenses through an authorized Siemens distributor or the Siemens Industry Mall.
Engineer FAQ
Why does SFB35 ALARM_8P not update the Group Display automatically?
SFB35 is an asynchronous messaging protocol block that sends telegrams to Alarm Logging. WinCC Group Displays require a separate, cyclically polled process tag (EventState) to animate graphical symbols in real time.
What attribute must be placed on EventState in SCL?
The system attribute { S7_m_c := 'true' } must be declared on the EventState output so the AS-OS compiler exports the tag to WinCC.
What bit in EventState corresponds to Control System Fault (CSF)?
Bit 6 (16#00000040) represents Control System Fault / external hardware error.
Why do WinCC navigation buttons turn red when an alarm occurs?
The WinCC Picture Tree Manager evaluates the EventState of all block icons placed in a picture and rolls up (bubbles) the highest priority alarm state to the overview buttons.
Do custom blocks with EventState consume extra WinCC licenses?
No. The block consumes standard AS RT Process Objects and OS RT Process Objects based on its technological instance, not by having an EventState tag.
Technical References
- SIMATIC Process Control System PCS 7 Programming Instructions for Blocks (V9.0 / V9.1)
- SIMATIC WinCC Information System - Smart Objects: Group Display (Sammelanzeige)
- Siemens Industry Online Support FAQ 17778440 - Using Group Displays with Bit and Analog Alarms
Related Articles
- Resolving Locked Alarms on Analog Blocks (MonAnL and PIDConL) in PCS 7 OS Runtime
- Suppressing Low Motor Current Alarms When Stopped Using APL MotL and MonAnL in PCS 7
- Why Blocks in CFC Charts Are Called by OB35 - Execution Cycle Fundamentals in PCS 7
Related Tags
- EventState
- Sammelanzeige
- Group Display
- ALARM_8P
- Custom Block
- PCS 7 V9.1