putdata

Queue data in engine for eventual output

Syntax

putdata(obj,data)

Arguments

obj

An analog output object.

data

The data to be queued in the engine.

Description

putdata(obj,data) queues the data specified by data in the engine for eventual output to the analog output subsystem. data must consist of a column of data for each channel contained by obj. That is, data must be an m-by-n matrix, where m rows correspond to the number of samples and n columns correspond to the number of channels in obj.

data can consist of doubles or native data types but cannot contain NaNs. data must contain a column of data for each channel contained in obj. If data contains any data points that are not within the UnitsRange of the channel it pertains to, the data points will be clipped to the bounds of the UnitsRange property.

data can be a tscollection object or timeseries object. If data is a tscollection object, there must be one timeseries per channel in obj. If data is a timeseries object, there must be only one channel in obj. If the tscollection or timeseries object contains gaps, or is sampled at a different rate than the SampleRate of obj, the data will be resampled at the rate of obj using a zero order hold.

For more information on using the Time Series functionality, see Time Series Objects and Methods in the MATLAB® documentation.

Remarks

More About Queuing Data

More About Outputting Data

Examples

Create the analog output object ao for a National Instruments® board, add two output channels to it, and generate 10 seconds of data to be output.

ao = analogoutput('nidaq','Dev1');
ch = addchannel(ao,0:1);
set(ao,'SampleRate',1000)
data = linspace(0,1,10000)';

Before you can output data, it must be queued in the engine using putdata.

putdata(ao,[data data])
start(ao)

See Also

Functions

putsample, timeseries, tscollection

Properties

MaxSamplesQueued, OutputRange, RepeatOutput, SamplesAvailable, SamplesOutput, Timeout, UnitsRange

  


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