LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement 2 while loops executing simultanenously?

I am new to Labview and have no clue in doing two while loops. I need to have 2 while loops running with different speed. While one loop generating an array continuously, the second one gotta grab the updated array from the first one and execute slower.
Can anyone give me an example in that? I will appreciate alot. Thanks.

Mo
0 Kudos
Message 1 of 3
(2,890 Views)
Mo,

It might be helpful if you can supply a bit more information about what type of data you are generating and how it is being used later on. You might be able to do this more efficiently with one loop. For example you could use a running counter in your loop (store a value into a shift register and add one to it every loop iteration) and a Case structure to execute part of the code (that's inside the case structure) only every nth iteration of the loop. Inside the case you would also reset the counter to zero.

Christian L
NI Consulting Services
authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 2 of 3
(2,890 Views)
The attached image shows how to use a local variable to share data between parallel while loops. Another way to share data between loops is by using queues (see queue examples that ship with LabVIEW).
0 Kudos
Message 3 of 3
(2,890 Views)