# Creating a timed loop to show main windows

**URL:** <https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827>\
**Category:** Ignition\
**Created:** [October 31, 2017, 2:43pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827 "2017-10-31T14:43:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![santiago4ever72](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@santiago4ever72](https://forum.inductiveautomation.com/u/santiago4ever72)\
**Post date:** [October 31, 2017, 2:43pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/1 "2017-10-31T14:43:48Z")

</div>

Hello everyone, I wanted to know if it was possible to show the main windows in a loop and repeat the loop depending on the time in which each window has been shown. As if it were a presentation. This is because we want to display a timed loop of our main windows. If it is possible how could it be done? Any help would be greatly appreciated. Thanks in advance to the entire community here at the forum 🙂

---

<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:** [October 31, 2017, 3:49pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/2 "2017-10-31T15:49:39Z")

</div>

You’ll need a [client timer script](https://docs.inductiveautomation.com/display/DOC79/Timer+Scripts) and a known sequence of windows that you can use with [system.nav.swapTo](https://docs.inductiveautomation.com/display/DOC79/system.nav.swapTo).

---

<div class="post-metadata">

**Author:** ![santiago4ever72](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@santiago4ever72](https://forum.inductiveautomation.com/u/santiago4ever72)\
**Post date:** [November 2, 2017, 12:52pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/3 "2017-11-02T12:52:59Z")

</div>

Thank you so much for your help :D!

---

<div class="post-metadata">

**Author:** ![santiago4ever72](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@santiago4ever72](https://forum.inductiveautomation.com/u/santiago4ever72)\
**Post date:** [November 2, 2017, 1:33pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/4 "2017-11-02T13:33:50Z")

</div>

@paul-griffith Is there any way in which I can create a time delay say of 10 seconds by scripting?

I have this right now and it doesnt seem to be working:

system.nav.swapTo (’ X Line’) #switches to X Line window

time.sleep(10) # delays for 10 seconds.

system.nav.swapTo (’ Y Line’) #switches to Y Line window

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [November 2, 2017, 1:50pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/5 "2017-11-02T13:50:56Z")

</div>

`time.sleep(10)` will probably stop the GUI thread for 10 seconds (depending on the scope of the execution), so the first swap probably won’t be visible.

If you use a client timer script (as PGriffith said), or a [timer component](https://docs.inductiveautomation.com/display/DOC79/Timer), the thread keeps running and the GUI remains active.

Perhaps the timer component is easier for you. Just put such a component on every screen, and let it open the next screen after an initial delay.

---

<div class="post-metadata">

**Author:** ![santiago4ever72](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@santiago4ever72](https://forum.inductiveautomation.com/u/santiago4ever72)\
**Post date:** [November 2, 2017, 2:37pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/6 "2017-11-02T14:37:05Z")

</div>

@Sanderd17 I did try to use the timer component but one timer interfered with the other. Tried to synchronize them but eventually I found they interfered with each other.

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [November 2, 2017, 2:41pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/7 "2017-11-02T14:41:58Z")

</div>

Did you close the current window (via a swapTo f.e.)? Or did you just open new windows on top?

There are additional ways around it. Like checking the[current open window](https://docs.inductiveautomation.com/display/DOC79/system.nav.getCurrentWindow) before swapping it, or setting the “running” property of a timer to false.

---

<div class="post-metadata">

**Author:** ![santiago4ever72](https://avatars.discourse-cdn.com/v4/letter/s/45deac/32.png) [@santiago4ever72](https://forum.inductiveautomation.com/u/santiago4ever72)\
**Post date:** [November 2, 2017, 3:23pm UTC](https://forum.inductiveautomation.com/t/creating-a-timed-loop-to-show-main-windows/15827/8 "2017-11-02T15:23:24Z")

</div>

@Sanderd17 I did close by using a swapTo
