NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Change Loop Options

Hello,

 

I am working on a custom substep that will allow a step to be repeated a number of times and calculate statistics on the measured value.  I have a pre-expression that looks at a global variable and changes the loop options according to if statistics are to be calculated.  If they are, a custom loop is setup.  If not looping is disabled.  However, it seems that when the loop options change, it does not take effect the first time the sequence is run.  If you look at the step after the sequence is run, the loop settings are as expected.  If you rerun the sequence withtout changing the loop options again, it behaves as expected.

 

It appears that changing the loop options in a pre-expression does not impact that execution.  Is there a way around this?The sequence is attached.

 

Thanks,

Mike

Download All
0 Kudos
Message 1 of 2
(2,677 Views)

Hi,

 

The trouble is the Step Looping conditions are evaulated before the Step Pre-expression therefore any changes you make will not take affect until you call the step again.

 

Check out the Step Execution table 3-4 in the Reference Manual.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 2
(2,661 Views)