From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand Idea Exchange

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

Looping inside the Expressions

Status: New

Hi,

 

I have a table in file globals (2D array).

Each column of the table has an associate variable in file global.

For i want my custom step to run N time which is the number of rows in the table.

In each iteration, i want to take each value of the row and assign the value to the asscoiated variable in file global.

so, i want to have a looping mechanism in the expression.

I guess it is not explicitly present right now. Right now, i use teststand API to update the variable.

It would be nice to have looping in expression. This will improve my custom steps performance.

 

Regards,

Muthuraman S

Regards,
Muthuraman
2 Comments
nclark
Member

I'm going to second this. Having the ability to loop within an expression would be a very powerful tool.

 

In my most recent test sequence, I sought to move around some variables within arrays. Since this work isn't necessarily anything special, I felt it appropriate to delegate it to a single "Statement" step instead of a space-consuming "For-Each" loop.

 

However, TestStand does not currently support "For" loops (or any loop for that matter) within expressions (using TS 2017). Rather than take up only one line to do some blind initialization on some containers within arrays, I had to relegate the work to a rather bloated (and slow) "For-Each" loop.

 

In previous sequences, whenever I needed to loop through an array to set some specific variables, I used a LabVIEW VI instead of TS's native step types. This time around, I was looking forward to not having to make what is seemingly an overly simple VI. Dependent on how slow this "For-Each" loop runs, I might just go back to creating an initialization VI for each sequence I make.

 

Adding the ability to loop within an expression would mean that TestStand's "Statement" steps could be used for quick, low visibility array work.

2ben
Member

Looping over arrays in expressions would allow to set individual measurement names for each measurement in a multiple numeric step with variable number of data and using the 'repeat one measurement' (e.g. for each measurement in post expression).

As it is now, TS create new measurements for each data item but they all have the same name.