LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Controle while loop outside of it

Hello,

I am using a signal that i generated form the task.

 

I put my block in a "while" loop. I can control the stop condition from a command inside the loop.

Is there anyway that i can control (start/stop)the loop with a condition outside of the loop.

 

Thanks for the help it is appreciated.

 

Franck

0 Kudos
Message 1 of 6
(2,662 Views)

It depends on what you have outside of your loop. If you have a parallel while loop outside of that while loop you can put a boolean in there that is wired to a local variable, which is then passed into your primary loop to stop it.

 

What is the need for stopping the while loop outside of the loop as opposed to inside the loop?

Message 2 of 6
(2,661 Views)
Probably the easiest way to do it is to set a local or global outside the loop and retrieve it inside the loop.  Keep in mind that whatever is supposed to set it outside the loop needs to be executing as well.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 3 of 6
(2,649 Views)
We discussed using Notifiers to do this last week over here.
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 6
(2,620 Views)

Thanks for the help.

 

I must be missing something but i cannot make it work.

 

Attached is what i have done !

Thanks

 

0 Kudos
Message 5 of 6
(2,582 Views)

Where is your part of the code that is running outside of this while loop?  Where are you generating the notification?

 

Do you know that the boolean control you have only gets read once right at the beginning of the program?  The  you loop pauses and waits on a notification that never occurs.

 

I suggest you open up the exampler finder and look at the examples for notifiers.  I would recommend you learn more about LabVIEW from here. How to Learn LV

Message Edited by Ravens Fan on 03-22-2009 10:20 PM
0 Kudos
Message 6 of 6
(2,577 Views)