NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Display Last Result Of A Sub Sequence And In The Calling Sequence

Solved!
Go to solution
Highlighted

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!

 

0 Kudos
Message 1 of 9
(481 Views)
Highlighted

Is this similar to this?

https://forums.ni.com/t5/NI-TestStand/For-loop-in-teststand/m-p/4052221#M61983

Michał Bieńkowski
CLA, CTA
Averna
Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 2 of 9
(435 Views)
Highlighted

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?

0 Kudos
Message 3 of 9
(412 Views)
Highlighted

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.

Michał Bieńkowski
CLA, CTA
Averna
Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 4 of 9
(404 Views)
Highlighted

I am a bit unclear what I should do . Can you please help me with an example? I am using TS 2017

0 Kudos
Message 5 of 9
(399 Views)
Highlighted

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.

Michał Bieńkowski
CLA, CTA
Averna
Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 6 of 9
(369 Views)
Highlighted

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?

0 Kudos
Message 7 of 9
(303 Views)
Highlighted
Solution
Accepted by topic author TTLN4

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.

Michał Bieńkowski
CLA, CTA
Averna
Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 8 of 9
(286 Views)
Highlighted

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!

Message 9 of 9
(222 Views)