NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

copy array 1D to array 2D

Hi all,

 

In teststand (2016), I have 2 arrays
1 1D array : 'locals.tab1 [0..4]
1 2D array : 'locals.tab2 [0..2] [0..4]

The following operation works :
Locals.tab1 = locals.tab2 [1]
The values contained in tab2 in index 1 are copied into tab1.
But the following operation doesn't work
Locals.tab2 [1] = locals.tab1
The values of tab1 are not copied into tab1 [1]

Would anyone have a solution, knowing that I do not want to have to go through the whole array

0 Kudos
Message 1 of 3
(3,181 Views)

This looks like a bug in my opinion.  The expression allows it and even in the Watch View pane you can do it and appears to work.  However, it is just not propogating back to the variable.  Unfortunately I don't know of another way without iterating through the array.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 3
(3,151 Views)

It is likely that "Locals.tab2 [1]" is creating a new property object and the value of "locals.tab1" are being assigned. The new property object is then released.

You can see this by looking at Locals.ObjRef after executing the following expression:

    Locals.ObjRef = Locals.tab2 [1] = locals.tab1

 

I have created a bug report (ID 622963) to investigate this further.

 

I believe that you will have to operate on the arrays in a code module.

Scott Richardson
https://testeract.com
Message 3 of 3
(3,143 Views)