08-21-2016 07:40 PM - edited 08-21-2016 07:44 PM
I have several .vit in my project to be opened asynchronously. I noticed that in development environment, it took significantly longer time to open a reference when those .vit front panels were not already loaded. For example, it took 7s for node Open VI reference to finish vs 900ms if the vit front panel was already open.
Here is how I benchmark the time it took for Open VI Ref to process:
Reading the forum, there were several reported topics but they were quite old. I am using Labview 2015 32 bit. I haven't technically benchmark the time in executable environment but I recall it couldn't be no where near 7s to load a vit of size 500KB.
Tests for several different .vit yielded similar results, the time to load depended on the complexity and size of the vits. But complexity and code size shouldn't matter, should it ? I was just opening a ref, haven't got to the VI Run node yet. What could cause this issue and how do I fix it ?
By the way, during this 'load time' the entire LV project environment seemed to hang and went into spinning wheel mode. Other running VI also paused and only resumed the loading finished.
Solved! Go to Solution.
08-21-2016 08:04 PM
@zigbee1 wrote:I have several .vit in my project to be opened asynchronously. I noticed that in development environment, it took significantly longer time to open a reference when those .vit front panels were not already loaded. For example, it took 7s for node Open VI reference to finish vs 900ms if the vit front panel was already open.
When you open a reference to a VI, that VI has to be in memory. If it isn't, then it must be loaded. So it makes perfect sense that it should take longer to load a VI that was not already open. But your times seem extreme. How large are these VIs? And yes, larger VIs will take longer to load.
08-21-2016 09:06 PM
The vit that took 7s to load was 500Kb. Smaller vit loaded faster but still they can't possibly take so much time to load.
08-21-2016 09:07 PM
Was the VI being loaded saved in an older version of LabVIEW so that the load time is increased because it needs to recompile it for the version of LabVIEW you are now opening it in?
08-21-2016 09:15 PM
Good point but nope, source version is 15, it is what I have in development environment.
08-21-2016 09:17 PM
Using Static VI References (instead of VITs) makes starting asynchronous VIs essentially immediate. Another virtue of Static VI References is that the same code works in Development and Executable versions.
Bob Schor
08-22-2016 04:20 AM
Open VI reference function has options input. For opening original template VI, we need to select option 0*02. If you do not select this option flag, LabVIEW opens a new instance of the template VI. Edits made to an instance do not affect the original .vit file. This option flag has no effect on non-template files.
Maybe this has some effect on timing.
08-22-2016 05:19 AM
Do you have any xcontrols in the vi?
08-22-2016 10:25 AM
Hello, I don't have any Xcontrols in the template. And I have always had these template to spawn clones (suffix numeric to template vi's name). That way i can strack how many instances were alive. I tried several options including 0x80,...etc but observed no difference. I can confirm there was no lag when running the executable.
08-22-2016 07:49 PM
Just for fun, try saving the VIT as a VI. It sticks in the back of my mind that VITs take longer to load for some reason. I do not remember any details.