07-01-2009 09:27 AM
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
07-02-2009 09:05 AM
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.
07-02-2009 02:13 PM
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
07-03-2009 04:38 AM
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.
07-04-2009 12:41 PM
Funny - I was actually thinking the same thing.
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
07-04-2009 08:38 PM
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.
07-06-2009 03:03 PM
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?
07-08-2009 05:53 AM
Jason,
The Spectrometer index is the count of Spectrometers connected.
Connect the appropriate index from which data is expected.
Sundar.
07-08-2009 07:13 AM
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
07-14-2009 11:22 PM
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.