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

cancel
Showing results for 
Search instead for 
Did you mean: 

getting a row of a 2D TestStand array

Solved!
Go to solution
what is the syntax for getting a row of a 2D TestStand array
0 Kudos
Message 1 of 2
(2,892 Views)
Solution
Accepted by topic author StephenGerads

NI says I have to do it recursively or externally.

Here is my approach to getting a row recursively in TS.

 

PreExpression:

Parameters.row = {}, Locals.i = 0, // initialize variables

GetArrayBounds(Parameters.Array2D, Locals.loBounds, Locals.hiBounds),

Locals.columnQty = 1 + Val(Mid(Locals.hiBounds, Find(Locals.hiBounds, "]")+2, Len(Locals.hiBounds) - 3 - Find(Locals.hiBounds, "]"))), 

Locals.WhileExpr = "Locals.i < Locals.columnQty", // set condition expression

Locals.DoExpr = "Parameters.row += {Parameters.Array2D[Parameters.rowIndex][Locals.i]},  Locals.i++" // set expression to be run recursively 

 

Post-Expression:

Evaluate(Locals.RcrExpr) 

 

where Locals.RcrExpr is:

Evaluate(Locals.WhileExpr) ? (Evaluate(Locals.DoExpr), Evaluate(Locals.RcrExpr)) : "" 

 

 

Message 2 of 2
(2,868 Views)