LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Ocean Optics USB4000 Spectrometer

Hi Sundar,

 

I understand if you can't share the drivers you built directly, but it would be helpful if you could share more details of how you accessed the COM interface.  I've never attempted anything like this, but I would be interested in learning how.  Is there any documentation?  In general terms, how is this done?

 

Any info you can provide would be helpful.

 

Thanks,

Jason

 

 

0 Kudos
Message 51 of 286
(6,150 Views)

Jason,

Here are some basic Operations of Omni Drivers with ActiveX controls.

To use them however you would the OMNI SPAM drivers to be installed

supplied by Ocean Optics.

In a similar way to this you could build the SPAM API`s with LabVIEW.

Do let me know if they are help ful or need any further assistance.

 

Sundar.

Message 52 of 286
(6,121 Views)

Sundar,

 

Thanks for the VIs!  I'd never worked with the ActiveX controls before, so your code made for an excellent tutorial.  I work for an OEM, so I had access to the OmniDriver - but up until now I've been using OO's wrapper VIs (the ones with no error trapping).  This is SO much nicer.  Now I'm wondering why OO isn't doing it this way...

 

Thanks again!

Jason

0 Kudos
Message 53 of 286
(6,106 Views)

Good to know they are of some help.

It was only the need of hour that I turned away 

from Dll`s. More over I dint face major issues 

using these comapred to use of Dll`s.

 

May  be we could build better library files

& give to OO  🙂

 

Sundar.

Message 54 of 286
(6,089 Views)

Funny - I was actually thinking the same thing. Smiley Happy

 

I did run into a snag, though.  I'm working on a project right now that requires at least two (maybe more) independent programs running spectrometers on the same computer, possibly at the same time.  I worked out a system where an Action Engine is used to initialize the spectrometers and reserve one for each program.  The problem is that when I'm running the acquisitions, the slowest spectrometer's integration time is used for ALL spectrometers.  When I get back into work, I'm planning on trying two things -

 

1) Using the highspeedacq_getspectrum methods instead of getspectrum (because I suspect it's a multithreading issue)

 

2) Creating and initializing multiple activeX controls, then using one for each spectrometer. (this would be the desperation ploy)

 

Do you have any other suggestions?

 

Jason

0 Kudos
Message 55 of 286
(6,071 Views)

Make sure to pass individual references to & from each of the spectrometer.

since all the objects to the individual spectrometer are referenced 

by unique ID`s . One such example is the CIE color

 

Sundar.

0 Kudos
Message 56 of 286
(6,061 Views)

I'm not sure I'm follow you here... When I open the automation object, that creates the reference that must then be passed to the Ocean Optics methods.  While I can change the COM_spectrometerIndex parameter, I still use the same reference.  How can I pass "individual references" if I am required to use that same reference for all methods? 

 

 

 

 

0 Kudos
Message 57 of 286
(6,029 Views)

Jason,

The Spectrometer index is the count of Spectrometers connected.

Connect the appropriate index from which data is expected.

 

 

Sundar.

0 Kudos
Message 58 of 286
(5,991 Views)

Sundar,

 

I thought that would work too - unfortunately, it doesn't.  It appears that you can't use the COM object in a multithreaded mode.  The GetSpectrum method appears to always run in serial.  I've tried:

 

1) Creating duplicate COM objects and using one per spectrometer - Crashed

2) Wrapping the GetSpectrum call a subvi and setting it to reentrant - no change, still slow

3) Wrapping the GetSpectrum call into two different subvis and assigning them to other execution threads (other1 and other2) - no change, still slow

4) Allocating space and then using the high speed acquisition calls - interesting result.   It appeared that both spectrometers were writing to the same memory space so that regardless of how I set the spectrometer index, I would get the same spectrum back on both read calls (but from a random spectrometer).

 

After talking with the engineers at OO, it looks like COM objects are great when working with a single spectrometer - not so much when you need multiple ones.  I've moved on to writing my own VISA driver (see http://forums.ni.com/ni/board/message?board.id=170&message.id=404069&query.id=22008#M404069) and so far, it looks promising.

 

Thanks for all your help 

Message 59 of 286
(5,984 Views)

Jason ,

havent been that fortunate enough to work with multiple spectrometers.

However do let know how you have solve this issue of handling more than

one spectrometers.

 

Sundar.

0 Kudos
Message 60 of 286
(5,899 Views)