NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Execute desired sequence


Hi All,

I'm using one of the GUI examples of NI and

I have a file that contain two sequences,Main sequence & Sub Sequence.

How can I execute only the sub sequence?

How can I execute a sequence by name only?




0 Kudos
Message 1 of 15

You may select the subsequence and then execute it in 2 ways.


  1. Goto Execute Menu and select "Run Sequence"

  2. Right Click the sequence and select  "Run Sequence"

0 Kudos
Message 2 of 15

Hi Ranjith,

What I ment is how to execute the desired sequence by code.(programmatically) using c#



0 Kudos
Message 3 of 15



 You may use the NewExecution method in the Execution class for executing a new Sequence. The name of the subsequence can be passed as a parameter.



0 Kudos
Message 4 of 15

Do you have any example to show?Will be very helpful...



0 Kudos
Message 5 of 15

Honestly, this is NOT how TS is meant to work.


From a TestStand point of view, you load a sequence file and there is ONE MainSequence which is the "entry point" for your custom test routine. Selecting to execute this using a process model ensures that framework tasks (like checking for serial number, creating reports, ...) are handled "around" your custom test.


Sure, there are situations where design is challenging in order to get to this generic setup, but i NEVER encountered any situation where this is impossible.

So instead of trying to bend (and potentially break) the UI, the process model and the complete process of usage of TS, you really should reconsider your design. By stating this, i assume that all your previous questions relate to the same project.


Maybe it is a good time to consult your local NI branch if they are able to provide some sort of architectural consulting regarding TS. I recommend this as i got the feeling that you are not using TS to its full extend and therefore stumbling from issue to issue....



CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 15

Hi Norbet,

Yes you right it related to the same c# project,

To anybody else I'm looking for a way to execute a sequence by name using c#


By the NI editor I can add new sub sequences to the same file.

On Execute Menu Item you can select which sequence you can run solitary.



p.s :  When you load a file sequence that assembled with two sequences (main sequence & sub sequence) the axSequenceViewMgr object has contained the two sequences.....So it seems to me very reasonable to be able to execute by name.





Thank you 4 your time,




0 Kudos
Message 7 of 15

engine.NewExecution(sequenceFile, "SequenceName", null, false, ExecTypeMask_Normal, args /* or System.Type.Missing if no args */, System.Type.Missing, System.Type.Missing)


You can get the engine from ApplicationMgr.GetEngine() if needed. Or if calling from a step in a sequence, you can get the engine from the SequenceContext (I'd recommend using a sequence call step though if you are doing this from a sequence since that is easier).



0 Kudos
Message 8 of 15

Hi Doug,

Nothing happens,

What sould I do with the object execution??


0 Kudos
Message 9 of 15

Executions run asynchronously from the call to NewExecution. If you are in an existing UI, you don't need to hold onto the execution, you can just release it (or allow it to be released automatically depending on the programming language you are using). In the full featured UI's the new execution should appear automatically.


Which UI are you using? When/where are you calling NewExecution? What exactly are you trying to do?



0 Kudos
Message 10 of 15