# PLC Tag that selects Ignition Window

**URL:** <https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [July 14, 2023, 10:49am UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369 "2023-07-14T10:49:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robbie.Wozencroft](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Robbie.Wozencroft](https://forum.inductiveautomation.com/u/Robbie.Wozencroft)\
**Post date:** [July 14, 2023, 10:49am UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369/1 "2023-07-14T10:49:59Z")

</div>

What is the best way to use a PLC tag to change a window on a project on Ignition?

Say I have a Tag called 'Screen 1' that was controlled by input on a HMI, could I write a client event script that takes the tag value and selects a screen based of the value?

value = system.tag.read('Screen 1').value  
if value==1:  
system.nav.SwapTo('window 1)  
elif value==2:  
system.nav.swapTo('window 2')  
elif value==3:  
system.nav.swapTo('window 3')

It's my first time doing something like this so any guidance would be appreciated.

Thanks

---

<div class="post-metadata">

**Author:** ![Learner\_Ignition](https://avatars.discourse-cdn.com/v4/letter/l/b3f665/32.png) [@Learner\_Ignition](https://forum.inductiveautomation.com/u/Learner_Ignition)\
**Post date:** [July 14, 2023, 11:29am UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369/2 "2023-07-14T11:29:03Z")

</div>

This should help you

[https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigate](https://docs.inductiveautomation.com/display/DOC81/system.perspective.navigate)

---

<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:** [July 14, 2023, 12:21pm UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369/3 "2023-07-14T12:21:06Z")

</div>

> [@Robbie.Wozencroft](#):
>
> use a PLC tag to change a window on a project on Ignition?

Yeah, don't. This is an anti-pattern that will cause you much grief, since it typically requires considerable effort to confine to the one client instance that should respond, and makes working in the designer difficult.

This pattern comes from the ideas and typical requirements of a single, tightly integrated on-machine HMI, where there's no concept of "scope" as used in Ignition. Don't do it.

{ I adjusted your topic tags to include Vision, as `system.nav.*` is Vision-only. The link to `system.perspective.navigate()` is not applicable. }

---

<div class="post-metadata">

**Author:** ![Robbie.Wozencroft](https://avatars.discourse-cdn.com/v4/letter/r/b3f665/32.png) [@Robbie.Wozencroft](https://forum.inductiveautomation.com/u/Robbie.Wozencroft)\
**Post date:** [July 14, 2023, 1:58pm UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369/4 "2023-07-14T13:58:20Z")

</div>

What I'm working on is a dedicated project and only one user. Does that still make it a no go? @pturmel

---

<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:** [July 14, 2023, 2:05pm UTC](https://forum.inductiveautomation.com/t/plc-tag-that-selects-ignition-window/76369/5 "2023-07-14T14:05:32Z")

</div>

Not really "no go", but a "do you really need this?"

If you must, within the client tag change script, include a check for the specific client's MAC ID, or something else unique, and only perform the navigation if it matches. That'll keep your designer from firing on it while in preview mode.

You can perform that MAC ID check once in a client startup event and save the result to a client tag (if you have other things that should be limited to that one client). See this topic for a method:

> [@Mobile Client MAC Address](https://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/10):
>
> In a real Vision client, you can obtain the local MAC addresses with the following script: from java.net import NetworkInterface # Get list of local mac address as strings def myMacIds(): macs = [ni.hardwareAddress for ni in NetworkInterface.getNetworkInterfaces() if ni.hardwareAddress] return [":".join(["%02x" % (b & 0xff) for b in mac]) for mac in macs] Also, again in a real Vision client, you can obtain the outbound network interface and the corresponding local IP address the clien…
