LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running two copies of SubVI in parallel

Solved!
Go to solution

I'm trying to create sort of life test for series of 1-way mechanical switches. In this test I need to measure insertion loss of my devices under test while repetitiously switching them. I use USB controlled 4-way switch to test 4 DUT's at the same time. I built a Sub VI that switches to the selected path (S-1, S-2, S-3 or S-4) and takes a measurement. It works pretty well.

 

Now I'm adding another 4-way switch to test another 4 DUT's. And I have a plan to add up to 8 4-way switches running in parallel. It works. But I was surprised that the measurement time doubled. And I figured out that my second Switch&Meas Sub VI can't be called from a parallel While Loop simultaneously with the first one. It waits until the first one finishes its routine.

 

Ok. I saved a copy of the Sub VI and call it from a second loop. And now it works in parallel, both 4-way switches are switching like crazy. But I feel that I just made another stupid thing.

 

Please take a look at the example. I removed any device specifics, replacing them with delays and random numbers. Can you suggest any way of running the same Sub VI in parallel without creating multiple copies?

0 Kudos
Message 1 of 3
(2,617 Views)
Solution
Accepted by topic author Arkady_V

Read up on re-entrant VIs.  I think that will do what you want.  The setting is in VI Properties >> Execution.

 

Lynn

Message 2 of 3
(2,614 Views)

Thank you for fast reply, that was simple and worked just well!

0 Kudos
Message 3 of 3
(2,605 Views)