Alarming / Alerting

Anyone have an example on how to do alarming similar to RSView. I can get the tag to trigger in a table using the data base browse expression by pointing it to the Alert_Log.

The problem I can’t seem to use a pushbutton to Acknowledge the alarm.

Thanks for any help.

We’ll be adding some easier alarming components very soon for dealing with alarms. Currently the only way to acknowledge an alert is to use the system.alert.acknowledgeAlert function.

Thats what I see. But Anytime I try to use some of the Alert sample code in the Manual. Just by pasting it in the expression window gives me all types of syntax errors - even though the syntax is exactly like the manual.

using the built in Alert_log attached to a mysql database. What should I use on a button?

system.alert.acknowledgeAlert(system, path, stateName)

Thanks

This is python code and should be entered into the event handlers script, not an expression (though you could using the runScript() function if you wanted to).

To access it, just right-click on the button and select Event Handlers…->action->actionPerformed. Click on the Script Editor tab at the top right of the screen and put your script into the space provided. This script will run every time the button is pressed.

Sorry to be a pain - but that is what I did.

system.alert.acknowledgeAlert(SQLTags.default, [default]Alm_ESTOP, ALM_STOP)

when I hit apply it comes up saying there is syntax error.

I got the system, path, and state name from the table I created so I know those are right. It is in the action performed / script editor.

OK, I get it.
:slight_smile:
What isn’t obvious is that the parameters you pass in should be strings or variables. You can do one of two things.
Try adding quotes:

system.alert.acknowledgeAlert("SQLTags.default", "[default]Alm_ESTOP", "ALM_STOP")

Or use variables:

system= "SQLTags.default" path = "[default]Alm_ESTOP" stateName = "ALM_STOP" system.alert.acknowledgeAlert(system, path, stateName)
The example in the help manual is more complicated with a sub function and default values all added in.