LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RTM Menus

Can anyone give me a small sample of code, which shows how I can run in parallel vi's at the same time by using invoke nodes. Every which way I have tried just stops the data flow in the other vi's until each one is closed. Having a lot of trouble getting my head around this one. Would post my application but it's big.
0 Kudos
Message 1 of 8
(3,770 Views)
What version of LabVIEW?

Franky Boy wrote:
> Can anyone give me a small sample of code, which shows how I can run
> in parallel vi's at the same time by using invoke nodes. Every which
> way I have tried just stops the data flow in the other vi's until each
> one is closed. Having a lot of trouble getting my head around this
> one. Would post my application but it's big.
0 Kudos
Message 2 of 8
(3,770 Views)
Attached is an example of one way to do it...it's in LV7 code, let me know if you need it in LV6.1, I'll convert it.

Just run the main.vi and select VI1 and VI2 from the menu...if you close them using the X they will continue to run in the background and you can open their window by selecting them from the menu again.

Mads
0 Kudos
Message 3 of 8
(3,770 Views)
> Can anyone give me a small sample of code, which shows how I can run
> in parallel vi's at the same time by using invoke nodes. Every which
> way I have tried just stops the data flow in the other vi's until each
> one is closed. Having a lot of trouble getting my head around this
> one. Would post my application but it's big.


The ways to execute VIs are using a subVI call, the Call by Reference
node, and the Run Method on a VI reference -- which is probably the one
that you are talking about. The Run method is very much like pushing
the Run button on the VI. It can either wait for the VI to complete or
it can push the button and return. This technique is one of many ways
to get some parallelism, but not if you are trying to run the same VI
several
times, or if the VIs being run share nonreentrant subVIs or are
otherwise blocking one another with semaphores or related items.

My suggestion would be to use a combination of breakpoints and execution
hilighting to see where the parallel tasks collide. Keep in mind that
VIs can be made reentrant in VI Settings, but the default is for this to
be off. If not reentrant, only one call can proceed at a time, and all
calls share side effects on controls and shift registers. Making a VI
reentrant means that multiple calls can proceed, but shared data such as
averaging shift registers will no longer work across all calls. Post
again once you have more symptoms.

Greg McKaskle
0 Kudos
Message 4 of 8
(3,770 Views)
The version of Labview is 6.1
0 Kudos
Message 5 of 8
(3,770 Views)
Mads,

Could you convert the file to 6.1, many thanks
0 Kudos
Message 6 of 8
(3,770 Views)
Here u go...Haven't tested it in 6.1, but normally it should work fine, nothing LV7 specific used in the code.
0 Kudos
Message 7 of 8
(3,770 Views)
Franky Boy wrote:
> The version of Labview is 6.1

Hmm, I ran my test program in 6.1, takes a parameter 'wait until
finished' false, zee papa spawned 3 vis running their own stuff. Root
cause analysis suggests that the problem is 'El Swear'.
0 Kudos
Message 8 of 8
(3,770 Views)