Navigation based on Alarm

Is there a feature where you double click or right click an alarm in the alarm status table and Ignition automatically navigates/opens up that window?

The display path in the alarm exists but it appears to be only for display purposes?

How might one hook into the alarm status table to enable/create a feature like this?

Thanks

Yeah we have done this before. When you double click on the alarm table, you can get the path of the alarm. From there, you can get a custom property of the alarm, which could be the window. Then call system.nav.openWindow based on that property.

1 Like

I appreciate the feedback and like that idea.

I’ll need another field displayed in the alarm status table then as I have to have the tag name (i.e. empty display path) and need another area (custom property?) to store the window name for navigation purposes.

Any ideas? Thanks !

[quote=“roman.pierantozzi”]I appreciate the feedback and like that idea.

I’ll need another field displayed in the alarm status table then as I have to have the tag name (i.e. empty display path) and need another area (custom property?) to store the window name for navigation purposes.

Any ideas? Thanks ![/quote]

you could also store the alarm path and the window that you want to open in the database and just query out which window to open.

Here is what I threw together(ignition 7.5, 7.6 may be different)

I added a string type custom property called selectedItemPath on the alert summary table and put this expression on it.

[code]

try({Root Container.Alert Summary.alerts}[{Root Container.Alert Summary.selectedRow}, 1], -1)[/code]

This will give you the item path of the alarm.

then on your alarm summary tables event handler add a mouse clicked script that looks like this

if event.clickCount == 2:
	selectedItemPath = event.source.selectedItemPath

	if selectedItemPath != -1:
		rs = system.db.runPrepQuery("SELECT windowpath,itempath FROM alarmwindow WHERE itempath = ?", [selectedItemPath])
		if len(rs) > 0:
			windowpath = rs[0][0]
			itempath = rs[0][1]
			system.nav.swapTo(windowpath)

I didnt test this part because I was too lazy to create a db table but it should work. you just would need to create the table with a column for a tag and a column for what window you want to open for that tag. depending on how your tags are setup you could modify this to do many different things, but at least this can give you a start.

I suspect things have changed for rev 7.9.9. The expression reference to “Alert Summary” is most likely changed to the default “Alarm Status Table”. I do not know what should replace the “alerts” property; I get an error that the property is not bindable

.

You could use the .selectedAlarms property, which will be a dataset containing any selected alarms. Since you want to perform navigation, you will probably turn off Multi Select so this dataset will only contain 0 or 1 row. So the binding for you would be something like.

try({Root Container.Alarm Status Table.selectedAlarms}[0, 1], -1)

Thanks nick, the expression no longer has an error. Now the issue is the event handler script. Is this a script for the propertyChange event on the Alarm Status Table? I am getting runtime errors on “clickCount”

clickCount is a custom property just like selectedItemPath, probably type int. Looks like its only there to implement some form of double-click.
Edit: When this was first posted, clickCount might have been a built in property, but I don’t think it is anymore. If you take that line out, then it will work on first click. If you add a custom property for it, change the first line from

if event.clickCount == 2:

to

if event.source.clickCount == 2:

I think I found a better way

I added a custom property to the alarms on my tags called “Popup”. It allows me to configure the name of the popup display on each tag. That way I don’t need an external table

Then I create a script on the onDoubleClicked event of the Alarm Status Table. Ideally I would have liked to use a right click, but the createPopupMenu executes on right click and it does not return the alarm event that was double clicked; it returns all alarms that are selected. To only return the single alarm that was desired I need to use double click.

The script just checks to see that the Popup property exists. The alarmEvent contains the tag and alarm properties, which is demonstrated with the console results from the print statements in the script. If the “Popup” properties exists, it uses the property to open the window. I don’t know if checking != -1 is the best way, but it works.

1 Like