peekdata - Preview most recent acquired data

Syntax

data = peekdata(obj,samples)
data = peekdata(obj,samples,'type')

Arguments

obj

An analog input object.

samples

The number of samples to preview for each channel contained by obj.

'type'

Specifies the format of the extracted data as double (the default) or as native.

data

An m-by-n matrix where m is the number of samples and n is the number of channels.

Description

data = peekdata(obj,samples) returns the latest number of samples specified by samples to data.

data = peekdata(obj,samples,'type') returns the number of samples specified by samples in the format specified by type for each channel contained by obj. If type is specified as native, the data is returned in the native data format of the device. If type is specified as double (the default), the data is returned as doubles.

Remarks

More About Using peekdata

Rules for Using peekdata

Examples

Create the analog input object ai for a National Instruments® board, add eight input channels, and configure ai for a two-second acquisition.

ai = analoginput('nidaq','Dev1');
addchannel(ai,0:7);
set(ai,'SampleRate',2000)
set(ai,'SamplesPerTrigger',4000)

After issuing the start function, you can preview the data.

start(ai)
data = peekdata(ai,100);

peekdata returns 100 samples to data for all eight channel group members. If 100 samples are not available, then whatever samples are available will be returned and a warning message is issued. The data is not removed from the data acquisition engine.

See Also

Functions

getdata, getsample

Properties

SamplesAvailable

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS