LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

insert array subset

I have been trying to use the replace array subset to insert the data from a 1-d array while creating a 2-d array by combining the data inserted with a string array that is created. The second auto indexed data is writing over the first array data that was written. I know this has something to do with autoindexing or adding another loop, but I can not get it to work. Here is what I have working with the problem described above. Also, the data that I am adding to the initialized array is the diode and transistor parameters. Basically, I have to put them in a single array and sort them. After getting the data in the array correctly, I want to sort it by the column header Oven Socket #: and put the data in chronological order, which I am using a VI that sorts 2d arrays and this seems to work correctly. I realize that the diode and transistor parameters are not of the same size, I will be putting N/A in two of the element positions for the diode.
Download All
0 Kudos
Message 1 of 33
(4,672 Views)


@rlg50 wrote:
I have been trying to use the replace array subset to insert the data from a 1-d array while creating a 2-d array by combining the data inserted with a string array that is created. The second auto indexed data is writing over the first array data that was written. I know this has something to do with autoindexing or adding another loop, but I can not get it to work.

Your description is way too confusing for me and your images are way oversized.

"Replace array subset" cannot be used to "Create" (sic) a 2D array. It will not change the dimension or size, but just replace certain elements with a new value.

Please reduce your problem to a small VI that shows the problem. Add a few arrays as diagram constants and tell us what kind of output you want.

0 Kudos
Message 2 of 33
(4,648 Views)
It is somewhat confusing with what you are trying to do.  If you are trying to create a 2-D array out of multiple 1-D arrays, why not use the 'build array' function?


-Bob
Message 3 of 33
(4,625 Views)
I am not sure why this worked this time. I have tried that as well as other methods and when I went through and started from scratch it worked. Thanks for the suggestion, which caused me to do a simpler progam and get it to working.
0 Kudos
Message 4 of 33
(4,599 Views)
On another note with this same VI, I am sorting the final array according the data in a specific column. I have a 2-D array sort function that I have tested on the individual arrays which context help shows to be 2-d arrays. However, after wiring both 2-d arrays to the build array function, the context help shows the output array to be a 3-d array. Is this possible in labview? What exactly does 3-d array in labview mean? TIA.
0 Kudos
Message 5 of 33
(4,595 Views)
If you think of arrays in physical space, what you did with the build array function would be like taking collection of blocks, each grouped into rectangles (say, 2 blocks wide, and 3 blocks long), and stacking them on top of eachother.  The result is a new shape in three dimensional space, 2 blocks wide, 3 blocks long, and 2 blocks deep.  In LV, a 3d array refers to a collection of data with which each element is referred to using 3 indeces.
 
If you want to simply add the second 2d array onto the first while keeping the resultant array as 2d, right click on the build array node and check "concatenate inputs".
-Cory
Message 6 of 33
(4,584 Views)
Yes, what he said Smiley Very Happy.

-Bob

Message Edited by B O B on 08-17-2007 09:43 AM

Message 7 of 33
(4,580 Views)

Right click on the build array function.  It will have a menu choice "concatenate inputs".  If this is unchecked, it builds arrays by adding dimensions.  Two 1-D arrays become a 2-D array. (array 1 in column 1, array 2 in column 2) Two 2-D arrays become a 3-D array. (Array 1 in sheet 1, array 2 in sheet 2).  If it is checked, it concatenates the arrays so the finished array has the same number of dimensions, it just grows in one direction.  Two 1-D arrays becomes a longer 1-D array.

A 3-D array in labview is just like a 3-D array in any language.  Rows, then columns, then "sheets".   You can have some ridiculous number of dimensions (at least 20) to the point you can't visualize them and they would be really difficult to work with.

Message 8 of 33
(4,573 Views)
Thanks. If I may, I have one other question. The sorting function that I am using sorts according to the data in a column. This data is a number (dbl). It's a 2d array sorting function and it appears to be sorting only by the first number and not the entire number in the column. For example, I have numbers 10, 15, 20, 1, 4, and 7. After sorting the columns, I am left with 1, 10, 15, 20, 4,  and 7. What would make a sort function only look at the first number?
0 Kudos
Message 9 of 33
(4,566 Views)
Thanks BOB.
0 Kudos
Message 10 of 33
(4,560 Views)