NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Adding a Wait step from C#

Solved!
Go to solution

I'm trying to add a Wait step to a sequence file from C# and can't figure out the syntax. I've got the code to add other steps (

NewStep(AdapterKeyNames.SequenceAdapterKeyName, StepTypes.StepType_SequenceCall)). Is there something similar for the Wait?

 

Thanks

0 Kudos
Message 1 of 7
(4,288 Views)

NewStep("", "Wait") should do the trick....

 

Let me know if that won't work.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 7
(4,286 Views)
Solution
Accepted by topic author dvtseng

It may need to be:

 

NewStep("", "NI_Wait")   🙂

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 3 of 7
(4,285 Views)

That worked to add the step. As a follow up question, how do you then modify the time interval in C#?

0 Kudos
Message 4 of 7
(4,278 Views)

It will be a string property of the step.  Use the step reference to do something like:

 

Step.AsPropertyObject.SetValString("TimeExpr", 0, "TimeInSeconds")  The TimeInSeconds would be a value like 1 or 2.

 

If you are in the sequence editor you can see the subproperties by adding a step of that type and then clicking on the Property Browser on the Properties tab.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 5 of 7
(4,273 Views)

That helps alot. One more question. Is there any documentation for the step type names for calling them in the API?

0 Kudos
Message 6 of 7
(4,256 Views)

There is a list of common ones.  In the TestStand help on the index tab type: StepTypes

 

You will see there are some constants for the common step types.

 

However, if you want to know the real name of a step type then you look in the type pallette.  That will have the actual name.  Because step types are technically data types you cannot have two steps with the same name loaded into memory at the same time.  So if you see it defined in your sequence file and in an ini file they are really the same type in memory.

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 7 of 7
(4,253 Views)