Speeding Up National Instruments Data Acquisition Retrigger

1 view (last 30 days)
I am using a NI USB-6212 DAQ for data collection. Data collection is triggered using an external source. The data trigger events occur every 10msec, but there seems to be ~100msec delay between trigger and actual data collection. I believe this is probably do to some overhead in resetting the trigger state. Does anyone know how this can be sped up? Code is below as well as an example output. The re-trigger signal occurs every 10msec.
% test NI-USB6212 data acquistion speed
close all
clearvars
clc
dev=daq.getDevices;
ID = dev.ID;
Duration = 10e-3;
SampleRate = 100e3;
s = daq.createSession('ni');
s.NumberOfScans = Duration*SampleRate;
s.Rate = SampleRate;
s.addAnalogInputChannel(ID, 'ai0', 'Voltage');
s.Channels(1).TerminalConfig = 'SingleEnded';
s.addTriggerConnection('External','Dev1/PFI0','StartTrigger')
s.ExternalTriggerTimeout = 30;
s.TriggersPerRun = 10;
[data, times] = s.startForeground();
plot(times,data,'.')
xlabel('time, sec')
ylabel('amp, V')

Answers (0)

Community Treasure Hunt

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

Start Hunting!