LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can two parallel while loops have the same stop control?


VeeJay wrote:

Thank you! That clarified a lot!!

 

_________________________________________________________________________________________

quote "Several loops (for and while, and timed) can run in parallel if they have no data dependency. "

_____________________________________________________________________________________

 

What if they do communicate with each other (having data dependency) in terms of one loop sending the command to another and the other sending its feedback?

 

Thanks! 🙂


It depends on what you mean by data dependency. If the communication is via queue then they send data to each other, but there's no physical wire, so they can run in parallel. But if there's a wire that comes out of one loop and into the other, then the second loop cannot run until the first one has finished (see attached picture):

 

 

EDIT: altenbach answered the question while I was composing my reply.

Message Edited by smercurio_fc on 04-14-2010 02:52 PM
0 Kudos
Message 21 of 23
(1,303 Views)
EDIT2: Note that in the example with the queue, the second loop is technically running in parallel, but the loop will hold at the Dequeue Element until there's actually an element in the queue. If the timeout were set to, say, 1 msec, then the Dequeue Element would finish execution after 1 msec if there was no element in the queue and proceed to the next iteration. Keep in mind that example was for demonstration only and to show the basic difference between it and the one with the wire connecting the two loops.
0 Kudos
Message 22 of 23
(1,297 Views)

Great explaination and example! I really appreciate it. Fortunately, I would have one loop running faster than the other; in that case, I assume I will be OK!

 

Thanks guys

 

V~J

I may not be perfect, but I'm all I got!
0 Kudos
Message 23 of 23
(1,269 Views)