LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop outputs data every cycle?

I may be having a bad day here so excuse me if my question is ludicrous.

Is it possible to have a while loop execute its code continously (until some sort of boolean is pressed) but at the same time output data into its tunnel every cycle/loop?

The reason for this is because I have two loops and I wish to have the first loop transfer data to the second loop everytime it cycles. This, at the moment, is not possible because the first loop only sends data when it's done cycling.

Thank you,
Alex

Edit: I've just read something about "queues". I apologize for not finding this earlier. Is this, perhaps, the way to go?




Message Edited by ap8888 on 07-08-2008 12:15 PM

Message Edited by ap8888 on 07-08-2008 12:15 PM
0 Kudos
Message 1 of 4
(2,759 Views)
What you are asking you can accomplish by many ways. Widely used are queues. Search the LabVIEW examples for producer-consumer design.
LV 2011, Win7
0 Kudos
Message 2 of 4
(2,744 Views)
hello ap8888,

You are correct in stating that you can only transmit the data through the tunnel after the while loop has completed.  A somewhat easy way to transfer data to another while loop is to use a local variable.  There is always the risk of a WAR (write after read) and your second loop being behind behind the other loop.  If you're just logging data or something, it probably won't be a big deal.   Can you share any specifiics that may help limit all of the choices down?
0 Kudos
Message 3 of 4
(2,742 Views)
Alex,

Yes, queues are a good way of transferring data between parallel loops.

LabVIEW is a dataflow language which means that any node (function, VI, loop, case structure,...) will only execute when all its inputs have data and will only generate data on its output terminals when it completes its execution. This is fundamental to the way LV works and is one of its most powerful features. Learn to understand dataflow to unleash the power of LV!

Lynn
0 Kudos
Message 4 of 4
(2,741 Views)