From: Markus Due Jakobsen on
Hi,

Is it possible to pause an analog input and then resume the data acquisition with a callback (or whatever) without clearing the data engine like when using stop(ai)?

For example if I want to pause the acquisition after 4 seconds and then resume the acquisition after a couple of seconds with some sort of callback or wait/resume function, the initial code should be something like this:

ai = analoginput('winsound');
addchannel(ai, 1);
set(ai,'SampleRate',10000)
set(ai,'SamplesPerTrigger',100000) %10 seconds acquisition at 10000 hz
start(ai)
menu('Pause DAQ','Now'); %Press now after 4 seconds
% ... wait or pause AI
% When using wait(ai,inf) or pause the AI keeps on running. Is there someway to % pause the AI without stopping the AI.
get(ai,'Samplesavailable') %Now Samplesavailable should be 40000
menu('Resume DAQ','Now'); %Initially after the the DAQ has been resumed the % samplesavailable should still be 40000.
get(ai,'Samplesavailable') %This should also be 40000 initially after the button press

Any suggestions?

Markus