NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Access Step Parameter

Hello,

I'm trying to dynamically create a sequence file using the TestStand API,Version 3.5.
The application is written in Visual C++. Adding steps to a sequence is no problem
but accessing the step-specific properties is what I can't figure out to do. The following
code snippet adds a Wait-Step and then tries to configure it for a 2 second wait by
editing the property TimeExpr.

TS::SequencePtr sequence;
TS::StepPtr step;
TS:: PropertyObjectPtr propobj;

// insert 2 second wait

step = engine->NewStep("None Adapter", "NI_Wait");
stepName = "waiting...";
step->Name = (_bstr_t)stepName;

       
propobj = step->AsPropertyObject();
propobj->SetValNumber("TimeExpr",0,2.0); // exception occurs
propobj->Release();

sequence->InsertStep(step, 0, (TS::StepGroups)0);

Unfortunately I always get an exception when setting the property.
Does anyone know how to do that?

Thanks.
Mike
0 Kudos
Message 1 of 2
(3,013 Views)

Hi,

You need to use SetValString as the TimeExpr is a string property

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 2 of 2
(3,008 Views)