NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Jump (goto) to a particular step or sequence

I am using the Post Step Callback to monitor errors being queued up in a separate thread. In the event where the post step callback detects an error I need to be able to jump (goto) a step or sequence in a different sequence file.

Is there a way to goto (not call) a step or sequence in a different sequence file? I want to stay within the same execution and thread and I do not wish to return to the caller. Just a simple goto.

Any ideas?

Thanks,

Marcela
0 Kudos
Message 1 of 5
(4,006 Views)
Hi Marcela,

You can goto a step within the calling sequence by setting the RunState.Caller.RunState.NextStepIndex property from within your callback. However, in order to go to another a sequence, that sequence must be called and placed on the callstack. Therefore, you can add a sequence call step to your callback and precondition it to execute based on your error condition. That way you do not need to return to your caller. You can also use a combination of both meaning that you can execute your subsequence, then set the NextStepIndex property right after it. Hope this helps.
Message 2 of 5
(4,006 Views)
Hi Bob,

Thanks for your answer. You say: "That way you do not need to return to the caller"
How would this work? It's my understanding that when you call a sequence it will return to the caller when the sequence is done. I'm not sure I understand how you are envisioning this would work. Could you elaborate?

Thank you very much,

Marcela.
0 Kudos
Message 3 of 5
(4,006 Views)
Hi Marcela,

Sorry about the confusion. Eventually the subsequence call will return to the caller, ending off with the least nested sequence in the callstack. I was trying to say that the subsequence call could take place in the callback and then after the subsequence had finished you could set the NextStepIndex in the callback so that no more steps executed in the sequence that called the callback. So you would have

1. Test UUTs->MainSequence->Callback->Subsequence
2. Then going back up the chain:
SubSequence->Callback (set NextStepIndex property)->MainSequence(cleanup group will execute)->Test UUTs.

Hope this provides a bit more clarification.

Bob
0 Kudos
Message 4 of 5
(4,006 Views)
thanks! 🙂
0 Kudos
Message 5 of 5
(4,006 Views)