LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

3 dimensional array

Hello

I don't know if this is the right title. I have a vi that creates a 2D array with 100 elements by 100 hundred elements. I was wanting this to be the Z axis. Then for each element i was wanting it to have an X-value and Y-value.

 

Any ideas on how to do this would be appreciated.

Thanks, Craig

0 Kudos
Message 1 of 7
(5,278 Views)

Sounds like what you want is  a two dimensional array of a two item cluster, where the cluster is made up of an "X -value" item and a "Y-value" item. Is that what you want a 100X100 array of paired values?

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 2 of 7
(5,273 Views)

You can also use a 100x100 array of complex numbers.

Define the real part as x and the imaginary part as y. Keeps the data structures simple. 😄

Message 3 of 7
(5,267 Views)

If i use a complex array would it not just give one output. I intend to output each array to a oscilloscope. So when i index an X-array and a Y-array it will give positions on the oscilloscope. Then for each position produced on the oscilloscope it would turn the pointer on or off depending on the third array produced by my VI. For my VI i produced I would like to have the elements have a location provided by an X-array and Y-array.

 

Any Ideas

Craig

0 Kudos
Message 4 of 7
(5,243 Views)

Well, you should probably have used an entire paragraph in the initial problem description. 😄 It is still not entirely clear.

 

Originally, you said the 2D array has 100x100 (=10000) elements. Now you have an x array and a y array...

 

XY graphs accept compex 1D arrays directly and will graph RE vs. IM.

In order to turn off a point, use a third array of the same lenght and make the element either 0 or NaN. Add it to your complex array before graphing, taking advantage of the fact that elements containing NaN don't show.

 

It would be so much easier if you could attach a small VI containing typical arrays as default values so we get a better idea on what you actually have.

0 Kudos
Message 5 of 7
(5,238 Views)

The Vi below imports an image, thresholds it and output to an array of ones and zeros. These ones and zeros will turn the dot on the osciloscope on and off. I need two other arrays that will give them a position on the osciloscope i.e the X-array and the Y-array. So i was wondering if i could give each element a positon rather have three rather large arrays. The reason why i am not wanting to use a complex array is because the osciloscope has two seperate inputs for X and Y. So therefore i need to produce 2 seperate voltages which i have found to be easier without using complex arrays.

 

Thanks

Craig 

 

P.S this VI dosen't scale the image to 100x100 array. So a larger resolution picture would be more difficult to work with. I have another working VI that scales the image but it isn't at this computer.

0 Kudos
Message 6 of 7
(5,231 Views)

Sorry, I don't have IMAQ.

 

Do you need to scall the full 2D array on the scope or is it sufficient to only send the ON positions? What percentage of elements are typically ON?

 

If you want to send the entire grid:

Build 3 arrays in the inner loop, reshape them to a 1D array and send to the scope, e.g. as follows.

 

 

(Isn't there a function to turn an entire image into a numeric array directly? Might be more efficient than tube-feeding one pixels at a time....)

0 Kudos
Message 7 of 7
(5,224 Views)