# Change Page Automatically Every 30 Seconds

**URL:** <https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [January 3, 2023, 8:42am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150 "2023-01-03T08:42:59Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![batuhan.parlakay](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@batuhan.parlakay](https://forum.inductiveautomation.com/u/batuhan.parlakay)\
**Post date:** [January 3, 2023, 8:42am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/1 "2023-01-03T08:42:59Z")

</div>

Hello

I want to switch a page every 30 seconds while the project is running in runtime.  
So let it automatically switch between pages.  
Is something like this possible ?

Thank you.

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 3, 2023, 9:05am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/2 "2023-01-03T09:05:49Z")

</div>

Vision or Perspective ?

Should the page switch be synchronized between all open clients (ie: show everyone the same page at the same time) ?

---

<div class="post-metadata">

**Author:** ![batuhan.parlakay](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@batuhan.parlakay](https://forum.inductiveautomation.com/u/batuhan.parlakay)\
**Post date:** [January 3, 2023, 9:23am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/3 "2023-01-03T09:23:06Z")

</div>

Yes, All open client show everyone the same page at the same time. I want to do it in vision

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 3, 2023, 11:18am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/4 "2023-01-03T11:18:52Z")

</div>

- make an expression tag that toggles every 30 seconds. Using the gateway time ensures the same toggle across all connections. Specifying `[System]Gateway/CurrentDateTime` lets it work regardless if you use a client tag or gateway tag.  
`floor(getSecond({[System]Gateway/CurrentDateTime})/30) `

- Create a tag that stores the pointer value of the screen you wish to display.

- Use a[client tag change event script](https://docs.inductiveautomation.com/display/DOC81/Client+Event+Scripts#ClientEventScripts-TagChangeScripts), triggering on the expression tag you just made:

```python
windowPaths = [
			   'path/to/screen 1',
			   'path/to/screen 2',
			   'path/to/screen 3',
			   'path/to/screen 4',
			   'path/to/screen 5'
			  ]

pointerTag = ['[default]path/to/pointer/tag']
pointer = system.tag.readblocking(pointerTag)[0].value + 1

if pointer >= len(windowPaths):
	pointer = 0

system.nav.swapTo(windowPaths[pointer])
system.tag.writeBlocking(pointerTag, [pointer])

```

---

<div class="post-metadata">

**Author:** ![batuhan.parlakay](https://avatars.discourse-cdn.com/v4/letter/b/22d042/32.png) [@batuhan.parlakay](https://forum.inductiveautomation.com/u/batuhan.parlakay)\
**Post date:** [January 4, 2023, 7:30am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/5 "2023-01-04T07:30:29Z")

</div>

Everything is very understandable, thank you .

I just didn't quite understand how to open the page.

"system.nav.swapTo(windowPaths(pointer))"

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 4, 2023, 8:22am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/6 "2023-01-04T08:22:50Z")

</div>

> [@batuhan.parlakay](#):
>
> I just didn't quite understand how to open the page.
> 
> "system.nav.swapTo(windowPaths(pointer))"

It looks like a typo. It should probably be `system.nav.swapTo(windowPaths[pointer])`

windowPaths is a list of paths, and pointer is the integer that selects a specific path from the list.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 4, 2023, 11:32am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/7 "2023-01-04T11:32:48Z")

</div>

> [@JordanCClark](#):
>
> ```python
> pointer = system.tag.readblocking(pointerTag)[0].value + 1
> 
> if pointer >= len(windowPaths):
> pointer = 0
> 
> ```

Why not just

```python
pointer = system.tag.readblocking(pointerTag)[0].value + 1
pointer = pointer % len(windowPaths) #edited from len - 1

```

😜

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 4, 2023, 11:35am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/8 "2023-01-04T11:35:55Z")

</div>

Because I started with BASIC back in the 1980s. 😉

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 4, 2023, 11:37am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/9 "2023-01-04T11:37:21Z")

</div>

> [@justinedwards.jle](#):
>
> It looks like a typo.

Not only does it look like a typo, it, in fact, is one. Thanks for the catch. Fixed.

---

<div class="post-metadata">

**Author:** ![zxcslo](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/zxcslo/32/61610_2.png) [@zxcslo](https://forum.inductiveautomation.com/u/zxcslo)\
**Post date:** [January 4, 2023, 1:19pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/10 "2023-01-04T13:19:54Z")

</div>

1982, with ZX Spectrum and Comodore64...

---

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [January 4, 2023, 1:24pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/11 "2023-01-04T13:24:58Z")

</div>

> [@zxcslo](#):
>
> Comodore64

A Comodore 128 and a stack of Commodore magazines for me. I believe it was followed by some flavor of 286  
[gorillas.bas]

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 4, 2023, 2:26pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/12 "2023-01-04T14:26:43Z")

</div>

Is this a dinosaurs gathering of some kind ?  
You (old) people were coding before I was even born !

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [January 4, 2023, 2:28pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/13 "2023-01-04T14:28:17Z")

</div>

> [@pascal.fragnoud](#):
>
> You (old) people

I prefer to think of us as 'seasoned citizens'.

---

<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:** [January 4, 2023, 2:39pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/14 "2023-01-04T14:39:49Z")

</div>

> [@pascal.fragnoud](#):
>
> You (old) people were coding before I was even born !

Heh. I suspect my son (also a EE, but not interested in coding) is older than many of you (32) .

As for me:

1978, HeathKit H-8, 8080 machine language via its octal keypad and readout. Moved up to integer BASIC (no strings) on a dumb terminal soon after.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 4, 2023, 7:32pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/15 "2023-01-04T19:32:00Z")

</div>

> [@pturmel](#):
>
> is older than many of you (32)

Pft, I'm way older than that! I'm 35 or 36; I'm so old that I can't remember 😄

---

<div class="post-metadata">

**Author:** ![Adriaan.leRoux](https://avatars.discourse-cdn.com/v4/letter/a/bbce88/32.png) [@Adriaan.leRoux](https://forum.inductiveautomation.com/u/Adriaan.leRoux)\
**Post date:** [January 5, 2023, 6:57am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/16 "2023-01-05T06:57:37Z")

</div>

Nibbles

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [January 5, 2023, 8:49am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/17 "2023-01-05T08:49:41Z")

</div>

86 ?  
Also, always wanted to ask... any relation to [this other australian Minchin dude](https://en.wikipedia.org/wiki/Tim_Minchin) ?

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 5, 2023, 9:50am UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/18 "2023-01-05T09:50:34Z")

</div>

I think I'm related, some distant cousin or something. I'm sure my dad or uncle know. We have a book of Minchins somewhere haha

---

<div class="post-metadata">

**Author:** ![michael.ruel](https://avatars.discourse-cdn.com/v4/letter/m/ecd19e/32.png) [@michael.ruel](https://forum.inductiveautomation.com/u/michael.ruel)\
**Post date:** [January 6, 2023, 3:02pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/19 "2023-01-06T15:02:55Z")

</div>

I think the -1 in the mod is incorrect and there shouldn't be any modifier. Once your at index 3 in the list you'll go to index 0 instead of the last window in the list. `pointer = pointer % len(windows)` works. Just wanted to clarify in case someone sees it and tries to use it.

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [January 6, 2023, 4:20pm UTC](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150/20 "2023-01-06T16:20:56Z")

</div>

Oops, yes, you're right. I had that originally but "incorrected" it later 😕 I'll fix my reply, cheers

[Next page](https://forum.inductiveautomation.com/t/change-page-automatically-every-30-seconds/68150.md?page=2)
