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

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.

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.

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

1 Like

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

1 Like

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?

You mean on three separate monitors?

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.

You can specify what window to open on via the method in this thread - Opening a 'window' in a specific 'desktop'

1 Like

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

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.

4 Likes

Elegant, thanks Paul!

1 Like