11-05-2013 05:34 AM
Hi All,
I wonder if there is a way to append 1D array to another 1D array in TestStand other than by copying element by element in a loop?
Also if a part of array, say, Array_1 which has 10 element need its elements from 5 to 10 to be appended to another array at the bottom. currently I use loop. But I wonder other than looping each element of the array to another array is there any standard functions or TS APIs available like in LabVIEW?
Thanks,
JKV
11-05-2013 08:56 AM
SetNumElements(Locals.Sum, (GetNumElements(Locals.Array1) + GetNumElements(Locals.Array2))), //Allocate Array For Sum
Locals.Sum = Locals.Array1 + Locals.Array2
It worked for me.
11-05-2013 09:03 AM
Actually you don't even need the first line. It still works.
To get a subset of an array you can copy the array over to a temporary array and then use the RemoveElements() function to remove the parts you don't want. Then add that temporary array to your other array.
Hope this helps,
11-05-2013 09:12 AM
@JKV999 wrote:
Hi All,
I wonder if there is a way to append 1D array to another 1D array in TestStand other than by copying element by element in a loop?
Also if a part of array, say, Array_1 which has 10 element need its elements from 5 to 10 to be appended to another array at the bottom. currently I use loop. But I wonder other than looping each element of the array to another array is there any standard functions or TS APIs available like in LabVIEW?
Thanks,
JKV
For the second question, in newer versions of TestStand (I think this feature was added in 2012), you can do the following:
Locals.newArray += Locals.Array_1[5..9] // NOTE: assuming array is 0-based so has elements 0-9
-Doug
11-06-2013 12:27 AM