Extanding the power of the Alarm Summmary component

I’m try to add filtering and the ability to look at alarm history.
I have created a date selector and a couple of text boxes (for path and alarm filters)

I bound the Alerts property to this code:

if ({Root Container.Alarms.Options.DateRange.selected}, runscript("app.alarms.get_history_alarms()"), runscript("app.alarms.get_current_alarms()"))

The code it calls (app.alarms.get_xxx_alarms()) is:

[code]def get_history_alarms():
import system
import app
options = app.alarms.get_options()
if options.getComponent(‘Device’).selected == 1:
filterpath = options.getComponent(‘Text Field’).text+’
else:
filterpath = None
if options.getComponent(‘Point’).selected == 1:
filterpoint = options.getComponent(‘Text Field 1’).text+’

else:
filterpoint = None

startdate = options.getComponent('StartDate').date
enddate = options.getComponent('EndDate').date
return system.alert.queryAlertHistory("AlertHistory", path=filterpath, stateName=filterpoint,
    start=startdate, end=enddate, 
    activeAndAcked=1, clearAndAcked=1)

def get_current_alarms():
import system
import app
options = app.alarms.get_options()
if options.getComponent(‘Device’).selected == 1:
filterpath = options.getComponent(‘Text Field’).text+’
else:
filterpath = None
if options.getComponent(‘Point’).selected == 1:
filterpoint = options.getComponent(‘Text Field 1’).text+’

else:
filterpoint = None

return system.alert.queryAlertStatus(
    path=filterpath,
    stateName=filterpoint,
    activeAndUnacked=1, activeAndAcked=1,
    clearAndUnacked=1, clearAndAcked=0,
    flatten=0)

def get_options():
import system
window = system.gui.getWindow(‘Alarm Summary’)
container = window.getRootContainer()
alarms = container.getComponent(‘Alarms’)
options = alarms.getComponent(‘Options’)
return options[/code]

However, it doesn’t seem to work. The control displays all current alerts regardless of the contents of the Alerts dataset. The documentation for the Alerts property says it’s read only and bindable :scratch:

Yeah, the “read-only” part means exactly that - you can’t write to the alerts dataset. Bindable in this sense means that you can bind other things to it. The reason its there is to let you create labels for example that might be bound to an expression like:

"There are" + len({Root Container.AlertTable.alerts}) +" alerts"

Filtering capabilities are built-in, and adding historical capabilities are on the roadmap. In the meantime you’ll have to use a standard table and bind it up yourself.

You mean I actually have to do some work myself? sigh
Oh well, I guess I call myself a programmer for a reason. I know you guys have been working hard on all my other requests. I’ve managed to come up with a solution that should work.

Thanks for your patience! We’ll get the alert history table in there in not too long.

IA had a sample Alert History table that was downloadable for Factory PMI, but won’t work in Ignition. Are you going to update it to work in Ignition?

The sample alert history table from FactoryPMI was nothing more than the standard Table component, with some query bindings pre-configured to query your database for alert history.

You can certainly still do this in Ignition.

  1. Set up a database alert storage profile
  2. Drop a table component on the screen
  3. Drop a date-range component on the screen
  4. Bind the table’s data property to a SQL Query binding that selects the alerts from the database where the t_stamp is between the selected dates of the date-range component.

Carl - I will do that. Thank you for the tip/reply.