NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

adding local variable using mfc-application

Hi.

I’m looking for a way to add a local variable to a TestStand-Sequencefile (not while the sequence is running) – out of a MFC-application. It’s not the first time this question is asked – I know. But I’m not able to get the other solutions running.

Thought it should work like this:
...
Step SequenceStep;
TS::PropertyObjectPtr property;

disPtr = tsEngine.NewStep(TS_SequenceAdapterKeyName, TS_StepType_SequenceCall);
SequenceStep.AttachDispatch(disPtr);
SequenceStep.SetName("Sequence");

//add a local variable to the new created sequence
property = SequenceStep.AsPropertyObject();
property->SetValString("Locals.VarToInsert", 1, "Str");
...

In TestStand I’m not able to see the
new variable – but in the Sequencefile the following lines were added:

[SF.Seq[0].Main[2].Locals]
VarToInsert = "Str"

After changing the lines to:

[DEF, SF.Seq[1].Locals]
VarToInsert = Str

everything works fine. Any suggestions what’s wrong with my program?
Thanks!
0 Kudos
Message 1 of 3
(3,155 Views)
I’ve found a solution (example in the TestStand-folder) for this problem.
0 Kudos
Message 2 of 3
(3,155 Views)
What is the solution? I have the same problem. Please help me! Thanks!!
0 Kudos
Message 3 of 3
(3,155 Views)