LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Splitting 2d Array

Hi
 
I think I am going mad. I have the attached VI that attaches extracts 3 values from a database via SQL. I then convert the variants to data. This gives me a 2d array - why is this and not a 1x3array? I want to strip the 3 values out by unbundling them - butI can't seem to convert the array to a 1d array.
 
Any help would be most appreciated.
 
Cheers
 
Dave
0 Kudos
Message 1 of 5
(3,142 Views)
The attached potential fix, gives you a 1d array be selecting the correct row, and taking all columns.  If you need columns instead of rows, you can mod it easily, see embedded comment.  Hopefully it points you in the right direction. (LV8.0)

Paul
0 Kudos
Message 2 of 5
(3,134 Views)

Hi

I can't seem to open the code as I am working in Labview 7.1.

Cheers

Dave

0 Kudos
Message 3 of 5
(3,131 Views)
I do not have the DB toolkit loaded with my version 8 or 8.2, so I attached a jpg of the diagram.  Unfortunately I can not downcovert the VI.  so hopefully the image provides you with what you need.  The primitive function that I have used is, index array fround in the array palette.

Message Edited by Stradis on 06-18-2007 07:48 AM


Paul
0 Kudos
Message 4 of 5
(3,126 Views)
Hi Dave

The select statement might return multiple data sets. That's why the dimensions of the returned array will be "number of data sets" x 3. If there's just one data set the array will be 1x3 elements, but still it's a 2D array (2 nested for loops with auto-indexing will always return a 2D-array). To extract the first data set, index the 2D array like Paul suggested (row 0). Also, you'll have to index (not unbundle) the resulting 1D-array to get your data.

Hope this helps,
Daniel

0 Kudos
Message 5 of 5
(3,115 Views)