02-27-2024 10:50 AM
I am trying to understand how to do this with my current test stand setup.
I have a Main.seq file which has the standard MainSequence subsequences. In the Main, I call a number of .seq files that I treat as subsequences. I have not added a subsequence like this: https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YI5HCAW&l=en-US
So now I'm trying to figure out what the best way to pass data from inside the subsequence.seq to the Main.seq without completely changing they way I use TestStand.
I'm trying to understand if FileGlobals is the way to go, but can't find examples of it in use. Below is my scenario where I'm trying to process the results in Main.seq, rather than in TestA.seq. Ideally I would actually like to have a ResultsProcessA.seq on the same level as TestA.seq, but I'm still learning how to pass variables between the two.
Main.seq
TestA.Seq
CustomResultsVariable
What this really comes down to is the following scenario Test A and Test B, are continuity tests for a PCB test. If we detect failures, I do not want to log those results to teststand immediately, I want to give them the option to retry so I loop the test if they click "Retry", if they click "Fail" then it will log results. So what I've done is used the evaluate, with Result Recording Option DISABLED for Test A and B. If both tests pass, then I want to re-process the results with Result Recording Option ENABLED and continue testing. I was thinking that I could make a Process Results.seq once Test A/B are passed or the operator click failed. My issue is I don't know how to pass data between sequences "on the same level". I am okay with the idea of not adding a subsequence and instead processing in Main.seq if needed.
Main.seq
TestA.seq
TestB.seq
------------- *Potentially want to add* Process Test A & B Results.seq
Test1.seq
Test2.seq
Thanks in advance
02-28-2024 03:47 AM
Hi,
Did you try using "By Reference" parameters to pass data from sub-sequence.seq back to the Main.seq?
Regards,
Anand Jain
NI
02-28-2024 09:19 AM
I just found out how to do that. I think there's some sort of bug/lack of feature in TS. When you copy a variable from Locals its by default "by value" whereas if you create one in parameters its "by reference" and there's no way to explicitly change the reference type after its created. This wasted a solid day of effort.
Going to try re-working my solution, with by reference.
02-28-2024 11:52 AM
Here is a strategy that you can use:
RunState.PreviousStep.Result.ButtonHit == 1 ? Parameters.Step.Result.Status = "NoLog", RunState.Caller.NextStepIndex = RunState.Caller.StepIndex : ""
If the user chooses "Retry", the expression step sets the status to "NoLog"; you can do whatever you want...could even set it to an empty string. And, the caller NextStepIndex is set to the caller step so that the test will run again. If the user chooses Fail, the test will not re-run and will log the Failed result in the report.
Then, in the report Options plugin set the Result Filtering Expression: Result.Status != "NoLog"
So, the re-tested Steps will always have "NoLog" and will not be logged. Passed and Failed tests will be in the report.
Good Luck.