WinCC Pro v15 c script

Weo

Member
Join Date
Feb 2006
Location
Sweden
Posts
82
Hello all,

In an WinCC Professional v15 application I need to filter the alarms by alarm class, not using the filter button on the toolbar of the alarmview object.

I read one solution is to use the ACX_SetFilter, find some examples for WinCC 6 or 7 I think, but how to modify this for WinCC Professional to get it work? There are some differences between these I believe.

The alarmoview object in my project is named Alarmvindow and button is in the same screen.

Below script gives no errors when I do the syntax check but it does not filter the alarms. First time using c script but trying to learn more.

So please have a look in script, what is wrong here? Or maybe there is other better solution to filter the alarms?

#include "GlobalDefinitions.h"
void OnClick(char* screenName, char* objectName, char* propertyName)
{

#include "m_global.h"

MSG_FILTER_STRUCT scSelect;
CMN_ERROR scError;
BOOL bOK;
memset(&scSelect , 0, sizeof(scSelect )); //reset filter struct
memset(&scError, 0, sizeof(scError)); //reset error struct
strcpy (scSelect.szFilterName, "MySelection"); //set filter name
scSelect.dwFilter = MSG_FILTER_CLASS ; //select filter conditions
scSelect.dwMsgClass = 0x01000000 | 0x01000001 ; //select message class 64 and 65
bOK = AXC_SetFilter(screenName,"Alarmwindow",&scSelect,&scError); //set filter
if (!bOK){
printf ("#E210: AXC_SetFilter() - failed! szErrorText="%s"\r\n", scError.szErrorText);
}

}
 
Yes, thanks I tried that one, but the thing is that when you change the screen the filter goes back to it's default setting as per your picture.

So that is the reason I need to do the filtering by click (or actually when screen is loaded but same thing) The same alarmobject is used on several screens (screen window). Maybe you have idea how to achieve this?
 

Similar Topics

I am doing something no one else has ever done.... I want a screen that lists all the faults that have occurred in the resent past on one screen...
Replies
16
Views
6,510
I have several items which all relate to a process step. There are 20 steps all with the same variables. I want to add variables in each step...
Replies
1
Views
3,309
WinCC Pro V15.1 with CPU 1516-3 PN/DP As always , thanks for the amazing help, you guys are awesome. See the link below as a reference...
Replies
24
Views
11,008
Dear Support, I am working on a new WinCC Professional V15.1 project. My customer wants to use active directory with my application. I understand...
Replies
0
Views
3,027
Dear all, I am working on a project which involves having to send email notifications on alarm conditions. So far I have created 450 discrete...
Replies
3
Views
1,631
Back
Top Bottom