LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problems of running two while loops in one VI

Solved!
Go to solution

Hi Raven Fans, Moreese and forum

 

Another problem just arises unfortunately, I am unable to synchronise the start of the two timed loops in cRIO.vi.

 

The time delay between the two timed loops loops is not as obvious when the loop rate is similar (say 30Hz to 1Hz), however one of the loop will run at 50Hz while the other will run at 1sample per min (60000ms period) msot of the time. The time delay becomes very obvious (up to 60s), it seems that the low priority time loop starts one iteration too slow. Is there any way to fix this? Because ideally we want the elapsed time to be accurate (at least within 5 sec) for data analysis purpose. Thanks!

 

Again attached in the project. Any help is greatly appreciated!

0 Kudos
Message 11 of 13
(694 Views)

You would use local variables to stop two parallel loops within the same VI, specifically with the top-level VI or a sub-VI that opens it's front panel when called and closes when stopped.  So in other words, any VI that gives you direct access to stopping the loop.  Your initial use of the shared variable to stop the loops is correct since you have VIs running on different targets.  VIs on the same target would not use shared variables.

-----------------------------------------------------------------------------------------
Reese, (former CLAD, future CLD)

Some people call me the Space Cowboy!
Some call me the gangster of love.
Some people call me MoReese!
...I'm right here baby, right here, right here, right here at home
0 Kudos
Message 12 of 13
(681 Views)

Thanks Moreese! Regarding the problem I have desribed on the previous thread, I have made a new post about it which is probably more appropraite since it belongs to a different topic. Thanks for the help!!

0 Kudos
Message 13 of 13
(667 Views)