How to collect last bits of data from background acquisition
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Geoff Hayes
le 22 Août 2014
Modifié(e) : Geoff Hayes
le 22 Août 2014
That is surprising/disappointing especially given the description on how the stop function works...
Réponses (0)
Voir également
Catégories
En savoir plus sur National Instruments Frame Grabbers dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!