How to collect last bits of data from background acquisition
1 view (last 30 days)
Show older comments
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 Comments
Geoff Hayes
on 22 Aug 2014
Edited: Geoff Hayes
on 22 Aug 2014
That is surprising/disappointing especially given the description on how the stop function works...
Answers (0)
See Also
Categories
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!