| Data Acquisition Toolbox | ![]() |
Queuing Data with putdata
Before data can be sent to the analog output hardware, you must queue it in the engine. Queuing data is managed with the putdata function. One column of data is required for each channel contained by the analog output object. For example, to queue one second of data for each channel contained by the analog output object ao:
ao = analogoutput('winsound'); addchannel(ao,1:2); data = sin(linspace(0,2*pi*500,8000))'; putdata(ao,[data data])
A data source consisting of m samples and n channels is illustrated below.

Rules for Using putdata
Using putdata to queue data in the engine follows these rules:
RepeatOutput property is greater than 0, then all queued data is automatically requeued until the RepeatOutput value is reached. You must configure RepeatOutput before start is issued.
RepeatOutput is greater than 0.
MaxSamplesQueued property is reached, or the limitations of your hardware or computer are reached.
For more information about putdata, refer to its reference pages in Function Reference.
Rules for Queuing Data
Data to be queued in the engine follows these rules:
NaN is included in the data stream.
UnitsRange property, then it is clipped to the maximum or minimum value specified by UnitsRange. Refer to Linearly Scaling the Data: Engineering Units for more information about clipping.
| Managing Output Data | Example: Queuing Data with putdata | ![]() |