Multiple NI Chassis Data Acquisition in multiple sessions

7 次查看(过去 30 天)
I am trying to acquire data from 3 NI data acquisition chassis simultaneously (2 cDAQ 9191 and 1 cDAQ 9184). When I try to use one single session for all three data acquisition objects it throws an NI error 200414 "Requested sample clock is invalid." I can acquire data using three different daq sessions but the data shows a significant phase lag of about 0.5-1.0 sec which is unacceptable. I am plotting event.TimeStamps vs. event.Data. After speaking with tech support, the commands s.StartBackground should start the daq devices almost simultaneously and they think event.Timestamps are created by Matlab which is why it shows a lag. Are event.TimeStamps created by the chassis or matlab itself? Is there a better way to synchronize the data? The chassis do not have a terminal to add an external trigger or clock.
handles.ai=daq.createSession('ni');
handles.ai1=daq.createSession('ni');
handles.ai2=daq.createSession('ni');
handles.sensitivities = xlsread('SensorInfo','C2:C25');
for i=4
handles.chan = handles.ai.addAnalogInputChannel('ModalDAQMod1',i-1,'Accelerometer');
handles.chan.InputType='PseudoDifferential';
handles.chan.Coupling='AC';
handles.chan.Sensitivity=handles.sensitivities(i);
handles.chan = handles.ai1.addAnalogInputChannel('ModalDAQ2Mod1',i-1,'Accelerometer');
handles.chan.InputType='PseudoDifferential';
handles.chan.Coupling='AC';
handles.chan.Sensitivity=handles.sensitivities(i);
handles.chan = handles.ai2.addAnalogInputChannel('ModalDAQ3Mod1',i-1,'Accelerometer');
handles.chan.InputType='PseudoDifferential';
handles.chan.Coupling='AC';
handles.chan.Sensitivity=handles.sensitivities(i);
handles.chan = handles.ai2.addAnalogInputChannel('ModalDAQ3Mod2',i-1,'Accelerometer');
handles.chan.InputType='PseudoDifferential';
handles.chan.Coupling='AC';
handles.chan.Sensitivity=handles.sensitivities(i);
end
handles.ai.Rate= round(floor(2048));
handles.ai.DurationInSeconds=80;
handles.ai.NotifyWhenDataAvailableExceeds=2048*4;
handles.ai.IsContinuous=false;
handles.ai1.Rate= 2048;
handles.ai1.DurationInSeconds=80;
handles.ai1.NotifyWhenDataAvailableExceeds=2048*4;
handles.ai1.IsContinuous=false;
handles.ai2.Rate= 2048;
handles.ai2.DurationInSeconds=80;
handles.ai2.NotifyWhenDataAvailableExceeds=2048*4;
handles.ai2.IsContinuous=false;
handles.lh = handles.ai.addlistener('DataAvailable', @(src,event) temp_1(src,event,handles)); % creates a new listener.
handles.lh1 = handles.ai1.addlistener('DataAvailable', @(src,event) temp_2(src,event,handles)); % creates a new listener.
handles.lh2 = handles.ai2.addlistener('DataAvailable', @(src,event) temp_3(src,event,handles)); % creates a new listener.
handles.ai.prepare
handles.ai1.prepare
handles.ai2.prepare
handles.ai.startBackground();
handles.ai1.startBackground();
handles.ai2.startBackground();
  2 个评论
Austin Bond
Austin Bond 2013-4-24
I second this question!
MathWorks support would be nice here!!!
Kelvin
Kelvin 2014-11-11
How did you start multiple sessions simultaneously? I cannot start a second session once the first one is running.

请先登录,再进行评论。

回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by