How to collect last bits of data from background acquisition
1 次查看(过去 30 天)
显示 更早的评论
function trial
s = daq.createSession('ni');
addAnalogInputChannel(s,'Dev1', 'ai0', 'Voltage');
% addDigitalChannel(s,'Dev1','port0/line11','InputOnly');
s.IsContinuous = true;
s.Rate = 100;
s.NotifyWhenDataAvailableExceeds = 100;
% s.DurationInSeconds = 10;
lh = addlistener(s,'DataAvailable', @plotData);
tic;
startBackground(s);
pause(5.2);
stop(s);
toc;
end
function plotData(src,event)
fprintf('Length = %d\n',size(event.Data,1));
end
Im trying to run the above code in R2014a with the session interface. While I am able to get access to the first five data chunks, the last chunk with ~20 data points is not accessible. Any idea why?
stop(s); stops the session and all associated hardware operations in progress. If your operation has acquired data and the DataAvailable event has not yet fired, the stop command will fire the event and deliver the data acquired up to that point.
4 个评论
Geoff Hayes
2014-8-22
编辑:Geoff Hayes
2014-8-22
That is surprising/disappointing especially given the description on how the stop function works...
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 National Instruments Frame Grabbers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!