LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help about while loops

Hello !

I'm a beginner in labview , I use labview 5.1.
I have tried to use a while loop .
I have just build a vi that generates random data and
displays it on a chart.
I have a boolean button wired to the conditional terminal
whether the button is false or true , the diagram inside my
while loop is still running .
I have put a scope on conditionnal terminal , I can see that it works well
with the button
but not the loop itself .

thank you for nay help
pprovot@ulb.ac.be
0 Kudos
Message 1 of 3
(899 Views)
Hi,

Do you have the boolean terminal (the green TF box in the diagram) inside
the while loop? If not this is what happens:

LabVIEW reads the data from the terminal.
This value (T/F) goes into the while loop.
Every time the while loop 'loops' the same value is used.

So, if your boolean is false, the while loop stops after the first run. If
your boolean is true, the while loop runs forever.

Note: To increase performance, put a "Wait (ms)" vi in the while loop. Get
this vi from "Time & Dialog" in your function pallete. This will prevent the
vi to take 100% processor performance. The User Interface of the program
will run better.

Hope this helps...

Wiebe Walstra.

--
AIR technical Automation
www.air.nl
"Pascal Provot" wrote in messa
ge
news:8ub5k0$pb3$1@snic.vub.ac.be...
Hello !

I'm a beginner in labview , I use labview 5.1.
I have tried to use a while loop .
I have just build a vi that generates random data and
displays it on a chart.
I have a boolean button wired to the conditional terminal
whether the button is false or true , the diagram inside my
while loop is still running .
I have put a scope on conditionnal terminal , I can see that it works well
with the button
but not the loop itself .

thank you for nay help
pprovot@ulb.ac.be
0 Kudos
Message 2 of 3
(899 Views)
Also, try running the vi while in highlighted execution mode (the light bulb
button on the diagram's tool bar). This will allow you to watch exactly how
your program executes on the diagram and it shows what values are passed
where. This is my favorite debugging tool.

"Pascal Provot" wrote:
>Hello !>>I'm a beginner in labview , I use labview 5.1.>I have tried to
use a while loop .>I have just build a vi that generates random data and>displays
it on a chart.>I have a boolean button wired to the conditional terminal>whether
the button is false or true , the diagram inside my>while loop is still running
.>I have put a scope on conditionnal terminal , I can see that it works
well>with the button>but not the loop itself .>>thank you for nay help>pp
rovot@ulb.ac.be>>
0 Kudos
Message 3 of 3
(899 Views)