Queue analog output data in engine for eventual output
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 output object.
The data to be queued in the engine.
the data specified by
data in the engine for eventual
output to the analog output subsystem.
consist of a column of data for each channel contained by
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
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
data contains any data points that are not
UnitsRange of the channel it pertains
to, the data points will be clipped to the bounds of the
data can be a
timeseries object. If
tscollection object, there must be one
data is a
there must be only one channel in
obj. If the
contains gaps, or is sampled at a different rate than the
the data will be resampled at the rate of
a zero order hold.
For more information on using the Time Series functionality, see Example: Time Series Objects and Methods in the MATLAB documentation.
Create the analog output object
ao for a National Instruments® board,
add two output channels to it, and generate 10 seconds of data to
ao = analogoutput('nidaq','Dev1'); ch = addchannel(ao,0:1); ao.SampleRate = 1000 data = linspace(0,1,10000)';
Before you can output
data, it must be queued
in the engine using
putdata(ao,[data data]) start(ao)
Data must be queued in the engine before
putdata is a blocking function
because it returns execution control to the MATLAB workspace
only when the requested number of samples is queued in the engine
for each channel group member.
If the value of the
is greater than 0, then all queued data is automatically requeued
RepeatOutput value is reached.
be configured before
start is issued.
obj executes, you can continue
to queue data unless
RepeatOutput is greater than
Due to buffering constraints on certain devices, additional data queued close to the termination of the previous data may not be output to the device. To insure that all data is output, queue additional data well before the device has output all data.
You can queue data in the engine until the value specified
MaxSamplesQueued property is reached, or
the limitations of your hardware or computer are reached.
You should not modify the
UnitsRange properties after
putdata. If these properties are modified,
all data is deleted from the data acquisition engine. If you add a
channel after calling
putdata, all data will be
deleted from the buffer.
timeseries object must contain
a single column of data.
Data is output as soon as a trigger occurs.
An error is returned if a
included in the data stream.
You can specify
data as the native
data type of the hardware.
If the output data is not within the range specified
OutputRange property, then the data is clipped.
SamplesOutput property keeps
a running count of the total number of samples that have been output
SamplesAvailable property tells
you how many samples are ready to be output from the engine per channel.
After data is output,
SamplesAvailable is automatically
reduced by the number of samples sent to the hardware.