09-22-2016 05:47 AM
Hi all,
I have created a LabVIEW executable and I would like to find how long the program takes to launch, meaning the time from double clicking the exe and the time when the program starts running. Is there any way to find it?
Thanks for the help in advance:)
Solved! Go to Solution.
09-22-2016 05:57 AM
After launching only LabVIEW has the control to calculate timing, any specific reason to do so?
Onething you can try is, Try to Launch the exe using Another VI and Poll for the Front Panel State whether its standard, so the time betwen command for launching to Frontpanel of the VI to set Standard is the time taken.
I too wishing to hear from others, anything available to do the same in simple method.
09-22-2016 06:13 AM
It starts running as soon as you click on the executable - so what do you mean? Do you want the time until the LabVIEW code starts running, the VI front panel appears or the program finishes initialisation?
LabVIEW can't know when you launched the executable - so your best bet would be to run the executable programmatically (e.g. from a batch file, or using system exec) and creating a timestamp. Your executable can then generate a timestamp at the point at which you want to define as 'running' and 'signal' it (e.g. writing the timestamp to a file, transmitting data such as TCP/IP/Shared variables etc.) and then subtract the two to get your launch time.
09-22-2016 08:04 AM
Are you wanting to measure this because you are seeing a long time between double clicking the file, and seeing the UI? This might be because as your application grows, more and more VIs need to be loaded into memory before the top level VI can start running. Even in source it takes a while to double click the project, wait for it to load, double click the main VI, and wait for it to load. It is the same with an EXE.
One thing you can do to try to make a better experience for the user, is make a splash screen, that gets ran immediatly, which loads other parts of the application dynamically, so the user at least has something to look at with maybe a progress bar and a cancel. There's lots of example of how to do this but I use a modified version of stuff I mentioned in a LAVA post. The basic idea is to break your application up into modules (or actors) then in the splash screen load each of them one at a time (updating a progress bar) and then load the main top level and run it. I know AQ had an example on how to do this with the Actor Framework and showed an example of it, but not everyone uses that.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord