NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get matrice line

hello, 

 

i have a matrix and i need to get lines of this matrix... 

 

Any help please ! 

0 Kudos
Message 1 of 5
(2,814 Views)

Hey Monty,

 

Can you be more specific on what you need from the matrix? Is it stored in a TS container or is it from your code module?

 

A screen shot of what you are trying to get would probably help, too

 

Thanks!

Ben H.
Systems Engineer
National Instruments
0 Kudos
Message 2 of 5
(2,805 Views)

Can you give us some more information?   I thought TestStand treats matrices as 2D arrays?

Message 3 of 5
(2,804 Views)

thanks for yours responses, 

 

i have a 2D Table "A" and another one but 1D "B" :  A[][] and B[]. 

i need to get lines of A, and stock them on B... 

 

Finally i get a solution : B[] = A[0..][i] 

 

You agree ?

0 Kudos
Message 4 of 5
(2,795 Views)

The best way to do this is to use a for loop to go through each element of the array and cast the value at A[i][j] to B[i]. The question is do you want to do with with TestStand expressions, or make a code module.

 

I would suggest making a code module as it would be more straight forward, especially if you are using LabVIEW. With LabVIEW, simply use the index array function and pass your 2D array in as a control, and your 1D as an indicator to populate a array variable in TestStand.

 

The expression in TestStand would be similar, but more manual. You would need to create a for loop to step though each index, the write an expression to take the element and place it into an index in B. Something like:

 

for (int i = 0-->x)Locals.B[i] = Locals.A[i][0]

 

Again, I would recommend just making a code module to do this instead

 

Hope that helps!

Ben H.
Systems Engineer
National Instruments
0 Kudos
Message 5 of 5
(2,774 Views)