NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Loop While Expression

I have a LabVIEW VI that generates a rondom number between 1 and 10.  I call the VI in a TestStand sequence step.  I want the TestStand step to loop while the number generated is greater than 1, but when I use the expression "Step.Result.Numeric > 1" the step doesn't even loop once.  However, when I use the expression "Step.Result.Numeric < 9" it tends to loop the number of times that I would expect, that is, it loops until the number generated is 9 or greater.  I tried the expression "Step.Result.Numeric - 9 < 1" and again, it doesn't even execute once. 

Any ideas?  I'm fresh out.

Thanks,
Jo-Jo
0 Kudos
Message 1 of 4
(3,759 Views)
Whoops, I made a mistake, ignore the stuff about the expression "Step.Result.Numeric - 9 < 1", the other problem still stands.
0 Kudos
Message 2 of 4
(3,755 Views)

Hi,

The step will loop while the expression is True

Step.Result.Numeric > 1 && Step.Result.Numeric < 10

That will keep it looping until the expression becomes False which would be outside those limits. But its a While loop therefore the test is done before it enters the loop. As Step.Result.Numeric is 0 this will set the expression False and therefore never enters the loop.

So you have to Set Step.Result.Numeric to some value that will allow the expression to be True. say the value of 5.

Hope this is clear.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 3 of 4
(3,750 Views)
Crystal, thanks.
0 Kudos
Message 4 of 4
(3,745 Views)