NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the best way to iterate through all steps of a sequence and sub sequences in edit time via the API. (C#)

I am trying to figure out how to iterate through all steps of sequence, sub sequences included in a code module with C#.

I am using a custom editor and have added a sequence call back method in the Configure menu. When this method is called, the code module is called with as argument the RunState.ThisContext

With following code, it is possible to iterate through the sequence at run time but not at edit time.

Is there another way to get the sequence file at edit time?

How to get the sub sequence files at edit time?

sequenceFile = TestStand.SequenceContext.ProcessModelClient;

if (sequenceFile != null)

{

    int intNumberOfSequences = sequenceFile.NumSequences;

    for (int intSequenceCounter = 0; intSequenceCounter < intNumberOfSequences; intSequenceCounter++)

    {

        sequence = sequenceFile.GetSequence(intSequenceCounter);

        // Iterate through all step groups

        IterateSequence(sequenceFile, sequence, StepGroups.StepGroup_Setup);

        IterateSequence(sequenceFile, sequence, StepGroups.StepGroup_Main);

        IterateSequence(sequenceFile, sequence, StepGroups.StepGroup_Cleanup);

    }

}

 

Best regards

 

Patrick

0 Kudos
Message 1 of 1
(3,776 Views)