05-20-2008 04:42 PM
05-20-2008 05:41 PM - edited 05-20-2008 05:41 PM
05-20-2008 05:58 PM
05-20-2008 07:46 PM
05-20-2008 08:04 PM
05-21-2008
09:34 AM
- last edited on
09-24-2026
07:27 AM
by
Content Cleaner
The VI Server allows you to load VIs dynamically and controls the programmatically. If you open the Example Finder (Help -> Find Examples) and search for "dynamic" you will see an example called "Dynamic Load Example", which shows one way of loading VIs dynamically. Other examples exist on the NI site:
Programmatically Opening and Running One VI from Another Using VI Server
Display a Splash Screen in LabVIEW using VI Server [link removed; example no longer available]
Get/Set Control Values using VI Server in LabVIEW [link removed; example no longer available]
The VI Server allows you to launch a VI and then return to your program. As with the separate loop, you would need a mechanism to stop the VI. As noted, you can use global variables, shared variables, or queues. With the VI Server you can simply call the "Abort VI" method:
Note that this is the same as pressing the red stop button on the toolbar, and is not a recommended way of stopping a VI since the VI will literally just stop, and depending on what the VI is doing that may be a bad thing.
Message Edited by smercurio_fc on 05-21-2008 09:34 AM
05-21-2008 01:12 PM
05-21-2008 01:28 PM
We can answer that once "some variables from the main VI" is better defined.
What would be the easiest way to dynamically load the VI with some variables from the main VI?
Global variables are the easiest to use, and as with all things, they come with caveats. They can cause race conditions. An alternative is the "functional global" or "Action Engine". You can find examples of using globals in the Example Finder (Help -> Find Examples). Search for "global".
I know you guys suggested to use global variables, shared variables, or queues. Assuming that I never used any of those 3 options which one would be the easiest to use?
05-21-2008 02:17 PM