NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you pass one row of a 2D array as a 1D array parameter?

Solved!
Go to solution

I have a 18x18 2D array of numbers ( Locals.TestMeasurements ). I would like to pass the array by rows to a LabWindows app, but I can't find a function for specifying a row as a parameter without creating an additional 1D array for temporary storage. What I am looking for is something like

 

GetRow( Locals.TestMeasurements, Locals.Index )   where Locals.Index is my row specifier.

 

Any suggestions? It seems like this should exist in TestStand but I can't find the function. Thanks

0 Kudos
Message 1 of 5
(5,458 Views)
Solution
Accepted by topic author Jeff__Lucas

Locals.TestMeasurement[Locals.Index]

 

works for me. You might need TestStand 2012 or newer though.

 

Not sure which index you are treating as the row. If it's the second one you can do this:

 

Locals.TestMeasurement[0..][Locals.Index]

 

Assuming 0 is the lower bound for your first index.

 

For more details on what .. means. See the help for the range operator for expressions (Under Operators/Other in the Operators/Functions tab of the expression editing dialog).

 

Hope this helps,

-Doug

Message 2 of 5
(5,444 Views)

I had forgotten to mention that we are still using NI TestStand 2010. That solution doesn't work in this version, but it is good to know it is resolved in TS 2012. Thanks for the reply.

0 Kudos
Message 3 of 5
(5,416 Views)

Hi Doug,

 

Thanks for pointing out!,
The next days i will have a task where i have to use this feature.

Regards

juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 5
(5,196 Views)

Here it is 2020, I am using 2017 SP1, I STILL can't do it. Spent an hour trying different combinations:

Making the first array the column then the row. Then, passing Array[index], Array[index][0..], Array[index][0..23], Array[0..][index], and Array[0..23][index].  So I said, screw it, and decided to just pass a 2d array and program around it.

 

Meanwhile, it is getting harder and harder to find TestStand solutions after National Instruments changed their name to NI.  Did you guys forget to post the TestStand solutions?

Message 5 of 5
(2,244 Views)