LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamically and directly calling sub vi in Built version

I have previously used the Application Builder to compile a labview main file that has several sub vis within it. Recently I had to change one of those sub vis such that it could be dynamically launched from the main vi. I made the necessary changes in my build process, compiled and installed it, and everything worked. Problems ocurred, however, in other parts of the main code that were directly (not dynamically) calling the sub vi that I had made dynamic. The parts of the main vi that directly call this sub vi wanted me to locate it within the file structure. After I browsed to it and found it the code continued on and executed properly. I can't have my end user finding the file however. Has anyone been here before? It seems to boil down to a problem of having the Application Builder build a vi that can both dynamically and directly call a sub vi.
0 Kudos
Message 1 of 2
(2,419 Views)
I guess the biggest question is why you would call the same subVI both statically and dynamically from the same VI. Calling a subVI statically would defeat any advantage that calling the subVI dynamically could give you, so it doesn't make much sense to mix them together. With that issue aside, you should still be able call the same subVI both statically and dynamically, but with one caveat. Dynamic calls should be made with the Call By Reference node and not by invoking the Run VI method. A discussion of this topic can be found here.

However, the trouble you are encountering (of the subVI not being found) is really an unrelated issue to the static/dynamic dilemma; it is more indicative of faulty file structure. Make sure that all of the relative file paths to your subVI are correct. A commmon mistake in this area is explained here.

Regards,

E. Sulzer
Applications Engineer
National Instruments
E. Sulzer
Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(2,398 Views)