LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

build including high number of subVI

Good morning,

I would like to build my application, but it uses a lot of subVi and some llb in user library. I cannot find a way to make the builder attach all the subVI needed and I would like to avoid to have to add separately several hundred of subVI! So is there a way to add a whole llb or a whole directory with VI recognise properly (which is not the case of add directory content implemented in the builder)
thanks in advance
0 Kudos
Message 1 of 11
(3,318 Views)

Hi,

I have built applications with more than 300 sub VI's ( currently using labVIEW 7.1)

All i do is select the Main VI and all the Sub Vi's( even those in user library) get added by themselves.\

if there are any addon /support files that my application needs, i add them.

Thats it.

are you doing anything different?

Regards

Dev

 

 

 

0 Kudos
Message 2 of 11
(3,310 Views)
If you are calling VIs dynamically, they won't be automatically included in the build. To include them, you can create a VI which will call all of them (make sure that VI doesn't run) and include that VI in the build. This will add all those VIs. Note that in LV 8, if you have a piece of code which is hardwired not to execute, it will not be included in the build.

___________________
Try to take over the world!
0 Kudos
Message 3 of 11
(3,304 Views)
Thanks for your quick answer!
the point is I have main.VI that call a SubMain.VI dynamically (through VI server; this is a trick to force to execute afxOleInit before loading the dll of the SubMain.VI, which is required by a hardware driver). So If I had subMain.Vi as top-level VI, it is opened at the same time as Main.VI! and of course SubMain.VI contains all the call (normal way) to subVIs! So I cannot add SubMain.VI as a top-level VI! And if I remove it, the builder remove also all the dependent subVIs! Can I add a dynamic SubVi with all its "SubSubVIs"?
Thanks in advance
0 Kudos
Message 4 of 11
(3,291 Views)

I didn't say you should add it as a top level VI, but that you put in some VI where it won't run, but will be loaded into memory.

It looks like if you add a VI dynamically, its subVIs (not the dynamically called ones) are also included in the build.


___________________
Try to take over the world!
0 Kudos
Message 5 of 11
(3,274 Views)
Hi,

I do understand, but if I add the SubMain.Vi (see my previous message) as a SubVi in Main.VI (even in a non executed part!), it will be loaded with its dll at the time of loading of Main.VI, won't it? So I will loose the tricky thing using the VI server that loads the dlls of SubMain.VI after running afxoleinit in Main.VI! Maybe everything is not clear for me?
thanks in advance
0 Kudos
Message 6 of 11
(3,271 Views)

You're right, the DLL will be loaded when the VI is loaded, although I still don't understand what's the problem with loading the DLL into memory before.

In any case, like I said, it looks like you when you include a dynamic VI, its subVIs are included as well, so that should help you.


___________________
Try to take over the world!
0 Kudos
Message 7 of 11
(3,264 Views)
Sorry to hijack the post a little but here goes....Smiley Surprised

Do I understand correctly that calling a VI dynamically can control the loading of a DLL to a finer extent than in a static VI - Sub-VI manner?  Is it also possible to then unload the DLL by closing the VI which was opened dynamically (Assuming all DLL calls are within the dynamically called VI of course), or does LV hang onto the DLL "just in case".

This would be such a welcome opportunity to deal with some awkward DLLs I've been inflicted with.

Again, sorry for going slightly off-topic.

Shane.

PS Smiley Happy
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 8 of 11
(3,257 Views)
Well, I don't work with DLLs much, but the way I understand it, DLLs are loaded\unloaded when the VIs that call them are. This seems to be supported by petitprince's experience. Even if LV doesn't release the DLL once the dynamic VI is done, there is probably some windows API function which will allow you to explicitly do this.

___________________
Try to take over the world!
0 Kudos
Message 9 of 11
(3,245 Views)
I am not sure which version of LabVIEW you are using so the answer may change a little bit, but when you build the application you should be able to select Dynamic VIs.
 
In 7.1 you can add your Main VI as the top level, and then each dynamically called Top Level VI as dynamic VIs.
 
So if your main.vi calls dynamically subVI A and B, just include A and B as dynamic VIs.  LabVIEW will make sure to grab all the statically called VIs in Main, A, and B.  There should be no reason to include an entire LLB, unless you are truly calling every single VI in that dynamically.
 
I have built multiple apps with well over 1000 VIs, and have found that a nice "trick" is to create a dummy VI.  On that VIs diagram you statically place all the dynamic VIs you will call.  You then include that single file as a dynamic VI.  Then as you add new dynamic VIs you simply add it to this dummy VI and they will be included in the build.  However, you never actually call or use the dummy VI, it is simple included in the build to ensure you get all the dynamic VIs.  Therefore, you should not have any issues with the DLL, because you never load th edummy VI.
0 Kudos
Message 10 of 11
(3,241 Views)