NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamically get parameters names of a Step Type

Hello everybody,

 

I am coding the ProcessModelPreStep in order to have access to each step of the running sequence, before it has been execute. With the following expression I access to the type name of the step:

 

Locals.Type_Name = RunState.Caller.Step.StepType

 

But I can't find the expression to get access to all the parameter names of the step type.

Does somebody know such an expression to do that ?

 

Thanks you !

0 Kudos
Message 1 of 8
(5,075 Views)

A step itself has no parameter.

A code module has parameters.

 

Or do you refer to the parameters the sequence has which is holding the step?

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 8
(5,072 Views)

I don't know much about TestStand, but you are probably right I do refer to the parameters of the code module, I need to get their names.

0 Kudos
Message 3 of 8
(5,069 Views)

Ok, the parameters are connected to the code modules, hence to the module adapter.

 

The data involved for the adapter is stored in a hidden container called "TS" within the step. In order to see this container, you have to check the "Show hidden properties" option in the preferences of your Station Options. The TS container includes a variable called "SData".

 

Depending on the adapter, within the SData container, you can find your parameters.

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 8
(5,063 Views)

Ok, thank you.

I'll try to explore this way but the amount of properties / methods is so huge !

0 Kudos
Message 5 of 8
(5,042 Views)

There is also a higher level API for module settings, a separate interface for each adapter. Using the API is more future proof, the properties under SData might change in a future version.

 

-Doug

Message 6 of 8
(5,038 Views)

As Doug mentioned, we recommend using the adapter API to access module information such as parameters (this is an additional API we provide in addition to the standard TestStand engine API).  The adapter API can be used in expressions along with the engine API.  For example, to get a LabVIEW parameter you would use the following:

 

RunState.Caller.Step.Module.AsLabVIEWModule.Parameters.Item(0)

Al B.
Staff Software Engineer - TestStand
CTA/CLD
Message 7 of 8
(5,033 Views)

Ok, thank you everyone, I've found a way to do what I wanted, with the following expression :

 

Locals.Item_Names[Locals.LoopVar] = RunState.Caller.Step.AsPropertyObject.GetNthSubProperty("",Locals.LoopVar,0).Name

 

Thank you again !

 

(I'm LDT, I've changed my account)

0 Kudos
Message 8 of 8
(5,003 Views)