Is there a possible method to reduce time latency in DAQ data acquisition in GUIDE app designer?

1 view (last 30 days)
We are trying to acquire data in loops using the current DAQ syntax for data acquisiton while using the GUIDE app designer. However, when looping data acquisition there is latency in the collection. I understand that there is no way of completely reducing this latency to zero, but is there any common practice to help reduce this to a reasonable ammount? Also, this DAQ acquisition has already been tried in the new app designer, but there is even more latency that occurs in that format due to background operations. Here is a copy of the code we are using:
function daqAcquisiton()
d=daq("ni");
d.flush
trialNum=20; % User edits
lagtime=zeros(trialNum,1);
for i=1:trialNum
tic
AvailableDevice = daqlist;
d=daq("ni");
d.Rate=2000;
Ch1=addinput(d,AvailableDevice.DeviceID,'ai10','Voltage'); % Input config options here
d.ScansAvailableFcnCount = 14000;
d.ScansAvailableFcn = @(obj,evt)plotMyData(i);
start(d,'Duration',seconds(7))
pause(8)
%d.flush
lagtime(i) = toc;
disp(lagtime(i))
d.flush
end
end

Answers (0)

Categories

Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!