# How best to fire 'system.nav.openWindow' on specific screen from OPC tag reference?

**URL:** <https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598>\
**Category:** Ignition\
**Tags:** ignition80, scripting, vision\
**Created:** [September 25, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598 "2023-09-25T16:58:05Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 4:58pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/1 "2023-09-25T16:58:06Z")

</div>

Hey all,

I'm trying to implement a simple Popup window that opens when a tag value is greater than a hard coded set point. However, the window it must open on is specific, so I've been trying to embed this functionality within the components on the window itself.

Some background: we are having some issues with our alarming, and I want a quick and dirty replacement while we make changes. I would like to open a warning popup if reactor pressure raises above a set point, so as to not limit operator's situational awareness. However, there are multiple reactors, each with their own vision screen, so I want to make sure the popup opens on the correctly corresponding client window.

My first approach was to create an invisible numeric label on each window that holds the value of each pressure OPC tag, and then create a custom method on the label that would open and center the popup if self.value was \>= {st. pt.}. Unfortunately, I don't think that I'm implementing custom methods correctly (I have yet to use them, still very new), and was wondering what the best approach to this problem would be? It is a very temporary addition, so as simple a solution as possible is preferred.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 25, 2023, 5:05pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/2 "2023-09-25T17:05:15Z")

</div>

What I would do

1. setup a tag change event on the tag that should be dictating if a window should open.

2. In the tag change script if the conditions are met, send a message to your client via `system.util.sendMessage` [system.util.sendMessage - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.util.sendMessage#:~:text=sendMessage,-Created%20by%20Paul&text=This%20function%20is%20used%20in%20Python%20Scripting.&text=This%20function%20sends%20a%20message,project%20within%20the%20Gateway%20itself).

3. In the vision client setup a message handler to receive the message - there you will have your `system.nav.openWindow` logic.

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 5:07pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/3 "2023-09-25T17:07:17Z")

</div>

Great, I'll give this a go and see what I can do. Thanks!

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 5:50pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/4 "2023-09-25T17:50:26Z")

</div>

I've got the scripting set up how you've described, but I have some follow-up questions. How would I dictate what window the pop-up would appear in? Say an operator has three screens open, one for R1, R2, and R3. If R3 pressure breaches st pt, would the popup appear only on R3's screen? Would it appear on all screens, or a random one?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 25, 2023, 5:51pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/5 "2023-09-25T17:51:34Z")

</div>

You mean on three separate monitors?

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 5:54pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/6 "2023-09-25T17:54:30Z")

</div>

Yes sir. Operators run the system from two PCs, each PC has 4-6 monitors. So at any given time, vision screens for more than half the reactors are being viewed, in addition to tanks and other equipment. I have one generic pop-up that I was planning to call, but this causes issues if R1 pressure goes high but the pop-up appears everywhere or on R2/others by mistake.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [September 25, 2023, 6:10pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/8 "2023-09-25T18:10:56Z")

</div>

You can specify what window to open on via the method in this thread - [Opening a 'window' in a specific 'desktop'](https://forum.inductiveautomation.com/t/opening-a-window-in-a-specific-desktop/48552)

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 6:13pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/9 "2023-09-25T18:13:34Z")

</div>

Perfect, thanks for the insight! You've been a great help!

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [September 25, 2023, 6:15pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/10 "2023-09-25T18:15:57Z")

</div>

You could use an approach similar to what you first described. No need for an invisible label, though.

- On each window that has something unique about it, create a custom property on the root container of whatever datatype matches your tag.
- Add a simple direct binding from that property to the OPC tag you want to watch.
- Add a _property change_ script to the root container, filtering for the property name of the custom property you just created, e.g. `if event.propertyName == "customOpcProperty":` should be the first line of the script.
- In that if block, check if `event.newValue` meets or exceeds your set point, and if it does, open your popup window (which should happen on the local screen/desktop automatically).

If you have a lot of places to do this, and want an easier job cleaning this up down the road, you could encapsulate all that into a _template_ with no visible components. You could parameterize the setpoint, input value (or tagpath string), and the desired output popup.

---

<div class="post-metadata">

**Author:** ![Mason\_Stevens](https://avatars.discourse-cdn.com/v4/letter/m/edb3f5/32.png) [@Mason\_Stevens](https://forum.inductiveautomation.com/u/Mason_Stevens)\
**Post date:** [September 25, 2023, 6:26pm UTC](https://forum.inductiveautomation.com/t/how-best-to-fire-system-nav-openwindow-on-specific-screen-from-opc-tag-reference/79598/11 "2023-09-25T18:26:41Z")

</div>

Elegant, thanks Paul!
