12-17-2008 05:51 AM
Dear all,
i have a small problem manipulating arrays.
I have a 3D array whose Page 0 contains a 2*3 size array.
Now i wish to another row to Page 0. so my array at Page 0 would become 3*3. but its not happening. its only showing d data at first 2 rows and not the 3rd row.
i am attaching my VI to this message. pls have a look at it n let me know the solution.
Thanks,
Ritesh
12-17-2008 05:52 AM
12-17-2008 06:42 AM
Hi Ritesh,
You are trying to Replace NOTHING with SOMETHING. What I mean exactly is you are writing (replacing) data to an empty location, whether be it Row/Column/Page, which will not happen at all. Maybe you can use the Insert into Array primitive to achieve what you want to.
Moreover, you have wired the Index to Replace Data as the Page Index, not the Row Index. This might also be a problem area.
12-17-2008 06:58 AM
HI,
the VI u attached is same as mine.
How can i give the row index to the insert function without mentioning the page no. . i want to insert a row to a particular page. which is just not happening. insert function is only accepting single input. either page or row or column.
Could you pls a post a VI which will insert a row to a particular page ?
Thanks,
Ritesh
12-18-2008 02:07 AM
12-19-2008 01:47 AM - edited 12-19-2008 01:48 AM
Hi Ritesh,
This is copied from LabVIEW Help :
INSERT INTO ARRAY
This function resizes the array along only one dimension. Therefore, you can wire only one index input. The index you wire determines the dimension along which you can insert. For example, to insert row(s), wire the row index, or to insert column(s), wire the column index.
The array you wire to n or n-1 dim array must be the same dimension or a dimension less than the one you wired to n-dim array. For example, you cannot insert a single element into a 2D array, and you cannot insert a single row (a 1D array) into a 3D array. You can, however, insert a 2D array that has a single row into a 3D array. LabVIEW pads the resulting array as necessary.
So, that is why you cannot give in more then one input in the Insert inot array. I am Attaching a couple of ways of manipulation and adding the data.
Vishal
Applications Engineer
National Instruments