07-17-2012 02:28 PM
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!
Solved! Go to Solution.
07-18-2012 06:56 AM
In all honesty, I'd just do it in LabVIEW. You might want to try to add this to the list in this idea.
07-18-2012 12:26 PM
I think that'll be the road I take until something is implemented. Thanks!