Refresh Vision Client from script

Can I create a script to refresh the client based on a tag or property change?

This may not be the conventional way to do things, however on my system we have a Vision project for each Operation Station. The projects use docked windows to show relevant part information based on the components required at each station.

This can lead to gaps in the display. I have tried using expression binding in the Docked Index property to change the Index number of the window based on the part requirements. I can see the value change in my designer based on the expression however the client window only refreshes if the screen is touched.

I’ve only seen that sort of behavior from screen-savers and power savers. Check your power profile in your OS.

Power settings are all set to never sleep, never idle, never shut off. All power settings are set to highest performance now. Still having the same behavior.

The OS is windows 10.

Still having the issue. Is there a way to simulate a mouse client on the client to cause the screen to refresh?

There is the java robot which lets your programatically move the mouse or type on the keyboard etc.

Only works with vision so you are in luck.

import java.awt.Robot

ROBOT_DELAY_MS = 1000

rob = java.awt.Robot()
rob.delay(ROBOT_DELAY_MS)

x=100
y=100
rob.mouseMove(x, y)

Maybe run this in a client timer script - check if client inactivity is over a certain amount, and if so, move to some randomly generated x/y coordinate. Check for inactivity because otherwise you may just move the mouse while a person is using it.

Thank you for this, I applied it to a client event tag change, using the tags that I am looking at in my expression for the dock position. It appears to have worked. I will have to keep an eye on it and try it out in a few more areas.

This did not work. I could see my mouse moving when testing the client on my computer however to actually get the screen to refresh I would have to scroll the page. So I tried this:

from java.awt import Robot
from java.awt.event import KeyEvent

ROBOT_DELAY_MS = 500

rob = java.awt.Robot()
rob.delay(ROBOT_DELAY_MS)


rob.keyPress(KeyEvent.VK_PAGE_DOWN)
rob.delay(ROBOT_DELAY_MS)
rob.keyRelease(KeyEvent.VK_PAGE_DOWN)
rob.delay(ROBOT_DELAY_MS)
rob.keyPress(KeyEvent.VK_PAGE_UP)
rob.delay(ROBOT_DELAY_MS)
rob.keyRelease(KeyEvent.VK_PAGE_UP)

This works in the script console. But does not work on my client. They client computers are touchscreens. I’m now trying to find a function for scrolling a touchscreen down then back up.

I really think you should dig deeper in the OS for a screen power saving options. Those require actual OS-level user interaction, or a remote action that ties in at the OS level. Robot wouldn’t.

As a test, add VNC to a sample and see if that can make the screen wake up.