01-17-2007 12:58 PM
01-17-2007 01:08 PM
I'm not sure where this discussion is going. The simplest way to run a subVI and not have the main VI pause is to simply have the subVI in a separate while loop.
A bit more complicated is the Run VI method and it's pretty simple to pass values to controls and get results while the VI is running without using globals variables, local variables, a modified subVI, or a special case statement. Along with the run VI method, there are Set Control Value [Variant] and Get Control Value [Variant].
01-18-2007 03:33 AM
01-18-2007 09:21 AM
01-18-2007 09:36 AM
So in your main program, first call the subvi with Init set to true, and all of your variables wired to pass the data. This sets the control values, but returns immediately. Then create a reference to the VI and use the "Run VI" method with "Wait Until Done" set to false. Then the subvi will run in the background with all the data you passed, but the main program will continue as nomal. This works for me.
Micah,
Is this method really possible? Is it something new in version 8.x? I don't think this is possible in version 7.x. If there were any "wired" instances of a vi in the block diagram, I found it impossible to dynamically run that same vi with an invoke node (the only method that supports WaitUntilDone = False).
-Kevin P.
01-18-2007 09:38 AM
01-18-2007 09:49 AM
@Kevin Price wrote:Micah,
Is this method really possible? Is it something new in version 8.x? I don't think this is possible in version 7.x. If there were any "wired" instances of a vi in the block diagram, I found it impossible to dynamically run that same vi with an invoke node (the only method that supports WaitUntilDone = False).
-Kevin P.
01-18-2007 06:56 PM
01-19-2007 07:50 AM
I'm curious now. I've never tried using a static vi reference to call an invoke node before. I know that separate instances of a reentrant vi on a block diagram actually become separate unique functions, so initializing one and then calling another wouldn't work. I also know that separate calls to VI Server to open references to a reentrant vi will also generate references to 2 separate instances of the vi. But I've never tried what you did in your screenshot.
Have you been able verify that the same instance runs in both frames of your sequence? How?
I'm very interested in this sort of technique -- the ability to both send data through terminal wires AND launch the vi dynamically without waiting for it to run to completion. I've had some limited success with a different method that's more of a pain in the neck, and would like to find a better way.
-Kevin P.
01-19-2007 08:06 AM