NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Initializing and Adding an Element to an Array with TestStand Syntax

Hi,

 

I have a numeric 1D array in TestStand without an upper bound.  The array is called FileGlobals.Pressure_Values.  I would like to initialize this array and add elements to the end of the array with a post expression.  How do you initialize an array when you don't know the total number of elements that will be in the array?  How do you add an element to that array, without specifying the exact index?  I want to add an element after the last element that was inserted into the array.

 

I was thinking something like this, but this only works when I know the index.  I will not know which

FileGlobals.Pressure_Values = {10}, //Initialize the array
FileGlobals.Pressure_Values [0] = 15 //Set index 0 to 15

 

Thanks for your help!

0 Kudos
Message 1 of 3
(1,391 Views)

FileGlobals.Pressure_Values += {13} will append a 13 to the end of the array.

 

You can also use the set array bounds function.

jiggawax_0-1640883353398.png

 

Hope this helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 3
(1,338 Views)

That worked.

 

Thank you!

0 Kudos
Message 3 of 3
(1,322 Views)