12-14-2008 08:44 PM
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
Solved! Go to Solution.
12-15-2008 12:08 AM
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".
12-15-2008 07:45 AM - edited 12-15-2008 07:47 AM
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
12-15-2008 01:41 PM - edited 12-15-2008 01:42 PM
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.)
12-17-2008 10:33 AM
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.
12-17-2008 11:03 AM