05-19-2020 12:16 PM
Hi. I have a sequence that calls a subsequence. In the subsequence, there is a loop up to, say 30 second. The loop polls hardware and checks pass or fail every 5 second. If fails, continue loop until time expires and if pass, exit loop. The issue is upon exit, if there is an initial failure and the next iteration passes, the subsequence and the calling sequence fails.
I would like the sequences to record the last result, pass or fail, rather than any failures it encounters. I am guessing there is a way to do this but I don't know how. Please advise.
Thank you!
Solved! Go to Solution.
05-20-2020 01:41 AM
Is this similar to this?
https://forums.ni.com/t5/NI-TestStand/For-loop-in-teststand/m-p/4052221#M61983
05-20-2020 10:34 AM
Yes, it is similar. If I want to only use the last result and ignore the previous results, how would I set the conditional under SequenceFilePostResultListEntry engine callback?
05-20-2020 01:33 PM
I would not use test steps inside this loop, but after it, only once. Just store the result in Locals and then use e.g. "none" adapter as a test step.
05-20-2020 02:31 PM
I am a bit unclear what I should do . Can you please help me with an example? I am using TS 2017
05-21-2020 02:56 AM
In the attachment some example. First subseq will do the job with use of loop step type. Second subseq with single step looping propertie. You need to play with it a bit 😉 Good luck.
05-26-2020 11:49 AM
Hi Michal,
Using Sequence_1 example, my test would have the Numeric Limit Test inside the Do While loop. So, after it polls HW, it compares the data it receives to a known set of data. So, in your example, the Number Limit Test would be inside the Do While loop and after the Poll HW statement.
My objective is to truncate the previous failure (if any) and ONLY keep the last result, regardless of pass of fail. That result would also be displayed on the MainSequence as well.
Is that doable?
05-28-2020 02:31 AM
Why you use the Test step type inside of loop, if you need only the last result to be in result list?
In the example you have the Action step inside the loop. Use it to get the data and then use e.g. Statement step to check the result and set condition for next loop iteration (or use Break step).
In the Statement step you can use:
String CheckLimits(Number value, Number high, Number low, String comparisonType, Boolean doNotCopyToResults = True, Number nominal = 0, String thresholdType = "PERCENTAGE")
This function evaluates whether a value is within the specified limits
Store the the result from the last step in the Locals and use Test step after the loop.
06-23-2020 11:55 AM
Hi Michal,
Sorry for the very late response. Had unrelated issues that prevented me from moving further. Just want to let you know that this works.
Much appreciated!