Switch Displayed Windows Automatically

I have searched about everything I could think of how to phrase this, and can not find it. Someone has to have done this, or maybe it’s so easy and I’m too ignorant…
Anyhow, is there a way to have 2 or 3+ windows automatically switch on a displayed system.
I am putting a monitor up in one of the departments and have a couple screens i would like the monitor to display, but can not find how to do this.
Link or direction would be appreciated

Thanks!

I’ve done something similar with a client timer script to check when a client is inactive for a specific amount of time and then start cycling through different screens. You could probably use the following code (modified of course) to do what you want to do.

**Note: You will have to create a client tag to store the window rotation number in, in this example it’s just called Rotation.

name = system.security.getUsername() if name.lower() == 'userName': if system.util.getInactivitySeconds() > 60: tagPath = "[Client]Rotation" windows = ["path/to/window1", "path/to/window2", "path/to/window3"] x = system.tag.read(tagPath).value%len(windows) system.nav.swapTo(windows[x]) system.tag.write(tagPath, x+1)

That looks awesome, but i guess i am doing something wrong.
My understanding:
Created a client tag called “rotation”, Int4, and that is all good. This is where the the expression will move the value for the “tagPath”.
Then created another Client tag named “IdleTime”, now here is where my reading about client scopes may have run afoul,
I understand it as this tag will execute whenever a client has any window open, it being ran on the client PC not the Gateway, then, if the client is idle for the set amount of time (60 seconds) it should start rotating every 60 seconds to the next window in the list (ex. “Windows/Screen1”, "Windows/Screen2… etc) and then cycle back to the original screen and keep repeating to client is again active.
Just copied and pasted the script you gave and made modifications to “path/to/windows1” examples and now have the dreaded “red X” which i have seen plenty in my learning of this process

Thanks for the help and more, would be again, much appreciated

Here’s a couple for you… :wink:

http://inductiveautomation.com/forum/viewtopic.php?f=70&t=7779

http://inductiveautomation.com/forum/viewtopic.php?f=70&t=11171

You shouldn’t need that… unless you want to have a variable idle time that you want to check against.

The first part of this statement is true, the second is not. It will rotate at whatever time you have the client timer script set to run at. Maybe I didn’t explain correctly, this code is inside of a client timer script so it’s always running at whatever time delay you have the timer script set for.

Are there any specific errors that accompany the red X that may be helpful for troubleshooting?

Thanks for the extra forum post links Jordan, I knew they were in there somewhere (that’s where I “borrowed” some of my code from). :stuck_out_tongue:

Been bouncing shifts so i have not had a chance to get to work on this much, but have been reading.
I used the script exactly as Duffanator had suggested with these mods:
windows = [“Windows/DI Running”, “Windows/DITrend”]

Under the “Project Browser/Configuration/Event Scripts (Client)” i added a “Client Timer Script” called DIMonitor@1000ms and this is where i inserted the script

My understanding is this should be loaded onto the User’s machine each time they access the application, the after the user has been idle for 60 seconds, the system should toggle/rotate their screen between the DI Running screen and then the DITrend screen, but it doesn’t

What part am i skipping/missing/can’t undestand

Thanks

Did you still include the username check part of the script?

name = system.security.getUsername() if name.lower() == 'userName':

I put this in because I only wanted the rotation to work for a specific user and I changed the username to userName in this code just for a placeholder. If you want the rotation to work for any user then just get rid of this code or put the specific username in that you want the rotation to work for.

Other than that everything you explained sounds correct. Just another note though, you say that you have the script set to run every 1000 ms, be aware that when the script does start rotating the screens they will rotate every second, which is probably not what you want. The time between rotation is determined by the script delay time.

EXCELLENT!!! YOU RULE!

I took out the Username code as you suggested and Whalla!

Now for the really beginner question! How do I find who is logged in and under what username?
if I look in the SQL Tags Browser, under System/Client/User I see OSUsername (it has my name) and under the tag Username it list admin. How do I find who is currently online so that I can put their userName into this script and limit the switching screens just to them?

Thanks Again