NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding SequenceCallModule to Steps

Solved!
Go to solution

I am new to TestStand and I am trying to programmatically a SequenceCall into a step in C#. I am able to create new steps with:

 

Step step = engine.NewStep("Sequence Adapter", "SequenceCall");

 

And add them with:

 

seq.InsertStep(step, 0, StepGroups.StepGroup_Main);

 

I have a SequenceCallModule that I loaded my path into.

 

SequenceCallModule SMod = (SequenceCallModule)step.Module;

SMod.SequenceFilePath = path;

 

How do I associate this module with my step so when I insert my step the sequence call will be in my main sequence?

 

Let me know if you need any further information or clarification about my question. I am new to TestStand.

 

0 Kudos
Message 1 of 4
(2,428 Views)

You should check out the shipping example on this topic:

%TestStandPublic64%\Examples\TestStand API\Building a Sequence Using API\DotNet

 

Hope this helps!

Trent

https://www.linkedin.com/in/trentweaver
0 Kudos
Message 2 of 4
(2,411 Views)
Solution
Accepted by topic author AlexKB

This was taken from an NI Week presentation:

Create SeqCallStep:
▪RunState.SequenceFile.GetSequenceByName("MainSequence").InsertStep(RunState.Engine.NewStep("","SequenceCall"),Locals.loopindex,StepGroup_Main)

 

Note: locals.loopindex is a variable added so they could loop on adding a lot of steps.  It looks like you're almost there, you just need to add something like SequenceFile.GetSequenceByName("MainSequence")

so that it will go in the right place.

 

Source:
https://s3.amazonaws.com/v3-app_crowdc/assets/7/7b/7b1430895fcc48c2/1700Ochoco1033_0522_113930.origi...

 

Message 3 of 4
(2,397 Views)

Thank you.

 

SequenceFile.GetSequenceByName("MainSequence")

 

Fixed it.

0 Kudos
Message 4 of 4
(2,375 Views)