Ask our Experts
Didn't find what you are looking for? Ask our experts!
This forum is addressing industrial automation design & engineering, operations, asset performance, cyber security and digital transformation for Plants & Machines.
Search in
Posted: 2020-04-24 12:12 AM
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-04-24 12:12 AM
Hi,
(Citect version: v8.10.0.2086)
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.
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2020-05-13 11:13 AM
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);
Regards
Rob
Link copied. Please paste this link to share this article on your social media post.
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.