# Popup Window For Alarms

**URL:** <https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [December 18, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980 "2024-12-18T13:58:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitchell\_Gerber](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mitchell\_Gerber](https://forum.inductiveautomation.com/u/Mitchell_Gerber)\
**Post date:** [December 18, 2024, 1:58pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/1 "2024-12-18T13:58:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [December 18, 2024, 2:16pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/2 "2024-12-18T14:16:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Mitchell\_Gerber](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mitchell\_Gerber](https://forum.inductiveautomation.com/u/Mitchell_Gerber)\
**Post date:** [December 18, 2024, 3:59pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/3 "2024-12-18T15:59:43Z")

</div>

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

```python
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')

```

---

<div class="post-metadata">

**Author:** ![Mitchell\_Gerber](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mitchell\_Gerber](https://forum.inductiveautomation.com/u/Mitchell_Gerber)\
**Post date:** [December 18, 2024, 4:22pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/4 "2024-12-18T16:22:52Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [December 18, 2024, 4:34pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/5 "2024-12-18T16:34:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Mitchell\_Gerber](https://avatars.discourse-cdn.com/v4/letter/m/e19adc/32.png) [@Mitchell\_Gerber](https://forum.inductiveautomation.com/u/Mitchell_Gerber)\
**Post date:** [December 18, 2024, 6:23pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/6 "2024-12-18T18:23:57Z")

</div>

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

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

		system.nav.openWindow('Generators')
		system.nav.centerWindow('Generators')

```

```python
type or paste code here

```

---

<div class="post-metadata">

**Author:** ![Felipe\_CRM](https://avatars.discourse-cdn.com/v4/letter/f/dfb087/32.png) [@Felipe\_CRM](https://forum.inductiveautomation.com/u/Felipe_CRM)\
**Post date:** [December 18, 2024, 6:55pm UTC](https://forum.inductiveautomation.com/t/popup-window-for-alarms/99980/7 "2024-12-18T18:55:46Z")

</div>

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

```python
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')

```
