NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Construct a variable with other variable

Hello,

 

I'm working on a subsequence.

I have a container and I would like to access the values in it.

arkeod_0-1657550381623.png

 

To choose the STEP I want, I use a variable name Banc_Test_Choisit.

So I would like to do something like this :

Locals.Performances_STEP.Parameters.Banc_Test_Choisit.IP.Courant_Permanent_Minimum

 

If you have an idea 🙂

Thank ! 

Arthur

0 Kudos
Message 1 of 2
(625 Views)

Hello Arthur,

 

I'm not sure I undertood your task correctly so forgive me if I did not.

 

If you want to dynamically decide the values of which variable to get, you can take a look at the Lookup string of the GetValXXX methods.

https://www.ni.com/docs/de-DE/bundle/teststand-2021-sp1/page/tsapiref/reftopics/propertyobject_getva...

 

So if you have your parameter which declares the variable name to get (lets say Parameters.MyParameter = "STEP5"),

then you can dynamically get the value of Locals.Performances_STEP.Step5 with this expression:

Locals.Performances_STEP.GetValVariant(Parameters.MyParameter,1)

 

Does this help?

 

Stefan

0 Kudos
Message 2 of 2
(601 Views)