NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Fill Array by Reference

Solved!
Go to solution

Hi,

 

What I want: Fill an array, which is inside a container, and named based on input parameters.

 

What I have tried:

I have created an object reference, Locals.obj_temp, which stores the current array I want to fill inside the container.  I seem to be able to get the number of elements, set array bounds, insert elements, etc. but I can't figure out how to actually put values in there.  

 

I've learned today I can use "*" to dereference the object ref, so I use 

InsertElements(*Locals.obj_temp,"[0]",1),

 to add an element, successully.  

 

But, I don't know how to make it the value I want it to be, i.e. not the default zero as highlighted in the picture.

 

 

for what it's worth, this is how I make the new array inside the container and get a reference to it.

Parameters.UniqueFCs.NewSubProperty(Parameters.UniqueFullTable[0][Locals.m],PropValType_Number,True,"",0),
Locals.obj_temp = Parameters.UniqueFCs.GetPropertyObject(Parameters.UniqueFullTable[0][Locals.m],0),

 

 

 

Pic1.PNG

0 Kudos
Message 1 of 2
(4,204 Views)
Solution
Accepted by topic author christopherdean

I figured out a way to do it.

 

I created a temp array as Locals.Arr1 and clone it to the paramater container I want.

 

For anyone who finds this thread, I have 

Locals.Arr1 //my temp array which I empty at each iteration of my outer for loop

/*
code that populates Arr1
*/
Locals.obj_clone = Locals.Clone("Arr1",0), //create an obj clone of Arr1 Parameters.UniqueFCs.SetPropertyObject(Locals.name_temp,1,Locals.obj_clone ), //copy the array Arr1 into my output container (my container is called UniqueFCs)

 

 

 

0 Kudos
Message 2 of 2
(4,195 Views)