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
(3,147 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
(3,123 Views)