LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running different VIs in parallel

I'd like to have one VI call another VI and have both of them execute in
parallel (instead of the wait until finished) sub-vi approach that is
happening now. Is this possible? I'd like to be able switch back and
forth between VIs while they are both open.

Thanks,
0 Kudos
Message 1 of 7
(3,260 Views)
Call the VI dynamically using an invoke node and the run method (open a reference to the VI using the open reference function, wire the function to an invoke node, select the run method..etc), it allows you to set a wait until finished flag to false...
0 Kudos
Message 2 of 7
(3,260 Views)
What is it that stops your calling VI from continuing to run while the subVI also runs? LabVIEW code only waits for a subVI call to finish if you have made it do so by some kind of data dependency.

If your problem is that you need to pass data to/from a running subVI, you might want to look at using queues, notifiers or globals.
0 Kudos
Message 3 of 7
(3,260 Views)

Hi s,

Check out the example I posted here. It demostrates exaclty how to control this type of functionality.


http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000001457010...

Have fun!

Ben


Ben Rayner
Certified LabVIEW Developer
www.DSAutomation.com

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 7
(3,260 Views)
I have a button on my main.vi. I have an event structure on the
diagram. When I get the button->value change event, I execute my sub_vi
by dropping the sub_vi on the diagram in the event structure. I assume
the main.vi is waiting for that sub_vi to exit or return because main.vi
doesn't process events until I close the sub_vi. I'd like to be able to
switch back and forth between the two vi's and have them process events
as I make them...

tmh wrote:
>
> What is it that stops your calling VI from continuing to run while the
> subVI also runs? LabVIEW code only waits for a subVI call to finish if
> you have made it do so by some kind of data dependency.
>
> If your problem is that you need to pass data to/from a running subVI,
> you might want to look at using
queues, notifiers or globals.
0 Kudos
Message 5 of 7
(3,260 Views)

Thanks for the example. I implemented your approach and it works right
except the sub_vi front panel doesn't close when I hit the exit button
on the sub_vi's front panel. It stops but does not close it's front
panel. Is there a way to make it close it's front panel when I exit?

thanks,

Ben wrote:
>
> Hi s,
>
> Check out the example I posted here. It demostrates exaclty how to
> control this type of functionality.
>
> http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000001457010...
>
> Have fun!
>
> Ben
>
>
> href="http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=261&HRedirected=True&HUser...

> > Certified LabVIEW Developer
> www.DSAutomation.com

0 Kudos
Message 6 of 7
(3,260 Views)
Yes!

In the sub-VI's case where it is going to stop, have it open a reference to itself, set the front panel as closed, and then close any refnums that where open.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 7 of 7
(3,260 Views)