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?
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"
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.
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....
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,
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).
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?