Preload Screens on client Start up

Is there a way to pre-load the screens (“windows”) during the client startup. The client starts up quickly, but when navigating to a screen it takes several seconds to load the screen, and there are many red boxes. After the first time loading the screen, the screen loads very quickly if you navigate away and then back to it.

Well, you can have multiple screens open on startup and on a startup script you can close the ones you don’t need. As long as the windows cache mode is set to Auto or Always it will be quick to open it up the second time. The only thing here is that it will take a few more seconds to start up initially after login.

I attempted to do this and it crashed JavaSE. Here is what I did:

In the client startup script I put in the following:

windows = system.gui.getWindowNames() for path in windows: if (name!='Header') and (name!='Footer'): system.nav.closeWindow(path)

In the project I have all the windows that need to be pre-loaded set to “open on startup”. This script should close all the windows with the exception of the Header and Footer windows. Am I doing something wrong? I got the structure of the code from the sample located in the manual for system.gui.getWindowNames.

It probably crashed because the script uses a variable called “name” when the variable is really called “path”. Seems odd that this would “crash” the whole system – is that what you’re describing?

Anyhow, the code wouldn’t have worked anyway because the client startup script runs before the windows open. You might simply try putting a delay on that code via an invokeLater(). For example

def closeUnwanted(): import system windows = system.gui.getWindowNames() for path in windows: if (path!='Header') and (path!='Footer'): system.nav.closeWindow(path) system.util.invokeLater(closeUnwanted, 1000)

Yes, the name variable didn’t look correct, but the manual shows that as an example.

I tried your script and I get the same issue. What occurs is that the client will load up, but it completely freezes. I have to go into the program manager to force is to shutdown.

I did some more testing and the issue is not truly JavaSE freezing, but rather the system is taking so long to load the 16 windows that I need preloaded that it appears to be frozen. I am okay with the startup taking a long time, but the issue is that the rotating circle shown in the top right corner disappears before everything is loaded making it appear that the HMI is up and running. However, the client is still attempting to render all the screens and then close them. If I wait for a long period of time I finally see the loaded screens get closed.

The implementation seems clunky and I generally don’t like depending on timing for doing something like this. I would prefer that the system could pre-load the 16 windows on startup and not continue until all the windows have been cached and then closed.

I need help, the delays in loading and the appearance that a window is loaded, when it isn’t, is causing all kinds of confusion.

Well sure. What you're trying to do is a hack - the system wasn't design with this in mind

This isn't a complaint I hear very frequently. Perhaps there is something about the design of your windows that exacerbates the window loading time? Maybe you could describe them?

That said, we are aware that window loading speed isn't exactly stellar. We have a plan to make it faster, but we haven't had a chance to implement it yet. I used to hear these complaints more frequently, but since the last big speedup (a few years ago) they've become more infrequent.

I will try and describe this better:
When I startup the client everything loads and it appears that the HMI is up and running. When the operator presses on a navigation button the screen is loaded but all the graphics on the screen are showing boxes with a light white transparent color. The box has a tag symbol with a green question mark in the top left corner. We only see this when we load a screen the first time. After it is initially loaded we can close it and navigate back to it and it loads instantly. We have timed the screen loading and we have had some screen take up to 11 seconds to load. Some of the screens have no complex images on them and they also take several seconds to load.
Some of the screens don’t show the tag with the green question mark and they have numeric entry components. The operator presses on the numeric entry and nothing happens. They get very frustrated and then it finally pops up the numeric entry.
The clients are running on Windows7 dual core processors with 4GB memory. Nothing else is running on these computers. I have four clients, but I am only testing one client at this point.

I would be more than happy to send you my project for you to look at. If I am doing something stupid I would like to understand what it is.

It seems to me that fixing the 11 second load time on the screen is a better solution than attempting to preload every screen. Check out the simplest (slow) screens first. Do you have slow/complex queries running? Large images? Anything else suspicious?

Feel free to send in the project, along with the names of some of the worst offending windows, and I’ll take a look and see if anything jumps out at me. 11 secs is a long time on a reasonably modern client - yours sound more than capable.

How should I get the project to you. It appears that I can’t send private attachments to you.

Thanks!

Upload the file to http://www.inductiveautomation.com/uploads with your username as the name and we will get it.

Has anyone had a chance to look at my project?

Yes I did - I sent you a PM, I think I need a full backup that includes the images in your Gateway.