| Data Acquisition Toolbox | Search  Help Desk |
| flushdata | Examples See Also |
Remove data from the data acquisition engine.
Syntax
flushdata(obj)
Description
flushdata(obj) removes data from the data acquisition engine and resets the SamplesAvailable property to zero.
Example
National Instruments
Suppose you create the analog input objectai for a National Instruments board and add hardware channels 0-7 to it.
A one second acquisition is configured whereai = analoginput('nidaq', 1)addchannel(ai, 0:7)
SampleRate is set to 2000 Hz and SamplesPerTrigger is set to 2000 samples. The device object is then started.
2000 samples will be acquired for each channel group member. To extract 100 samples from the data acquisition engine for each channelset(ai,'SampleRate', 2000)ActualRate = get(ai, 'SampleRate');set(ai,'SampleRate', ActualRate)set(ai, 'SamplesPerTrigger', 2000);start(ai)
data = getdata(ai, 100);
flushdata command can be used.
flushdata(ai)
See Also
Functions
getdata
Properties
SamplesAvailable