LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

parallel sub vi data output

Solved!
Go to solution

I have a main VI that has 12 of the same sub-vi's in a while loop (different DAQ channel for each). I want all the sub-vi's to update their respective graphs at the same time. Currently they update one at a time and it is not very clean. Is there a way to code this so that they all update their graphs at the same time? Is there anything more clean that having 12 different while loops running in parallel?

0 Kudos
Message 1 of 9
(3,524 Views)

I tried rendezvous, they dont allow any other while loop to start until all the while loops have finished.. but the data still updates at different times..

0 Kudos
Message 2 of 9
(3,507 Views)
Solution
Accepted by topic author rhelling

To have subVI's funciton at the same time, you'd make them reentrant.

 

But I don't know if that would work here because you don't have a normal subVI.  You have the ULx subVI which is part of the driver ofr MCC DAQ hardware.  It may not be able to be made reentrant because it probably uses an underlying dll.  I'm surprised you aren't getting some errors even now.  With NI DAQmx, you usually can't start multiple tasks on different channels of the same card because  you'll have a resource conflict.  The ULx drivers are modeled after the DAQmx drivers.

 

There should be a means of setting up a single task that grabs data from all 12 (?) channels at once and uses only a signle ULx Read VI.

0 Kudos
Message 3 of 9
(3,505 Views)

I am pretty sure that I can grab data from all 12 TC's with a single read, thats a good idea. I would then need to figure out how to parse out that data but it should be at the same rate is what you are getting at i think..

0 Kudos
Message 4 of 9
(3,501 Views)

So all i needed to do here was to pull data from the ULx for all 12 TC's, and then split up the array several times to get each channel. Thanks for the help!

0 Kudos
Message 5 of 9
(3,481 Views)

I'm glad you got it figured out now.  Please show your final VI.

 

You say "then split up the array several times" which makes me think you aren't using Index Array correctly.  A single Index Array should get you all 12 values in one shot.

0 Kudos
Message 6 of 9
(3,454 Views)

See attached scn shot. You can see the physical channel of the ULx now shows it is taking all Analog channels from 0 to 11. Will look into array indexing..

0 Kudos
Message 7 of 9
(3,450 Views)

I thought something like that was happening.  You are making a newbie Rube Goldberg Code mistake.

 

Open up context help on the Index Array.  You can see it is expandable by dragging down the bottom border.  As a bonus, you don't even need to wire up any constants to the index inputs because by default it will give you index 0, 1, 2, 3, .... in order.  You'll be able to delete 11 of those index arrays and all 12 of those constants.

0 Kudos
Message 8 of 9
(3,445 Views)

this is great, thanks for the constructive criticism, make everything much simpler!

0 Kudos
Message 9 of 9
(3,423 Views)