Changing screens based on PLC tag

viewtopic.php?f=70&t=9762&p=34061&hilit=tag+change+screen+change#p34061

This worked fine, in addition to the HMI they will now be launching a client from a laptop. Everytime the screen toggle PLC tag is changed it changes the screen on the project launched from laptop too. Is it possible to disable client scripts on one particular client? Basically the issue is the PLC screen toggle tag changes the screen on any clients that are open…
Thanks in advance!

[quote=“rcorkern”]http://www.inductiveautomation.com/forum/viewtopic.php?f=70&t=9762&p=34061&hilit=tag+change+screen+change#p34061

This worked fine, in addition to the HMI they will now be launching a client from a laptop. Everytime the screen toggle PLC tag is changed it changes the screen on the project launched from laptop too. Is it possible to disable client scripts on one particular client? Basically the issue is the PLC screen toggle tag changes the screen on any clients that are open…
Thanks in advance![/quote]

assign the laptop a special login, then grab the current user logged in, and change your script to also look at the username in the if statement. something liek this

system.tag.write("[Client]inactivity", 30) value = system.tag.read('test1').value user = system.tag.getTagValue('[System]Client/User/Username') if user == 'laptop' and value==1: system.nav.swapTo('Display 1') elif user == 'laptop' and value==2: system.nav.swapTo('Display 2') elif user == 'laptop' and value==3: system.nav.swapTo('Display 3')

ok. I forgot to mention that this project is set to autologin…which is set in the project itself… any idea how to accomplish that even though it’s needs to autologin from the HMI? can we prompt for credentials if launching not from the HMI (ip address)?

use the computer name

from java.net import InetAddress
nodename = InetAddress.getLocalHost().getHostName() 
system.tag.write("[Client]inactivity", 30)
value = system.tag.read('test1').value
if nodename == 'laptop' and value==1:
   system.nav.swapTo('Display 1')
elif nodename == 'laptop' and value==2:
   system.nav.swapTo('Display 2')
elif nodename == 'laptop' and value==3:
   system.nav.swapTo('Display 3')

awesome! worked great thank you!!