Popup Window For Alarms

I am wanting to create a popup window for a few alarms. The maintenance staff has asked that when an alarm goes off that a pop up screen will appear. Is there a way to make a popup come on based on a tag value rather then a button?

Thanks

Yes, you would use a client tag change event script, subscribed to the desired tag.

I have written the code on the root container as a custom property but it does not work. Any ideas?

def Popup(self):
	"""
	Arguments:
		self: A reference to the component instance this method is invoked on. This argument
		  is automatic and should not be specified when invoking this method.
	"""
selectONE = system.tag.read("[default]VIB-01/Alarm").value

if selectONE == 1:
	system.nav.openWindow('Generators')
	system.nav.centerWindow('Generators')
else:
	system.nav.closeWindow('Generators')

I have got it to work using a client tag however I do not want it to open when the tag turns to 0. As of now any change in the tag value causes the popup to happen.

Thoughts?

You'll have to check newValue.value != 0 in your tag change script, as the script gets called for any change like you've seen.

P.S. I also recommend checking initialChange, which is True when the tag 'change' is due to a new subscription (client start or project update), and newValue.quality.good, since if the tag quality changes that also triggers a change.

I have the code as follows. Where should I make the changes?

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

		system.nav.openWindow('Generators')
		system.nav.centerWindow('Generators')
type or paste code here

My mistake, newValue is for Gateway tag change event scripts.

def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):

	if (not initialChange) and currentValue.quality.good and currentValue.value != 0:
		system.nav.openWindow('Generators')
		system.nav.centerWindow('Generators')