Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
80821members
346893posts

Cicode Function AlarmSetInfo

bprobertson
Ensign
Ensign
0 Likes
1
1009

Cicode Function AlarmSetInfo

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.

1 Reply 1
RobertSanders
Lieutenant Lieutenant
Lieutenant
0 Likes
0
966

Re: Cicode Function AlarmSetInfo

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