LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

redo in a for-loop (or while-loop)

Hi

 

The attached VI waits for the "trigger" button to be pressed and then displays the current trial state.  However, if the redo button is also pressed then I would like it to decrement the index by one and then display the trial state.  

 

My actual use-case is the following.  

 

After Labview receive a trigger from external hardware start collecting analog data. It monitors this data and triggers another piece of hardware if the analog data reaches a threshold. This threshold can have different values for each trial.  However, the operator might want to be able to redo a trial (if the trigger is sent to early because of noise or the threshold isn't reached as expected).

 

I am not sure how to set this up.  Any ideas would be greatly appreciated.

 

Thanks

 

Azim

0 Kudos
Message 1 of 3
(2,945 Views)
I think you have better to take State Machine Pattern (which means using of while loop) for redo function.
0 Kudos
Message 2 of 3
(2,942 Views)

Since you don't know the total number of iterations (depends on the # of redos!), you need a while loop.

 

 

Here's a quick draft how you could do it using an event structure. Modify as needed. 😉

 

 

Message 3 of 3
(2,931 Views)