11-20-2011 03:10 PM
Dear friends,
I am doing an application that involves optical setup along with a XY scan using stepper motors and also a sensor ( Photo sensor ) to collect in values.
My application has to do with imaging surfaces. XY scan is used to move the surface in x pixels and y pixels, a photo sensor is used to collect the values that are reflected off from the surface. I have successfully completed my XY scan program thanks to members who helped me with that.
My question:
I need a start as to how to start collecting the values that are read in by Photo sensor and store it into a 2D array.
I am a beginner and please help me start with this.
Thanks.
abhi
[ labview 6.1 ]
11-20-2011 03:48 PM
How you collected the data from sensor? Have read the data directly into labVIEW(if so, it should give some kind of voltage graph or data) with DAQ?
Or
Have saved the data into some files outside the labVIEW?
If you want read any files that contains data, I would suggest you to look on File I/O pallet in Programming main pallet.
11-20-2011 04:32 PM
No the data are read into a DAQ and I need to display what it is reading ( eg. waveform ) also store the value into a 2D array so that I can convert it into an image file later .
11-20-2011 06:46 PM
abhi,
If I interpret correctly what you said, your DAQ device output is a waveform. A waveform is a 1D array of data (Y) bundled with a start time (t0) and a time increment (dt). When you get this waveform from your DAQ device, does it represent the entire image or only one line?
If it is the entire image, then use Get Array Components to get the Y array and use Reshape Array to change it to the desired 2D format.
If it is one line of the array, then as above extract the Y array. Use Replace Array Subset to put the data into the appropriate row of a 2D array. Before you start the acquisition, initialize a 2D array of the correct size. The acquistion and Replace Array subset will be inside a loop and the array will be passed from one iteration to the next via a shift register.
Lynn
11-20-2011 08:07 PM
Hi Jhonsold,
When I meant a waveform it means jus one point. Not a full image. Its like the laser is staring at one point and what ever is reflected is shown as a wave over a time axis. (eg a sine wave that doesnt change shape cos it is from a single point ).
However, When moved to the next point it will read in another value and this again will show another wave depending on the surface change of the target.
I hope you got the point.
So in total , the scanning system moves the target in a fixed X and Y pixels. what ever is the values that are obtained by staring at all X*Y points should be stored in a 2D array so that it can be later transformed into a image plot.
If you still have any questions,please let me know. I will try explaining better with a diagram maybe.
Thanks
11-20-2011 08:24 PM
abhi,
If you get a waveform at each x,y location, do you want to display all the waveforms or are you reducing that waveform to a single number at each point?
Lynn
11-20-2011 09:13 PM
11-20-2011 09:39 PM
abhi,
OK. Then the procedure is much like the one line method I posted above, except that you replace each point in the 2D array as you acquire it. One point rather than one line. The X and Y pixel locations correspond to the row and column indexes of the array. Depending on the orientation of your X-Y scan, you may need to transpose or reverse one or both axes. Also note that arrays in LV start the indexing at zero.
Try it. If you have questions about how something works, post what you have tried along with your question or indication of what is not working as you expect.
Lynn
11-20-2011 09:51 PM
OK . I think I get it.
1. I need to accept in the values for each XY point and store it in a array indexed by this X and Y positions.
2. later export them to be viewed as an Image file.
Am I getting it right ?
Thanks Lynn ... ![]()
11-20-2011 10:33 PM
Yes.
I am not sure what is available in LV6.1, but newer versions have several array to image functions.
Lynn