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);
}
}
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);
}
}