LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop question

I have a question regarding while loop. I don't want the next iteration of the loop to run until there is a change in the "numeric control" of the loop. How should I do it? What kind of delay function should I put in?
0 Kudos
Message 1 of 12
(3,589 Views)

With an event structure and a timeout  = -1.

 

JM

Message 2 of 12
(3,581 Views)

Put a small while loop in that detects when the value has changed.  For good measure, you should also have it detect the stop button.

 

You could also have an event structure in the loop with infinite timeout.

Message Edited by Ravens Fan on 09-12-2009 11:43 AM
Message 3 of 12
(3,574 Views)

Thanks guys but I still don't know where to put the sequence structure.

 

I have a while loop and inside the while loop, there is a sequence structure with 2 phases. My numeric control is in the first phase and that's the only thing in that first phase. Second phase is comparing with a random number.

Where should I put the event structure?

0 Kudos
Message 4 of 12
(3,557 Views)

It will be easier if you post your vi.

 

JM

0 Kudos
Message 5 of 12
(3,554 Views)
how do i post a vi?
0 Kudos
Message 6 of 12
(3,551 Views)
0 Kudos
Message 7 of 12
(3,542 Views)

Could you give a little bit more informations about the purpose of the VI?  I understand that you want to limit the number of trials.  The user have to enter a number (dbl) between  1 and 5 or any number?  This number is compared to a U8 (1..5) and you want to know how many time the guess was correct for X trials?  This is correct?

 

JM

0 Kudos
Message 8 of 12
(3,534 Views)
Yes. The loop should run 10 times. So there will be 10 guesses for X and we want to know how many times the guess is correct.
0 Kudos
Message 9 of 12
(3,530 Views)

Evertyhing moves inside the the event "numeric" including the verification of the max number of iteration.

 

JM

0 Kudos
Message 10 of 12
(3,507 Views)