NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Hide FAIL status in While Loop with Status Expression

Solved!
Go to solution

While running a loop in Teststand the result shows Failed during the iterations. Is there a way to edit the status expression to not sow FAIL until the Pass condition or the max iterations occur?

0 Kudos
Message 1 of 10
(3,746 Views)

I would not advocate changing the result of a step to something else.  If you really need to do it you can specify a PostExpression that will modify a measured value (that would have failed) to bring it back within the test limits before the StatusExpression of the step is evaluated.

 

An example scenario for numeric values.  Example test limit is Less than or equal to 0.5.

Step.Result.Numeric > 0.5 ? (Step.Result.Numeric = <your passing value here>) : (Step.Result.Numeric = Step.Result.Numeric)

 

Alternatively, could you modify the step type, of the step(s) within the While Loop, from Test type(s) to an Action type(s).  Then after your While Loop has completed have a new Test step that evaluates values taken by the Action step(s) in the loop and determines your PASS/FAIL result.  You could still configure your while loop to stop on your old PASS criteria having occurred.

0 Kudos
Message 2 of 10
(3,707 Views)

Steve

The second suggestion seems best.

If I save the result from the loop to a global do I have to pass it to some kind of VI to do the numeric test? Or is there a way to just do a numeric limit test on the global?

 

Michael

0 Kudos
Message 3 of 10
(3,697 Views)

I am not sure what your PASS/FAIL criteria or how you need to track the number of passes and fails, but it might be as simple as looking at the number of times the loop executed.  If you are exiting your loop on your PASS criteria (the first time you see the pass condition), loop count (remembering it is 0 indexed) will give you the number of failures?  My original post suspected that you wanted to look at the results from each iteration of the loop and make a decision, in which case I would say pass your results (don't think you need to use a Global, a Local should do it or the ResultList if you are conformable using that) into a VI that will return you a Pass or Fail.

 

Post up a bit more detail of what you would like to do.  The NI Community love solving problems.  I suspect you will get a few solutions to select from.

Message 4 of 10
(3,689 Views)

Steve

I am using the looping properties, PASS/FAIL count under properties set to 1 pass in 10 loops. It's waiting for the pass condition or to exceed the 10 loops without a pass for a fail. My issue is just aesthetics really. If it loops say 3 times and them passes the fail status displays 3 times before the pass does.

I tried doing the loop as an action but think I have to change the type because it only loops one time (guessing because the action type doesn't look at pass/fail).

I pass the result to the next step. Had to make a simple LabVIEW VI to pass the variable to.

 

ME 

0 Kudos
Message 5 of 10
(3,679 Views)

Here is the attempt at doing it in two steps. First step only loops one time pass or fail.

0 Kudos
Message 6 of 10
(3,668 Views)

I can't view your sequence I am running TS2014.  I have attached a Sequence and associated VI,  NOTE:  the VI is called from within the sequence and just generates a random number that is my simulation of your measurement VI.

 

NOTE: I use a PreCondition on the Break step within the FOR Loop to determine if I have met the pass criteria (in my case the measured value < 0.5). I am not looking for a pass I am looking for the value that is a pass.  After the FOR Loop I check to see how many times the loop iterated and determine my overall pass fail result from that.

Download All
0 Kudos
Message 7 of 10
(3,648 Views)
Solution
Accepted by topic author WileECoyote

Steve

The example works. I did have to add the limits and results to the pass/fail step.

Would still like to just be able to hide the FAIL status in the built in FOR loop while it's looping.

 

Michael

0 Kudos
Message 8 of 10
(3,598 Views)

Hi Michael

I am slightly confused, my example should not show pass or fail whilst in the loop, it should show only Done.  Can you clarify what you have done/are seeing?

Steve

0 Kudos
Message 9 of 10
(3,594 Views)
Steve Was referring to the looping options under properties in the Teststand properties tab for a step. Your example, as you noted, does not show the PASS/FAIL status while looping. ME
0 Kudos
Message 10 of 10
(3,551 Views)