LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace array subset

Solved!
Go to solution

Dear GerdW,

thank you again (previous message). 

Now in your code, I found that when the new column has a dimension or length that is higher than the initial column length, the new elements are not appearing in the output array. 

In that case, the initial array has not enough length (or dimension is too small) to welcome new elements. 

Should I create a new array with the new length, and then insert the other columns (unchanged ones) into this new array ?  

What is the best strategy ? 

yours

 

0 Kudos
Message 11 of 13
(490 Views)

Hi arienai,

 

you can only replace existing array elements!

That's what I meant, when I wrote you need to check length of elements to replace…

 

Should I create a new array with the new length, and then insert the other columns (unchanged ones) into this new array ? What is the best strategy ?

There's no "best" strategy!

You need to create a larger array anyway, either by appending new rows or by copying into a new, larger array. Both methods require the LabVIEW memory manager to handle new blocks of memory: when your arrays get large (in sense of "huge") this can be a problem…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 12 of 13
(487 Views)

thank you GerdW,

the max length is about 2000 or 3000 elements in 1 column. I guess this might not become an issue for a computer. My program is just reading some element of this array, with a sampling time that is in seconds range. 

I manipulate the array just once or twice, then start automation (the program read elements and send commands). 

Yours

 

 

0 Kudos
Message 13 of 13
(485 Views)