Copy Alarm To Variable


jbotas

Recommended Posts

I'm trying to do a script that list alarms and creates a table with the active alarms.

The problem is that the listall function only return the names as strings.

I need to do a lot of "executes" to check for example if the alarms are fired.

This is really slow and the script takes alot of time to check all the alarms.

If i have about 150 alarms and 50 of them fires it takes 2 to 3 seconds to run the script

 

I tried but I can't copy an alarm to a variable like this

 

private Alm = execute("Alarm."+Almname)

private AlmFired = Almname.Fired

 

Is there a way to acess the database of alarms without using the execute?

Maybe a list function that returns the alarms but with the parameters and variables acessed in a "while" or "for"

 

ex:

 

private AlmList = Alarm.List()

private iter = 0

while(iter < NumRows(AlmList))

  if(AlmList[iter].Fired)

        //code here

  endif

  iter++

endwhile

 

As attachment i'll put my teste project. The script is ALARM_DISPLAY_MANAGER and the display of the alarms is in page ALARMES and TEMPLATE_BANNER

 

Testes.ctl

Link to comment
Share on other sites

In my opinion by event is not a good solution.

We can't import and export alarms with the events.

So if i have 100 alarms i have to copy the code of the 3 events in every alarm. To much work and prone to human error.

And if later i create another alarm i can forget about the events and the alarm won't go in the table.

 

I'll post in the new Features Request about this functions.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.