jbotas Posted February 9, 2015 Share Posted February 9, 2015 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 More sharing options...
AzeoTech Posted February 9, 2015 Share Posted February 9, 2015 You would be better off creating your own table of alarm states and using the Fire, Ack, Reset events of each alarm to update that table. Link to comment Share on other sites More sharing options...
jbotas Posted February 10, 2015 Author Share Posted February 10, 2015 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.