NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get or Set the Container Values using For loop index ?

Hi All,

 

How to get or set the value from container in test stand using index value (for loop method),

 

thanks in advance,

 

saran

0 Kudos
Message 1 of 2
(2,977 Views)

To set the value to (from Container).

If you have a Container which has two fields Num1 and Num2 and you want to pass data from an array

 

Use:

Locals.MyContainer.SetValNumber("Num"+Str(Locals.Index+1),0, Locals.MyArray[Locals.Index]) (I have made the assumption that my types are numbers)

 

Now I have made my field names and types easy for me to do this.

You can use

Locals.PropName = Locals.MyContainer.GetNthSubPropertyName("", Locals.Index, 0)

Then use Locals.MyContainer.SetValNumber(Locals.PropName,0, Locals.MyArray[Locals.Index]). Again I am making the assumption that my types match.

 

hope this helps

 

Regards
Ray Farmer
Message 2 of 2
(2,955 Views)