NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric Array Subset in TestStand?

Solved!
Go to solution

Hi everyone, is there a function in Test Stand to return a portion of a "NUMERIC" array starting at a specific index within the array?  I see functions for "STRINGS" but nothing for "NUMERICS."

 

Thanks so much!

0 Kudos
Message 1 of 3
(6,354 Views)
Solution
Accepted by topic author testdesign

You can use an expression such as the following:

 

Locals.MyArray[3..5]

 

This will give you an array comprised of elements 3 through 5 from Locals.MyArray. This should work for all array tpes in TestStand.

 

Hope it helps!

Message 2 of 3
(6,351 Views)

Daniel,

 

I found your response very helpful (Thank you), and I extended it slightly to allow a more dynamic selection of my array subset.  I had to use the Evaluate() function to make this subset a little more variable, as I've demonstrated below:

 

This example returns all array elements starting at Locals.offsetIndex through the end of my array.

 

Evaluate("Locals.MyArray[" + Str(Locals.offsetIndex) + ".." + Str(Locals.MyArray.GetNumElements() - 1) + "]")

 

Thanks for sending me down the right path.

 

Ken M.

 

0 Kudos
Message 3 of 3
(3,778 Views)