LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While Loop won't stop when condition terminal is fed False

I've been brushing up on version 6 up by trying out some basic exercises.

Problem: In all VIs that involve a While Loop, it fails to stop when the condition terminal (the icon in the lower right) is fed a false boolean value. I've now tried a number of such exercises, doing them exactly as described. All I can figure is that somehow there is a configuration setup that I have overlooked, or some subtlety that is excaping me (this was a new installation on Windows 2000).

Attached is one of the simplest examples. It should stop looping when the switch is thrown, should it not?
0 Kudos
Message 1 of 7
(2,965 Views)
Hi,
yeah it is supossed to work like that and it is ,so what problem are you facing in this vi.
Plz be a bit more elobrate so that we can help you with it.
cheers
vicky
0 Kudos
Message 2 of 7
(2,960 Views)
i think this loop runs absolutely fine, i think you should elaborate on the exact issue that you are facing:)
0 Kudos
Message 3 of 7
(2,954 Views)
Your conditional terminal is set to 'continue if true'. If you change it to 'Stop if true', it will loop until you change the value of your switch. This of course depends on which state your switch is initially. Otherwise, it works as it should.

Message Edited by DavidT on 04-19-2005 03:56 PM

0 Kudos
Message 4 of 7
(2,954 Views)
Actually, I said it all: on my system, it fails to stop regardless of the boolean value. Even if I set the condition terminal to "Stop if True."

If you are finding that the VI runs "as it should," then you imply that the switch does in fact stop the loop.

So my question remains: why doesn't the switch stop the loop on my system? Is there some setting in LabVIEW that I need to set? Or is my installation somehow corrupted?
0 Kudos
Message 5 of 7
(2,951 Views)
It does not make sense if the loop of your attached VI does not stop. Can you put a probe on the green wire leading to the loop condition terminal? Does it reflect the button state?

A few things to check:
  • Make sure you are running the VI with the run button and NOT with the continuous run button! The continuous run button will constantly restart the VI whenever the loop finishes, giving the appearance that it does not work.
  • Make sure that the terminal of the boolean switch is inside the while loop (as in your attached VI).
  • Message 6 of 7
    (2,945 Views)
    Quote: Make sure you are running the VI with the run button and NOT with the continuous run button! The continuous run button will constantly restart the VI whenever the loop finishes, giving the appearance that it does not work.

    Aha! You have spotted my oversight/ignorance. That certainly explains what I am seeing. (BTW, yes, I had at least thought to put a probe on the wire. But I misunderstood the nature of the run and continuous run buttons.)

    Thank you!
    0 Kudos
    Message 7 of 7
    (2,940 Views)