Quantcast
Channel: NI TestStand topics
Viewing all articles
Browse latest Browse all 6733

Creating and changing step variables

$
0
0

This is a two-part question, both pertaining to step variables:

 

1) Is there a way to programmatically (C#) create a new step variable when dragging and dropping a custom step into the steps window?  I created the step type, set up the OnNewStep substep (which calls a form in a C# code module) and am able to set Locals and FileGlobals, but not Steps.  I did notice that the steps don't seem to appear in the Steps window until after the form closes, so is it even possible to create it at that point?

I am looking to do something like this:

 

SequenceContext.Step.CreateValString("MyStepVariable", "SomeValue);

 

 

2) How would I edit an existing step variable.  Let's say I already have the variable created (some other way).  Is there a way to change its value in code?  I see the SequenceContext.Locals and SequenceContext.FileGlobals.  However, I am unable to find anything that would work like this:

 

 

SequenceContext.Step.SetValString("MyStepVariable", "Hello");

FYI, neither of these are meant to run when the step actually runs.  They would be called when adding or editing a step.

 

Thanks a ton in advance for any and all suggestions.


Viewing all articles
Browse latest Browse all 6733

Trending Articles