NI TestStand Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
RayFarmer

Expand on the default Array Functions

Status: Completed
With the release of TestStand 2012, we added a number of expression functions for manipulating arrays including Sort, FindIndex, FindOffset, Contains, IndexToOffset, OffsetToIndex, and SetElements. We also added the Split and Trim functions for handling strings and the Max and Min expression functions now support arrays. Finally, we added drag-and-drop functionality to the Variables view for arrays so elements can now be interactively inserted, deleted, moved and so on. For more details on any of these features, check the New Features section in the NI TestStand 2012 Help under What's New in TestStand>>TestStand 2012>>New Features. Thanks for your feedback and keep it coming! Lars

Handling arrays in TestStand is pretty limiting and more often that not you have to pop into a code module to perform any sort of array handling.

The following is the default functions that can be used in expressions:

[Array
GetArrayBounds(array, lower, upper) Retrieves the upper and lower bounds of an array.
GetNumElements(array) Returns the number of elements in an array.
InsertElements(array, index, numElements) Inserts new elements into a one-dimensional array.
RemoveElements(array, index, numElements) Removes elements from a one-dimensional array.
SetArrayBounds(array, lower, upper) Changes the bounds of an array.
SetNumElements(array, numElements) Sets the number of elements in a one-dimensional array.

]

 

 

I would like to see this expanded to avoided have to resort to using code module.
The following is some suggestion:


Array Subset function
Array Max & Min
Replace Array Subset function
Search 1D Array
Sort 1D Array

 

 

regards

Ray Farmer

Regards
Ray Farmer
13 Comments
JÞB
Knight of NI

why not go whole hog and implement as a .NET system array?  Make life easier by using the wheels that have allready been invented.  

 


"Should be" isn't "Is" -Jay
BClarke
Member

In regards to array subset, it would be helpful if you could grab a single row/column from a 2D array and have it return a 1D array, to solve the problem I had here

Lars_L
NI Employee (retired)
Status changed to: Completed
With the release of TestStand 2012, we added a number of expression functions for manipulating arrays including Sort, FindIndex, FindOffset, Contains, IndexToOffset, OffsetToIndex, and SetElements. We also added the Split and Trim functions for handling strings and the Max and Min expression functions now support arrays. Finally, we added drag-and-drop functionality to the Variables view for arrays so elements can now be interactively inserted, deleted, moved and so on. For more details on any of these features, check the New Features section in the NI TestStand 2012 Help under What's New in TestStand>>TestStand 2012>>New Features. Thanks for your feedback and keep it coming! Lars