How to collect last bits of data from background acquisition
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Geoff Hayes
el 22 de Ag. de 2014
Editada: Geoff Hayes
el 22 de Ag. de 2014
That is surprising/disappointing especially given the description on how the stop function works...
Respuestas (0)
Ver también
Categorías
Más información sobre National Instruments Frame Grabbers en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!