LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Why do I need to use Add Dynamic Vi?

If I use Open VI Reference with an absolute path to the Vi, why do some Vis load and others don't?  Everything works until I build an executable.  Loading small Vis work, but loading a Vi that has subVis and/or front panel controls doesn't.  I can't even get pass the "Open VI Reference" loading part. 

If I have to include the dynamic vi file in my executable, why make it dynamic in the 1st place?  I would like to have an executable that when I need to update something, not have to recompile the whole thing, just update the subVi and have it call that one.  Are there size limits as to what "Open VI Reference" can open?

Thanks


0 Kudos
Message 1 of 6
(3,000 Views)
To have the front panel of the VI you have to set its settings in the AB to keep the front panel. By default the FP is stripped for Dynamic VIs (depends of the version of LabVIEW).
If your dynamic VI calls VIs from vi.lib, the executable won't be able to load them because it is not aware of the location of the vi.lib folder. To dynamically load a VI without including it in the application, save the whole VI hierarchy into a new location (usually a LLB). Using Save with options, select Save for distribution.
That changes the location of the VI so you may then experience problems when using absolute paths. When calling a dynamic VI, use the Application.kind property to determine if the execution is from LabVIEW (development) or Application (Run-Time) to build the correct path to the Dynamic VI.


LabVIEW, C'est LabVIEW

0 Kudos
Message 2 of 6
(2,991 Views)
Thanks for the extremely quick reply!  I have all my Vis in a directory structure some times 2 levels deep, with the main Vi at the top of the directory.   Should I convert each directory into a llb?  I'm not sure how I can put all the Vis into one llb all at once.   Thanks for the help.

0 Kudos
Message 3 of 6
(2,972 Views)
If I put everything in a llb then when I need to update something on a production computer somewhere, I'll still need to send the entire llb.  I found that if I save all the dynamic vis as llb's using the save for distribution option it works.  That way I can update a singe Vi at a time, without rebuilding the main exe.

Thanks!

0 Kudos
Message 4 of 6
(2,941 Views)
That's exactly what Jean-Pierre told you to do. I think there was a misunderstanding about which VI to save into an llb. Since your main VI hierarchy is built into an exe file, there would be no reason to save it again into a separate llb.
0 Kudos
Message 5 of 6
(2,934 Views)
Right I guess I misunderstood.  Either way its great!  I haven't seen any documentation about this; not in the help files nor online.  Its seems like this work around should be documented somewhere...

I guess it is now.

0 Kudos
Message 6 of 6
(2,921 Views)