NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Type of Step by activex

Hi guys,

 

I want to get the Type of the Step by activex. I have the name but in case of a Statement Step the name can be changed.

If I get the Field Type that we can found on the tab Properties, General I will be able to get information I want following the Step Type.

 

Thanks in advance.

0 Kudos
Message 1 of 5
(4,400 Views)

You can use Step.StepType.Name to get the type of step.

 

Hope this helps,

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

No, I don't want to use the Name. In case  for example of a statement Step the name can be changed.

 

I'm creating a sequence that generate a documentation from a sequence file. Following the type of the Step I will get more or less information from it.

 

0 Kudos
Message 3 of 5
(4,377 Views)

The solution given is correct and working.

Its the name of the "step type" not step.

For a statement step type it will always return "statement" irrespective of the name of the added step.

0 Kudos
Message 4 of 5
(4,370 Views)

Oh pfhenry21.  I am hurt that you wouldn't trust my solution... however, I completely understand.  Alas, I'm not always right.  But in this case I am.  🙂

 

Did you give it a go?

 

Most objects in TestStand inherit from the PropertyObject class.  The PropertyObject class has a property called Name.  In my statement I return the StepType object by using Step.StepType.  Then I use the Name property to get the name of that object.  NOTthe name of the Step.  If I used Step.Name then you would be correct in assuming that the name will change and can be anything.

 

And ultimately you will most likely be using something like: RunState.Sequence.Main[Some Index or Step Name].StepType.Name.  Or if you are in an engine callback you would use something like: Parameters.Step.StepType.Name.  Or if you are iterating through the sequence in an external code module it would depend on how you are getting the steps.

 

Hope this helps you understand it a little better.

 

Regards,

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