Is it possible to acquire spectra from two Ocean Optics spectrometers simultaneously using OmniDriver?

5 views (last 30 days)
I use OmniDriver to run Ocean Optics spectrometers and I need to have simultaneous measurement from two spectrometers in real-time. When I connect both USB spectrometers and run the "demo_OceanOptics.m" script (part of it is shown below), it says "Found 2 Ocean Optics Spectrometer(s)" but it only displays the name and serial number for one of them and accordingly the spectral data of that one only. Is it possible to modify the script so it can produce data from both spectrometers at the same time? Any help is highly appreciated!
Thanks
%%Create MATLAB Instrument OmniDriver object.
spectrometerObj = icdevice('OceanOptics_OmniDriver.mdd');
%%Connect to the instrument.
connect(spectrometerObj);
disp(spectrometerObj);
%%Set parameters for spectrum acquisition.
% integration time for sensor.
integrationTime = 100000;
% Spectrometer index to use (first spectrometer by default).
spectrometerIndex = 0;
% Channel index to use (first channel by default).
channelIndex = 0;
% Enable flag.
enable = 1;
%%Identify the spectrometer connected.
% Get number of spectrometers connected.
numOfSpectrometers = invoke(spectrometerObj, 'getNumberOfSpectrometersFound');
display(['Found ' num2str(numOfSpectrometers) ' Ocean Optics spectrometer(s).']);
% Get spectrometer name.
spectrometerName = invoke(spectrometerObj, 'getName', spectrometerIndex);
% Get spectrometer serial number.
spectrometerSerialNumber = invoke(spectrometerObj, 'getSerialNumber', spectrometerIndex);
display(['Model Name : ' spectrometerName])
display(['Model S/N : ' spectrometerSerialNumber]);

Answers (1)

Shruti Sapre
Shruti Sapre on 4 Sep 2015
Hi Muyiwa,
I understand that you want to get data from two spectrometers simultaneously. When you call the function “icdevice”, could you try to add the resource name along with the “mdd” file? An example of this is given in the documentation link below:
If that works, you could try to run the two devices in parallel using the Parallel Computing Toolbox and retrieve data simultaneously.
Hope this helps!
-Shruti

Categories

Find more on Instrument Control Toolbox Supported Hardware in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!