LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous execution of while loops

I have three loops. In the first loop i am doing AO Single update. In second loop i am readind from AI using AI Single scan. In the third loop I have to take the 2 values (AO update value and AI scan value)and plot in a graph. I used global variables to access the AI and AO values..But the global variables when read in the graph loop does not match with the AI / AO loops. Delay is there. How to solve this or is there any other way
0 Kudos
Message 1 of 5
(2,957 Views)
Hi,
try to use local variables instead.
Or there may be problem with how you make AO and AI or what else you have inside loops.

Good luck.

Oleg Chutko.
0 Kudos
Message 2 of 5
(2,957 Views)
If you want to get fancy, use a queue. You can find shipping examples by opening LabVIEW >> help >> find examples. Click on the search tab and look for queue.

Oleg is right. A local variable will be better than the global.
0 Kudos
Message 3 of 5
(2,957 Views)
It seems all loops run at the same rate. Why can't you just put everything in a single loop and wire directly? (no globals or locals needed).

How fast are the loop rates?
0 Kudos
Message 4 of 5
(2,957 Views)
I put everything in one while loop and now there is no problem..
By the way whatz the difference between global and local variables in terms of execution/memory(internal working)?
0 Kudos
Message 5 of 5
(2,957 Views)