LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Delay in Application Front Panel getting opened

Hi All,

 

I have a application(25MB in size) which when I launch takes some time to show its UI. I am not able to find the reason. Please suggest why there is a delay before the UI opens and how to fix that.

 

PS: In this application,I am using many property nodes, loading many subpanels.

 

Thanks in Advance,

Sree

0 Kudos
Message 1 of 9
(5,218 Views)

It is going to take a couple seconds to initialize all of your controls with property nodes and load subpanels. This is why many programs have a splash screen, just an image that can pop up quickly to tell the user "your click has been received, the program is initializing".

0 Kudos
Message 2 of 9
(5,194 Views)

Is your main VI set to open when called or are you manually opening your front panel after some UI initialisation? When your application loads, it takes a while to initialise/load/run the various SubVIs and allocate memory etc.

 

Here are some things you can do in addition to the splash screen suggestion that gregoryj made:

- There may be some parts of your initialisation that could run in parallel to speed up the startup time - without seeing any of your code it's impossible to tell

- If you have some non-reentrant VIs which take a while to run, could you make them reentrant so the calls are not blocking each other

- You could think about dynamically loading certain parts of your application - have the main UI start first and then dynamically load/run some of the modules afterwards

 

There may be other solutions - but without seeing your code/project it's difficult to tell - it could be something really simple.

 

I have an application that's about 16MB in size - it takes under 4s to show the front panel, if that gives you any sort of idea for comparison.

 


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 3 of 9
(5,185 Views)

Thank You gregoryj and Sam_Sharp,

 

As gregoryj suggested I used a splash screen and have set it modal but that inturn had a flickering effect(ie. Initially the window was opening noramally and after a second it closes and opens modally).

 

Then I tried removing the startup VI from the library that holds the Main VI that I was opening before directly and added it directly under my project. This seemed to fix the flickering issue. I assume this was happening because the entire library was getting loaded when calling the startup VI which caused a small delay before the front panel properties are actually set. Please correct me if my assumption is wrong.

 

To answer Sam_Sharp's question, I have set all the properties in the VI Properties window and not handling it programmatically and have also made other modules to launch dynamically. 

 

Regards,

Sree

Message 4 of 9
(5,145 Views)

So when you load your project, and open your main VI how long does it take to load the front panel and show it?  I'm guessing a long time.  The time that it takes is because when you load the main VI you also need to load all the dependencies of the project, which for you is probably several thousand VIs.  This load is a little fast in an EXE because the block diagrams and most of the front panels are removed but the concept is the same in an EXE.  As soon as you open the main VI it needs to load all the dependencies.  So how do you get around this?  Well you make a splash screen, that doesn't have the main VI as a direct dependency.  Then the splash screen loads quickly, then it dynamically loads the main VI, which may take some time but at least the user sees something.  Here is some discussion on LAVA.

 

https://lavag.org/topic/13986-splash-screens-and-dynamic-loading/

 

I think the Actor Framework has something like this built in now.

 

As for my solution, that I posted on page 3 of that thread.  It has a spash screen VI that loads with no dependencies (or few).  Then it loads each actor one at a time with a progress bar showing each actor loading.  Then after all actors are in memory (but not running) it loads the main VI.  This should be relativly quick because all the actors are already in memory.  Then the main VI is ran, and the splash screen is hidden.

Message 5 of 9
(5,121 Views)

Thank You Hooovahh,

 

Your explanation on loading was very helpful. My main VI takes less than 10s to load, but sometimes I get a deployment status as attached below when running the VI. 

 

Regards,

Sree.

0 Kudos
Message 6 of 9
(5,068 Views)

Some times other processes need to be deployed.  If you have a RT component then that RT EXE needs to be deployed to the RT target.  Web services is another thing that needs to be deployed, and there are others.

Message 7 of 9
(5,036 Views)

Thank You Hooovahh

0 Kudos
Message 8 of 9
(4,997 Views)

Thanks are given with kudos, and marking solutions when appropriate.

 

https://decibel.ni.com/content/docs/DOC-40451

0 Kudos
Message 9 of 9
(4,885 Views)