LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistent behavior using Ocean Optics LabVIEW driver

Solved!
Go to solution

Hi There,

 

I noticed an odd behavior when using the Ocean Optics USB2000 Spectrometer. When I use the instrument driver to read the waveform, I get a waveform of length 2022 pixels. When I use Ocean Optics software (SprectraSuite) I get a waveform of length 2048.

 

I first noticed this behavior when I was looking at the spectrum of a light source that is known to be ~870nm. Using the LabVIEW driver I saw a peak at ~857nm, but using the Ocean Optics software I saw the peak at 870nm as expected. Please let me know if you can give any insight to this problem. Thank you,

 

Gregory

0 Kudos
Message 1 of 11
(4,762 Views)

It may be detecting your model number incorrectly.

 

OO spectrometer drivers use the "User data" I32 property of the VISA connection to store the model number.  If it thinks you have a HR 2000 instead, it will parse the pixel data incorrectly to give 2022 points instead.  

 

Can you get that property out and see what the hex encoding of the lower word of it is set to after initializing the spectrometer?

0 Kudos
Message 2 of 11
(4,736 Views)

Hi Kyle,

 

I did probe the "Read Optical Spectrum.vi" to see what model number it was using. It was choosing the "4098" case which corresponds to the USB2000. It looks like it should go from pixel 26 to 2074, however it looks like the output of the VISA reading does not have enough elements (only 2022). It looks like the the data is read in a loop 64 times right now, perhaps I need to read it a couple more times? Here is a snippet of the driver that I'm looking at (see my comment in the pink string constant):

 

Read Optical Spectrum.png

0 Kudos
Message 3 of 11
(4,725 Views)

Actually, I lied! The array that I said was 2022 elements is actually 2048. But since it tries to take the elements from index 26 to 2074, it is cropping some elements from that array. Perhaps "start optical" should be 0 instead of 26?

 

Also, this is repeatable on at least 2 different USB2000 spectrometers.

0 Kudos
Message 4 of 11
(4,708 Views)
Solution
Accepted by topic author Gregory

Just to tie this away, I did end up padding the front of the spectrum array with zeros. This is definitely something that Ocean Optics (or the writer of the drivers) should address. I did not change the driver because it might shoot me in the foot when using one of the other models.

 

Also, I noticed that for the USB2000 Set Integration Time VI the units of time are milliseconds. The USB4000 (and what is suggested by the drivers/examples) use microseconds.

 

Hopefully these drivers can get an update soon!

0 Kudos
Message 5 of 11
(4,617 Views)

Some colleagues were having trouble with a USB4000, so I was checking out their program. Sure enough, using the LabVIEW drivers gives a shifted spectrum compared to Ocean Optics' SpectraSuite software. If I go into the LabVIEW driver and set the start pixel to "0" I get something that looks very similar to the SpectraSuite data, but the first couple of pixels have spikes which is why I think the LabVIEW drivers discard them. Doing so, though, destroys the relationship between wavelength and amplitude, which is the whole point of using a spectrometer! I got the following (confusing) reply from NI, which I believe confirms that the LabVIEW drivers need an update for at least the USB2000 and USB4000 models. I am not sure what the recommendation is to obtain trustworthy results from these instruments in LabVIEW.

 


 

Hello,

Currently the driver is displaying Optical pixels for users using LabVIEW only.  To use all pixels (optical, dark and garbage pixels) you can use the obsoleted Read Spectra VI (instead of Read Optical Spectrum subVI) as a work around to use both LabVIEW and Spectra Suite.
We are working with Ocean Optics to update the driver to display pixels for users only using LabVIEW (optical) and for users using both LabVIEW and Spectra Suite (all pixels).

Best Regards,
National Instruments - Instrument Drivers/IVI Group


 

0 Kudos
Message 6 of 11
(4,424 Views)

Hello,

 

I am having the same problem with the wavelength readout on the Ocean Optics detector.

I am using the STS model.  I downloaded and installed the LabVIEW driver from the website.  It will often work fine the first time I run it or when I reset my computer.  The problem is when I hit stop and then try to run it again.  Then the wavelengths are not calculated correctly.

I did a bit of investigation and the problem appears to be when it reads out the 3 Calibration Coefficients.  I drilled down to this VI and ran it over and over.  Each time it pulls down different coefficients.

I am not sure if this helps you/us find the final solution.  I have recorded the wavelengths as a 1D array and I just load that.  There are no problems with this but it will only work for one detector.  We are making a system and this needs to work for any detector.

 

Help!

0 Kudos
Message 7 of 11
(3,850 Views)

It looks like there has been a driver update since this forum was originally created. Is this behavior showing up in the newest version of the driver? Also, you'll probably get more eyes on this forum post if you create a new thread and reference this one.

Message 8 of 11
(3,818 Views)

The most recent driver I tried they had fixed this problem.

Message 9 of 11
(3,812 Views)

Awesome!

 

Do you have a link for the most recent one.  I must have gotten the wrong site.

0 Kudos
Message 10 of 11
(3,810 Views)