NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Inserting Values into Multiple Steps with the Same Name via Code

Hello,

I'm currently working with a sequence that contains multiple steps with the same name. I've been using the GetStepByName command to retrieve the first step it finds with a given name in my sequence. However, I need to insert the same values into all steps that share this name. Is there a method to retrieve a list of all steps with the same name within a sequence and apply changes to each of them programmatically?

Any guidance or code snippets that could help achieve this would be greatly appreciated.

Thank you!

0 Kudos
Message 1 of 4
(160 Views)

That's why unique step names are generally recommended...

If not, you have to loop through all steps and check if the step name matches what you are searching for.


 

 

 

0 Kudos
Message 2 of 4
(147 Views)

ok , so what is the command i need to do in c# to reach all of the steps in the sequence and change them?

0 Kudos
Message 3 of 4
(144 Views)

Once you have obtained the SequenceReference (Sequence)

 

Sequence.GetNumSteps()

to give you the number of Steps in the StepGroup (Setup,Main, Cleanup)

Then you loop over all steps

Sequence.GetStep(index, stepGroup).AsPropertyObject.Name

If you have a match, you can work on this the step


0 Kudos
Message 4 of 4
(134 Views)