NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Easy way to extract row from two dimensional array?

Solved!
Go to solution

Is there an easy way to extract a row from a two dimensional array? I have a two dimensional array that I'm considering as an array of pin lists, where each pin list is an array of numbers. I'd like to iterate and extract one row at a time to send it into a vi. Currently I'm looking at doing it a bit of a long way, and was wondering if there was an easier way. The long way:

 

GetArrayBounds( Locals.ArrayOfPinsToTestAtOnce, Locals.BogusString , Locals.ArrayBounds ), // Get the amount of rows and columns into Locals.ArrayBounds
Locals.ElementsPerList = Val( Mid( Locals.ArrayBounds, 1, 1 ) ), //Get number of pins per list
Locals.NumberOfLists = Val( Mid( Locals.ArrayBounds, 4, 1 ) ), //Extract number of lists
SetArrayBounds( Locals.OneRow, "[0]","[" + Str( Locals.ElementsPerList ) + "]" ) //Set Array bounds for array of one row
for( int i = 0; i < Locals.NumberOfGroups; i++ ) //Would be done in TestStand step, just for easy reading
{
    for( int j = 0; j < Locals.ElementsPerList; j++) //Also would be done in TestStand step
        Locals.OneRow[j] = ArrayOfPinsToTestAtOnce[j][i]
    //EXECUTE STEP HERE(Locals.OneRow)
}

 Thanks for any advice!

0 Kudos
Message 1 of 3
(3,133 Views)
Solution
Accepted by topic author BClarke

In all honesty, I'd just do it in LabVIEW.  You might want to try to add this to the list in this idea.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3
(3,122 Views)

I think that'll be the road I take until something is implemented. Thanks!

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