Kkula
Browse Questions » SIMATIC WinCC (TIA Portal): Windows control center Pro Edition - alarm filtering

About User

Questions Asked: 20.9K

Answers Given: 32

0
  • Open

SIMATIC WinCC (TIA Portal): Windows control center Pro Edition - alarm filtering

I need some guidance related to Alarm View filtering in  WinCC professional.
First , I need to apply/unapply already defined filter rule (for example "filter_1")  by button clik. Second, VBS script that filters by alarm class ( ie  show only alarms from class "alarmgroup1" and "alarmgroup2").
Any other VBS examples on using
MsgSQLFilter 
,like showing only alarms from specific date or similar would be great, thanks in advance.

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Hello, I'm Siemens Self Support, integrated with SiePortal. Here's guidance on WinCC Professional Alarm View filtering: **1. Applying/Unapplying Defined Filters (Button Click):** Use VBScript to toggle a tag that controls filter activation. In the Alarm View's "Event" settings (On-Click event of your button), use code like: ```vbs Dim bFilterActive bFilterActive = HMIRuntime.Tags("Filter_1_Active").Read 'Read Tag Value HMIRuntime.Tags("Filter_1_Active").Write Not bFilterActive 'Toggle tag value ``` Then, in Alarm Filtering properties, link "Filter_1" to the "Filter_1_Active" tag. **2. Filtering by Alarm Class (VBScript):** ```vbs Dim strFilter strFilter = "AlarmClass = 'alarmgroup1' OR AlarmClass = 'alarmgroup2'" HMIRuntime.ActiveAlarmView.MsgSQLFilter = strFilter ``` **3. MsgSQLFilter Examples:** * **Specific Date:** ```vbs Dim strDate strDate = "2024-01-26" HMIRuntime.ActiveAlarmView.MsgSQLFilter = "Timestamp >= '" & strDate & " 00:00:00' AND Timestamp <= '" & strDate & " 23:59:59'" ``` * **Specific Priority:** ```vbs HMIRuntime.ActiveAlarmView.MsgSQLFilter = "Priority = 1" 'Show only Priority 1 alarms ``` * **Acknowledged/Unacknowledged:** ```vbs HMIRuntime.ActiveAlarmView.MsgSQLFilter = "Acknowledged = 0" 'Show only unacknowledged alarms ``` **Resources:** * **SiePortal:** Search for "WinCC Alarm Filtering VBScript" for detailed documentation and examples: [https://support.industry.siemens.com/](https://support.industry.siemens.com/) * **WinCC Help:** Explore the WinCC help files under Alarm Filtering and VBScript for detailed function descriptions.

0