LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Calling SubVIs from a dynamically loaded VI.

Hi All,

    Any help is appreciated.

    So I've got a compiled executable as I call it, just a VI built with the APP builder. It calls some other VI's (uncompiled, still source .vi) from a directory, "Plug-In" style. The problem I'm experiencing is that when I have other SubVI's that i've created inside the VI's that are being called dynamically, it looks like LV can't find them and gives up on calling the VI. Any suggestions? Is it possible to compile the dynamic VI and still call it dynamically? How do I point to where the VI location is other than having it call the SubVIs dynamically as well? It is also choking on specific NI VI's such as the "Recursive List Directory" vi. I apologize if this is a bit unclear but it's very late and I'm very tired.

Regards,
Ken
0 Kudos
Message 1 of 4
(2,535 Views)
Hi Ken,

you have to be aware of dynamically loaded VIs because all dependencies within this VIs will not be taken into consideration by the app builder.
I will guess, that you create a dummy VI, place all used subVIs and create a source distribution of this VI (save it without blockdiagrams -> this should be working on targets too which do not have the development environment installed).

Another pit fall is the absolute/relative path. In RTS you have to use 2 times the split path function and one time the build path function.
For further information please check out the following KB:
http://digital.ni.com/public.nsf/allkb/686119C33C2C30C186256CA70081AC25

BR,
ThSa
0 Kudos
Message 2 of 4
(2,522 Views)
you have to be aware of dynamically loaded VIs because all dependencies within this VIs will not be taken into consideration by the app builder.
OK that's fine.

If I'm running from a PC with only the RunTimeEnvir will I also have to include "generic" labview VIs? Such as cluster functions, array, etc?

I will guess, that you create a dummy VI, place all used subVIs and create a source distribution of this VI (save it without blockdiagrams -> this should be working on targets too which do not have the development environment installed).

Hrm..ok? Do you have more information on this?

There are two goals I'm really trying to achieve here, one which is to be able to load VI's like plugins from a directory, and the second is to be able to run multiple instances of each VI from a central "commander". Is there a better way to do this than with dynamic VIs? Is it possible to communicate data from multiple EXEs? Is it possible to launch one executable from another? Is it possible to share data between two LabVIEW built executables?
0 Kudos
Message 3 of 4
(2,506 Views)


@Kenneth.Miller wrote:
you have to be aware of dynamically loaded VIs because all dependencies within this VIs will not be taken into consideration by the app builder.
OK that's fine.

If I'm running from a PC with only the RunTimeEnvir will I also have to include "generic" labview VIs? Such as cluster functions, array, etc?

I will guess, that you create a dummy VI, place all used subVIs and create a source distribution of this VI (save it without blockdiagrams -> this should be working on targets too which do not have the development environment installed).

Hrm..ok? Do you have more information on this?

There are two goals I'm really trying to achieve here, one which is to be able to load VI's like plugins from a directory, and the second is to be able to run multiple instances of each VI from a central "commander". Is there a better way to do this than with dynamic VIs? Is it possible to communicate data from multiple EXEs? Is it possible to launch one executable from another? Is it possible to share data between two LabVIEW built executables?



For generic LabVIEW VIs (primitives) you do not need to include anything else.
Following an excerpt of the process is listed:
  1. Right-click on Build Specifications, select New»Source Distribution
  2. Under Distribution Settings, select Custom as your Packaging Option
  3. Check the Destination is LLB box and click OK on the warning.
  4. Choose the Destination Path where you would like the LLB to be saved
  5. Change the VI settings: Delete Block Diagram
  6. Click Build to create the LLB, or click OK to save the Build Specification
If you want to have a commander which handles all VIs (also multiple instances), I think, VI Server calls are the only possibility. Unfortunaetly, it's not possible to communicate between separate applications (*.exe) with common techniques like global variables, queues, notifieres or something like this. Opportunities at this point would be shared variables, TCP/IP or UDP functions (there would be some other options like Datasocket, VI Server but those one are very advisable).
You wrote that you want to run multiple instances, therefore you have to activate the reentrant option as well!

BR,
ThSa

0 Kudos
Message 4 of 4
(2,495 Views)