# Vision Screen Refresh

**URL:** <https://forum.inductiveautomation.com/t/vision-screen-refresh/77928>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [August 16, 2023, 12:20pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928 "2023-08-16T12:20:39Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 16, 2023, 12:20pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/1 "2023-08-16T12:20:39Z")

</div>

Looking to do a screen refresh every 10 minutes on a vision screen. Any suggestions on how to accomplish this via script?

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 16, 2023, 12:23pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/2 "2023-08-16T12:23:36Z")

</div>

Refresh what exactly? Component properties bound to tags should update on their own. Component properties set to SQL bindings/Named Queries can be set to polling or manually refreshed with a `system.db.refresh`. What is not refreshing on your window currently?

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 16, 2023, 12:24pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/3 "2023-08-16T12:24:34Z")

</div>

I just want the entire vision screen to refresh. I have a couple cameras that will time out and if I refresh, they come back.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 16, 2023, 12:27pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/4 "2023-08-16T12:27:42Z")

</div>

Ah ok. I don't know much about the video component. When you refresh you mean you exit the window and come back or do you just move the mouse?

I think you can leverage [system.util.getInactivitySeconds](https://docs.inductiveautomation.com/display/DOC81/system.util.getInactivitySeconds) inside a client timer script that runs once a minute, and if inactivity is greater than 10 minutes, either programmatically move a mouse or close and re-open the window

There are probably better ways to refresh that component directly someone else where probably knows.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 16, 2023, 12:29pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/5 "2023-08-16T12:29:29Z")

</div>

Correct, exit the screen. So really just looking how to make a script to close screen and reopen every 10-15 minutes actually.

---

<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:** [August 16, 2023, 12:41pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/6 "2023-08-16T12:41:42Z")

</div>

You probably want to reload the IP Camera Viewer URL when the stream stops. I show a hacky method to do this in [my Image Streamer module's documentation](https://www.automation-pros.com/streamer/doc/).

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 16, 2023, 12:42pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/7 "2023-08-16T12:42:40Z")

</div>

Cool. I am using VLC to convert, and it works great just looking to refresh every so often.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 17, 2023, 4:44pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/8 "2023-08-17T16:44:43Z")

</div>

I took a look at your documentation. Where is that at? On the screen now I show SocketException: ConnectionReset. I did try to refresh the cameras and that did not make them show up on the screen. I physically had to close the window and reopen. So really looking to run a script that just does either a window refresh or close and reopen every so often.

---

<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:** [August 17, 2023, 4:56pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/9 "2023-08-17T16:56:33Z")

</div>

At the bottom of the linked documentation, in the usage notes, there is a link to my `ipcamera.py` script that, with help from my Simulation Aids module, can restart the IP Camera Viewer component.

That script has comments describing how to use it. If you don't want to use Simulation Aids, the techniques shown in that script could be reworked into a timer component or a regularly-occurring property change event.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 17, 2023, 5:01pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/10 "2023-08-17T17:01:28Z")

</div>

Cool. Thanks for the information. I just refreshed the url and it didn't work but closing the screen and opening back up did so I think I will have to figure out a script to just do a window refresh.

---

<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:** [August 17, 2023, 5:04pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/11 "2023-08-17T17:04:51Z")

</div>

> [@Schwartzds](#):
>
> do a window refresh.

Not necessary if you use the script function with `objectScript()` as shown in its comments.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 18, 2023, 3:11am UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/12 "2023-08-18T03:11:05Z")

</div>

Thanks but just a little lost on where to do this.

---

<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:** [August 18, 2023, 12:07pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/13 "2023-08-18T12:07:18Z")

</div>

The script has:

```auto
# Use as a binding expression (on a boolean property) in the IP Camera Viewer like so:
# objectScript("shared.ipcamera.stateCheck(binding.target)", now(1000))

```

Paste the whole script into a project library script module. I recommend calling it `ipcamera`, but that's up to you.

Attach an expression binding to one of the boolean config properties of the IP Camera Viewer component. (Pick one that you want to be turned on as a side effect.) Paste that `objectScript(...)` expression into that binding. Adjust `shared.ipcamera` to the actual library script name you used.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 18, 2023, 3:41pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/14 "2023-08-18T15:41:32Z")

</div>

Thanks, will try that. Still feel lost on what and where to do but appreciate all of your help.

---

<div class="post-metadata">

**Author:** ![Schwartzds](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/schwartzds/32/6777_2.png) [@Schwartzds](https://forum.inductiveautomation.com/u/Schwartzds)\
**Post date:** [August 21, 2023, 3:09pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/15 "2023-08-21T15:09:11Z")

</div>

Tried and it still comes up SocketException. Any other ideas/suggestions?

---

<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:** [August 21, 2023, 3:13pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/16 "2023-08-21T15:13:29Z")

</div>

Use my module instead of VLC, perhaps. Maybe add various delays into the restart logic.

---

<div class="post-metadata">

**Author:** ![andy1](https://avatars.discourse-cdn.com/v4/letter/a/a8b319/32.png) [@andy1](https://forum.inductiveautomation.com/u/andy1)\
**Post date:** [June 4, 2024, 7:31pm UTC](https://forum.inductiveautomation.com/t/vision-screen-refresh/77928/17 "2024-06-04T19:31:39Z")

</div>

Old thread. I wanted to do the same thing. The IP address of my camera was something like 192.168.1.60/iliveimage.jpg. But, 192.168.1.60/iliveimage.jpg?reload=1 works too, and adding adding a ?reload=1 should still work for you too. Then switch the URL to an expression, something like this "[http://192.168.1.60/iliveimage.jpg?reload=](http://192.168.1.60/iliveimage.jpg?reload=)" + toStr(dateExtract(now(),"minute")) Which will refresh the stream every minute.
