LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop

Hi,
We are working on LabVIEW to develop a driver software. I came across a problem while using the WHILE loop. A WHILE loop was used to perform some calculations and output the data, which was stored into an array. The loop was designed to stop the operation, when a condition is reached. But when I checked, I found that the loop was not stopping, after the condition was reached. But no data was coming out of the loop after the condition is attained, but the operations in the loop was still executing and consuming much of my system memory. Please suggest a solution to this problem.

Yours faithfully,
R. Vishnu,
CDAC Trivandrum.
0 Kudos
Message 1 of 4
(2,781 Views)
Hi,

It is quite hard to believe that the while loop does not stop when the stop condition is met... my best guess is that, for some tricky reason, you think that the condition was met but it actually never have been.

Could you post the VI in which this is happenning ?
I also suggest you place a "conditional probe" on the wire that goes to the stop terminal and set it to "pause if true", then start your VI and see ; if it never pauses, it means the stop condition hasn't been met...







Hope this helps



Message Edité par TiTou le 07-17-2007 02:01 PM


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Download All
0 Kudos
Message 2 of 4
(2,770 Views)
What kind of condition are you using to stop it? Is it an equal comparison to a floating point number? If so, this is not a good technique. You should use an In Range/Coerce, greater than/equal to, less than/equal to, etc. No data is supposed to come out of a loop until it finishes. Posting the VI or an image of it would be a good idea if you want more detailed help.
Message 3 of 4
(2,766 Views)
A while loop doesn't stop when the stop condition is met. It stops when the stop condition is met, and everything in it is finished.


If you have another loop in it that is still running, the while loop (any loop, even every structure) will continue until everything in it is finished.


My guess is some vi's or other code is looping, preventing the while loop in question from terminating.


Regards,


Wiebe.
Message 4 of 4
(2,758 Views)