NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Jump to specified step by step id

Solved!
Go to solution

Hello,

 

I'm using SequenceFilePostStep callback to check a variable value polling from LV operator interface.

I'd like to use this function to jump back to the mainsequence for the first step of the "Main" group from anywhere from the running sequences.

My idea was to use the Statement step with precondition (check variable valu) and in the Expression field I'd use the step ID to go back to the first step of the Main group of the mainsequence.

How can I do this?

 

Thanks.

0 Kudos
Message 1 of 5
(2,910 Views)

@kopisti wrote:

Hello,

 

I'm using SequenceFilePostStep callback to check a variable value polling from LV operator interface.

I'd like to use this function to jump back to the mainsequence for the first step of the "Main" group from anywhere from the running sequences.

My idea was to use the Statement step with precondition (check variable valu) and in the Expression field I'd use the step ID to go back to the first step of the Main group of the mainsequence.

How can I do this?

 

Thanks.


Are you in the sequence with the step you want to go to? If so you could use the post action of the step to go to the step you want. You can create a custom post action that checks whatever you are checking in your precondition currently.

 

-Doug

 

0 Kudos
Message 2 of 5
(2,896 Views)

Hi Doug,

 

Thanks for your answer.

No, I'm not in the same sequence.

I've more sequences, but I want to check the variable value at all the time (with the callback).

I'd like to go to the Mainsequence's Main group.

 

0 Kudos
Message 3 of 5
(2,890 Views)

Hi kopisti!

 

You could use the SequenceFilePostStep to solve this problem. 

In this SequenceFilePostStep you should terminate the execution of the subsequence with a statement: ThisContext.RunState.Execution.Terminate()

As the precondition of this step you can use tha value of a station global.

 

If the SequenceFilePostStep terminates the subsequence, in the cleanup phase you should set the value of the station global back to it's initial value.

If you don't do like this, the SequenceFilePostStep could terminate your MainSequence.

 

Best regards,

CLA, CLED
0 Kudos
Message 4 of 5
(2,849 Views)
Solution
Accepted by kopisti

@kopisti wrote:

Hi Doug,

 

Thanks for your answer.

No, I'm not in the same sequence.

I've more sequences, but I want to check the variable value at all the time (with the callback).

I'd like to go to the Mainsequence's Main group.

 


In the SequenceFilePostStep callback you can set the next step index and step group for the sequence for which the callback was called using an expression like the following:

 

RunState.Caller.StepGroup = StepGroup_Main,

RunState.Caller.NextStepIndex = RunState.Caller.Sequence.GetStepIndex("UniqueIdOrName", StepGroup_Main)

 

Hope this helps,

-Doug

 

Message 5 of 5
(2,839 Views)