09-08-2017 10:15 AM - edited 09-08-2017 10:17 AM
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?
Solved! Go to Solution.
09-11-2017 05:12 AM
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.
09-11-2017 07:58 AM
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
09-11-2017 08:22 AM
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.
09-11-2017 10:47 AM
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
09-11-2017 01:16 PM
Here is the attempt at doing it in two steps. First step only loops one time pass or fail.
09-12-2017 03:04 AM
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.
09-19-2017 07:07 AM
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
09-19-2017 07:31 AM
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
09-20-2017 08:33 AM