Remove analog input data from data acquisition engine
Note: You cannot use the legacy interface on 64-bit MATLAB®. See About the Session-Based Interface to acquire and generate data on a 64-bit MATLAB.
An analog input object or array of analog input objects.
Specifies how much data is removed from the engine.
all data from the data acquisition engine and resets the
data from the data acquisition engine depending on the value of
flushdata removes all data from the engine
is set to
0. This is the same as
flushdata removes the data acquired during
triggers is a valid choice only when
TriggerRepeat property is
greater than 0 and the
inf. The data associated with the oldest
trigger is removed first.
Create the analog input object
ai for a National Instruments® board
and add hardware channels 0-7 to it.
ai = analoginput('nidaq','Dev1'); addchannel(ai,0:7);
A 2-second acquisition is configured and the device object is executed.
ai.SampleRate = 2000 duration = 2; ActualRate = get(ai,'SampleRate'); ai.SamplesPerTrigger = ActualRate*duration start(ai) wait(ai,duration+1)
Four thousand samples will be acquired for each channel group member. To extract 1000 samples from the data acquisition engine for each channel:
data = getdata(ai,1000);
You can use
flushdata to remove the remaining
3000 samples from the data acquisition engine.
ans = 0