LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

1D to 3D Array Parser - NB

Solved!
Go to solution

 

Trying to parse a 4500000 element UINT16 array

from an NI digitizer into a 3D array.

 

I am a CVI user moving to LV.

I have some LV experience from years ago.

 

The C src code (attached) is exactly what I want to do.

Whats not finished is the end, wherein I'd like to select

and display pages across the X-Z plane.

 

Any help on where I went wrong.

 

TIA.

 

-CSK

Download All
0 Kudos
Message 1 of 6
(3,497 Views)

My c is a bit rusty. Could you explain things in plain english words instead? 🙂 Shouldn't be too difficult. 😄

  

Your LabVIEW code is highly flawed. For example you have autiondexing of arrays with different sizes, the shortest always wins and determines the number of iterations, no matter what number you wire to N of the loop. Don't autoindex on the big 1D array at all. In the second loop, you are generating negative indexes. that's probably not right.

 

Your 3D array should be kept in shift registers and you should use "replace array subset" to insert your data. "Insert into array" will grow the array, keeping the existings zeroes at the same time.

 

If you play your code right, you might be able to generate the 3D array using autoindexing, no need for shift registers and "init array".

Message 2 of 6
(3,476 Views)

Alright. 14 years ago. That bad, huh?

Its a scanning x-y laser system.
For each odd scan, array of z has to be flipped before placing in 3D array

Right now, summing 10 elements of 1D per 3D element, maybe averaging later

 

Is this the fastest method in LV to do this?

 

INPUT:  1D arrray 4500000 UINT16 from PXI5122 Digitizer

OUTPUT: 3D array [x][y][z] UINT16

where:
x=200
y=150
z=15


x,y,z=0

Loop y[0..149]  '150 elements
    Loop x [0..199]   '200 elements
    Loop z [0..14]   'increase z by 1 for ea loop  15 elements
            Sum 10 elements, place in 3D array as z element [x][y][z]
       End Loop  z 
        inc x
        Loop z [14..0]    'decrease z by 1 for ea loop
            Sum 10 elements, place in 3D array as z element [x][y][z]
        End Loop z
    End Loop x
End Loop y

Message Edited by csk on 12-15-2008 07:47 AM
0 Kudos
Message 3 of 6
(3,457 Views)

Here is a very rough draft. You probably need to tweak it but it shows the general idea. Modify as needed.

 

See if it makes sense to you.

 

(First we process 150 at a time, avaraging 10 adjacents, and reversing the resulting size=15 arrays for odd indexes. Then we simply reshape it into the desired 3D array at the end.)

 

 

 

 

 

Message Edited by altenbach on 12-15-2008 11:42 AM
Download All
Message 4 of 6
(3,430 Views)

It correctly processes the first 150 elements (array position 140)

but in the second loop jumps to a starting element of 1500 (10*150)

instead of 150.

 

I think it should just continue to add 10.

 

 

 

0 Kudos
Message 5 of 6
(3,394 Views)
Solution
Accepted by topic author csk
Yes, there are probably bugs. I have not really tested it. My code just shows the rought approach. Probably needs a few tweaks here and there. 😄
Message 6 of 6
(3,391 Views)