Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 
putdata    Examples   See Also

Queue data in the engine for eventual output to the D/A hardware.

Syntax

putdata(obj, data);

Description

putdata(obj, data) queues the data specified by data in the engine for eventual output to the D/A hardware. data must consist of a column of data for each channel group member. If any output data is not within the range of the UnitsRange property, then the data is clipped to the maximum or minimum value given by UnitsRange. An error is returned if a NaN is included in the data stream. The data type of data can be the native data type of the hardware.

putdata can be used to queue data in memory before the start command is issued, or it can be used to directly output data after start has been issued. In either case, no data is output until the trigger occurs. If putdata is called before start, then the specified data is queued to memory until:

If the value of the RepeatOutput property is greater than 0, then all data queued before start is issued will be requeued (repeated) until the RepeatOutput value is reached. If start is issued wothout any data being queued, then an error is returned.

If putdata is called after start is issued, then the RepeatOutput property cannot be used. If MaxSamplesQueued is exceeded, putdata becomes a blocking function until there is enough space in the queue to add the additional data. If the time to queue the specified data exceeds the time it takes the engine to fill one data block plus the time specified by the Timeout property, then an error is returned.

As soon as a trigger occurs, samples can be output. The SamplesOutput property keeps a running count of the total number of samples per channel that have been output. Additionally, the SamplesAvailable property tells you how many samples are ready to be output from the engine per channel. When data is output, SamplesAvailable is reduced by the number of samples sent to the hardware.

Note:
You will be able to issue ^C (Control-C) while putdata is blocking. This stops the data from being added to the queue. It does not stop data from being output.

Example

National Instruments

Suppose you create the analog output object ao for a National Instruments board and add two output channels to it.

Suppose the MATLAB variable data contains two columns of double precision numbers representing 1000 samples collected from two channels of a function generator. After the start command is issued, the following putdata call outputs all the data to the analog output device.

See Also

Functions

putsample

Properties

MaxSamplesQueued, RepeatOutput, Timeout



[ Previous | Help Desk | Next ]