11-21-2016 02:05 PM
Hi everyone,
I have 4 subsequences that run one after another within my "Main Sequence." Within the 4th subsequence, I have a step that checks whether a boolean is TRUE. If the boolean is TRUE, I want to jump to the 1st Subsequence using the step's post action. Then I expect the code to jump to the 1st Subsequence, run the 1st Subsequence, then run the 2nd Subsequence, then run the 3rd Subsequence, and then run the 4th Subsequence and check if the boolean is TRUE again. If it is TRUE, I will jump back to the 1st Subsequence and start all over again. If it is FALSE, I will finish executing the sequence file.
What is the syntax in the post action selection I need to use? Thanks!
Solved! Go to Solution.
11-21-2016 03:47 PM
Is this another step? Or would it be the post action of sequence 4? If it's another step then just the the GoTo step with a precondition of your boolean.
If it's the post action of Step 4 then Check the Use Custom Condition. Put your boolean in there. On the True condition select Goto step and then select the call to sequence 1.
Hope this helps,
11-21-2016 04:01 PM
Hi,
This can be done by using a sequence parameter and evaluating it once the subsequence has completed:
See the attached example sequence file.
Regards,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-21-2016 04:15 PM
From a style point of view, I'd personally prefer to use a Do...While flow control structure, rather than use a Post Action because:
(A) I think it's easier to read and understand the intention of the sequence
(B) It's immediately more flexible - I can add or re-order steps anywhere into the Do...While, but with the Step Post Action I have to go and modify the target of the Post Action if I move the first sequence or want to add something before it.
I've attached an example of the solution using Do...While.
I hope this helps.
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-22-2016 09:52 AM
Charlie/Jiggawax,
Thanks for your replies. I am trying to jump from a step post action within a subsequence (subsequence #4) to another subsequence. Please see pictures below. The first picture shows the high level main sequence with the 4 subsequences and the second picture shows the 4th Subsequence with a steps post action. When that step runs, if the RetryTest boolean = True I want that steps post action to jump to Subsequence 1 in the main sequence so that it will run from subsequence 1 all the way back to subsequence 4 step to evaluate RetryTest boolean.
I am trying to figure out what to set the Go To Step (see highlighted in red in second picture) function too to jump back up to Subsequence 1.
Thanks for your help.
11-22-2016 10:25 AM
Well I'm not sure if you can do it like that, i.e have a subsequence step go to a calling sequence step directly...
I would have thought you have at least let it return back through the call stack and have the Post Action on the call to the subsquence...
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-22-2016 10:39 AM
What you could do is reset the Main Sequence step index if you wish to retry, by using the following expression in a statement in Subsequence 4:
RunState.Caller.NextStepIndex = (Locals.RetryTest == True ? 0 : RunState.Caller.NextStepIndex)
(Example attached)
I hope this helps,
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-22-2016 10:42 AM
Charlie,
I am using Test Stand 2013 and am unable to open the file you attached because it is 2014. Can you resave the file as Test Stand 2013? Thanks!
11-22-2016 10:47 AM
Example 1 - Post Action on Subsequence 4 call
Example 2 - Do..While
Example 3 - Resets Main Sequence step index
Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)
Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor
11-22-2016 03:01 PM
Charlie,
This resolved my issue. Thanks for all the help! Enjoy your Thanksgiving.