07-16-2012 08:25 AM
Hi all,
I am facing a strange problem with the insert into array function or maybe I didn't understand the function right.
As you can see on the attached VI I want to add a 1D array on a existing row. Therefore, I read the row which I want to modify, add my 1D array so I get a larger array (still 1D) and insert it to the existing 2D array on the place where I read before.
My problem is that the array isn't growing when I insert the modified 1D array. I the example the modified 2D array should have a size of 2x7 but it is still 2x4.
Hope anyone can help me.
Ben
07-16-2012 08:34 AM
Bump real post
07-16-2012 11:04 AM - edited 07-16-2012 11:06 AM
The help clearly says that "This function resizes the array along only one dimension."
You are growing downward by inserting rows, thus you are not growing in the other dimension and the data is truncated.
If you want to grow in two dimensions, you need to add more code, e.g. insert a few dummy columns in the upper data trace before inserting the oversized row. Seems like a memory allocation nightmare. It would seem better to decide on a suitable size from the beginning, then operate in place.
(For simplicity, you could have attached an example VI containing default data in the controls and not containing complicated typedefs that we don't have)
07-17-2012 01:28 AM
Okey, I see it's getting a little bit more complicate than I expected.
This really seems to become a memory nightmare.
Anyway, thank you again for your quick help.
07-17-2012 02:22 PM
Here are some VIs I started and wanted to submit to OpenG. (Need to get around to that one of these days.) They should cover what you want.
07-18-2012 12:38 AM
Hi Mark,
if you publish these VIs, please make sure you saved them for previous LV versions.
Thanks