LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping pixels to wavelength

Sorry its just 512 values of wavelength instead of 512 according values!!

0 Kudos
Message 11 of 18
(1,295 Views)

Please include some data. Run your VI so that a typical image is shown on Waveform Graph. Stop the VI. Then Edit >> Make Current Values Default. Save (to a different name if you wish). Post that VI. Then we will have some data to work with. The VI you posted has 50x512 zeros in Image Data.

 

Are you using Run Continuously? STOP! That mode is only for specialized troubleshooting and should not be used to run a program. Enclose the parts which need to repeat (Read Image Data, Write to File and the scaling and displays) and put everything else before or after the loop. Stop the loop with a front panel Stop button.

 

Lynn

0 Kudos
Message 12 of 18
(1,288 Views)

@shivy92 wrote:

I have attached my VI below. the problem that we are having now is we should get 512 according values of wavelength, but what the VI does is picks the highest value of them all. How can we correct that?

 



I don't completely understand your problem.  How does your VI "picks" any thing?

 

 I see you have a For Loop that creates an array of indices from 0 to 511.  Then that goes to a formula express VI that has a polynomial formula that looks pretty much like the one you wrote earlier.  However, you don't do anything with the result output of that VI.

 

Why not?

 

When I put an indicator on that output, it gives an array from ~1595 to ~1509.  Is that what you expect?

 

 

Now the lower part of your code has a Formula2 Express VI which appears to have the same formula.  But it only acts on a scalar, the Xscale.multiplier which happens to be 1.  I don't understand why you feed that into a Build XY graph.  You feed in a scalar of 1 has your X, and a 2-D array has your Y.  What is that supposed to mean?  Thus you only get a single point on your graph (and then only if you set the plot to show the points.)

 

My feeling is that your code just isn't written to do whatever you think you are trying to do with it.  I partially blame the Express VI's because they allow stuff to be wired together, hiding the details under the hood, including stuff that has no business belonging together.  What else besides an Express VI can allow a single piece of data to be somehow combined with a 2-D array and written to a graph without broken wires?

0 Kudos
Message 13 of 18
(1,284 Views)

Looks like you miswired in your 'Build XY Graph2' Express VI - you wired a constant which was the XScale.Multipler of the waveform graph   You then write this constant to your measurement file, which is maybe why you are only getting the highest value?

 

I think want you want to wire is the 'Result' in the Formula Express VI above it, which presumably takes tne array of pixel values (0...511), and gives you the wavelength.for each pixel.   Then use this as the x values in your Build XY Graph

0 Kudos
Message 14 of 18
(1,276 Views)

For the lower part of the code, where we have formula2express, we need to have the output as a vector array showing all the 512 pixels converted into wavelength rather than a single scalar value. I didn’t know that the Xscale multiplier acts only on a scalar. Is there anyway we could get the whole set of pixel values converted into the wavelength so that we can feed that to BuildXY graph and get an output waveform.

regards.

0 Kudos
Message 15 of 18
(1,251 Views)

If you have a value, feed it into the formula express VI and you get a value.

If you have an array, feed it into the formula express VI and you get an array.

0 Kudos
Message 16 of 18
(1,241 Views)

HI, I am trying to use the gaussian fit but dont get any data there when i run my vi. Can someone help me understand what the error is? I have attached my vi here. The input to my vi is through the imon which the gives the values of y axis on the graph

0 Kudos
Message 17 of 18
(1,219 Views)

Any updates of your problem? I am trying to plot the intensity vs wavelength based on IMAQ ImageToArray vi..Any suggestions? Thanks!

0 Kudos
Message 18 of 18
(1,153 Views)