LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem using invoke node in application builder

Hi all,
 
I am fairly new to LV8 and have been having a great deal of problems adjusting.  Right now I am trying to make an EXE from my program.  The program opens a vi that is in the same LLB file via an invoke node.  (path input is: \mysub.vi - could that be the problem?).  In the developement environment this works fine.  The sub-vi opens in the background, and the main vi pulls data from it via a global variable.  When I run the EXE,  the sub-vi never opens.  There was a suggestion in another thread to mass compile the main vi, but this had no discernable effect.  Help Mr. Wizard!
 
Any assistance would be greatly appreciated.
 
Jim
Jim

LV 2020
0 Kudos
Message 1 of 7
(3,218 Views)
Are you including this subVI you open via an invoke node as a Support File or Dynamic VI in the build process? This should be necessary, since otherwise LabVIEW will have no idea that it is required in the build and won't package it with your exe file.
Jarrod S.
National Instruments
Message 2 of 7
(3,216 Views)

Hi Jarrod,

Thank you.  Sometimes a well worded question doubles as an answer.  I had "Set inclusion type for all contained items" checked, with "Startup VI" selected.  I looked at changing those settings, but didn't know what to set as what.  What defines when a file is a startup file,  a dynamic VI, or a support file?  I assume all non-VIs are support files, but which are dynamic, and which are startup?  I unchecked the check box and recompiled.  Oh my god, all one hundred or so VIs opened simultaneously (or tried to).  Looks like the top level is the startup!  Seems like LV would default to this setting.  I changed the radio button on all of the VIs except the top level to dynamic, and all is well.  Thanks for the breadcrumbs.

Jim

Jim

LV 2020
0 Kudos
Message 3 of 7
(3,212 Views)
Yes, the startup VI should be your main VI. This could be your GUI VI, or perhaps a loader VI that initializes and starts up your main VI. Basicly, whatever VI should run first. You can, as you noticed, have more than one startup VI, though most applications don't require it.

Regular subVIs that are on the block diagram of your VI don't need to be included as dynamic VIs, because LabVIEW already knows to include them. You only need to include a VI explicitly as a Dynamic VI if you are calling dynamically it with VI Server calls (like Invoke Nodes) rather than as a regular subVI. The reason is that this VI is only being referenced by its path, so until run-time, LabVIEW has no idea whatsoever what VI to load. Consequently it can't guess which VIs to include as dynamic VIs when it builds an executable.

Here's a trick that makes it much easier to organize your dynamic VIs and have them included automatically in the build process. In your LabVIEW Project, create a virtual folder and call it something like My Dynamic VIs. The name isn't important, just make sure it makes sense to you. Then, whenever you have a VI that you will call dynamically in your application using Invoke Nodes or Call by Reference Nodes, add that VI to the virtual folder you created.

Now, when you go to create a build specification, add your one main VI as the startup Vi, but then add the whole My Dynamic VIs virtual folder under the Dynamic VIs and Support Files category. When you select build, whatever happens to be in the virtual folder at that time gets added as a Dynamic Vi in the build. And if you add more dynamic Vis into that folder at a later time in your project and you want to rebuild, you don't need to change the Build Specification at all. Everything in that folder will always get added to the build automatically!
Jarrod S.
National Instruments
0 Kudos
Message 4 of 7
(3,204 Views)

Thank you Jarrod.  That is useful insight as to how LV8 works.  Perhaps you can answer one further question.  We have a folder on our network where we store VIs that can be useful to share between developers.  We have copies of Labview all the way back to 5.0, and different developers are using different versions.  In previous versions of Labview I could just do a "File/Save with options/developement distribution" and it would automatically create an LLB file with copies of all used sub-VIs.  This way a developer using LV7 can make use of a VI written in LV6, while not updating the original community resource.  I know that I can use the LLB manager to drag the files into a LLB, but is there a way to populate the LLB automatically with all used sub-VIs?

Thanks for your help.

Jim

Jim

LV 2020
0 Kudos
Message 5 of 7
(3,190 Views)

Hi Jim,

In LabVIEW 8.0, you can build a source distribution for all your VIs and specify the destination as llb. To do this, open up your project explorer and right click on "Build Specification" and select "Source distribution". Under the distribution settings category, select "custom" for the packaging option. Check the "Destination is llb" under the custom packing option. Finally build the source distribution and the llb will be created in the specified destination directory.

Regards

Tunde A.

 

Message 6 of 7
(3,178 Views)

Tunde and Jarrod,

I would like to thank both of you for taking the time out of your day to help me.  I am having a lot of problems adapting to the new environment of LV8, and your input has been VERY helpful.

Regards,

Jim

Jim

LV 2020
0 Kudos
Message 7 of 7
(3,167 Views)