(Citect version: v188.8.131.526)
I'm currently using AlarmSetInfo (INT AN, INT Type, STRING Value) to apply a priority filter using the following code:
FUNCTION AlarmFilteringToggleShowingEvents (INT iAN, STRING sCluster) INT hGrp = GrpOpen("Alarm_Group", 0); IF hGrp = AlarmGetInfo (iAN, 7, sCluster) THEN AlarmSetInfo(iAN, 8, 1); AlarmSetInfo(iAN, 7, 0); ELSE AlarmSetInfo(iAN, 8, 1); AlarmSetInfo(iAN, 7, hGrp); END; END
Where "Alarm_Group" is a defined group of priorities.
The issue that I am having is that when this function is called it clears all other filters that are already applied to the alarm table. For example it clears the equipment filter that is applied.
Why does filtering by priority affect the equipment filter?
There is no information in the help for the AlarmSetInfo function that states that all currently applied filters will be removed when using this function.
It would make sense that all current filters are overriden if I was using AlarmFilterEditSet but this is not the case.
You are correct with your assumption the function AlarmSetInfo will overwrite other filters set by AlarmSetInfo. Its better to use the Alarm Filter Functions
The following is a copy from the help for AlarmFilterEditSet function
iHndl = AlarmFilterEditOpen(iAN);
iRet = AlarmFilterEditSet(iHndl,"Tag=Dig*;Category=1;Area=1;");
iRet = AlarmFilterEditAppend(iHndl, "Priority<20");
sRet = AlarmFilterEditFirst(iHndl); // Tag=Dig*;
sRet = AlarmFilterEditNext(iHndl); // Category=1;
sRet = AlarmFilterEditLast(iHndl); // Priority<20;
sRet = AlarmFilterEditPrev(iHndl); // Area=1;
iRet = AlarmFilterEditClose(iHndl);
Discuss challenges in energy and automation with 30,000+ experts and peers.
Find answers in 10,000+ support articles to help solve your product and business challenges.
Find peer based solutions to your questions. Provide answers for fellow community members!