preload(d,scanData)
provides scan data to the DataAcquisition interface d
for device output.
If the DataAcquisition interface has output channels, you can queue
data using preload and then call start. Data
generation then starts on the output channels in the background without blocking MATLAB®.
To prepare for device output, queue scan data to the
DataAcquisition interface. The behavior of the preloaded data at output
depends on the mode in which you call the start function.
Consider an interface d with an analog output channel.
d = daq("ni");
addoutput(d,"Dev1","ao1","Voltage");
Define and queue a sine wave for repeated output on a single channel.
Calling start begins background generation of the preloaded sine wave. When you call
start with the "RepeatOutput" option, the interface repeats the sine
wave automatically as the data output. Calling stop terminates the output
generation.
start(d,"RepeatOutput")
% ⋮
stop(d)
Define and queue a cosine wave for output of one cycle on a single channel.
Calling start begins data generation in the background. This time, call
start without the "RepeatOutput" option. After
the function outputs the queued data, background generation stops.
DataAcquisition interface, specified as a DataAcquisition
object, created using the daq
function.
Example: d = daq(...)
Scan data for device output, specified as an M-by-N matrix, where M is the number of
data scans and N is the number of output channels in the
DataAcquisition object. Each column of scanData
contains the data for one channel. For a single channel, the data is a column
vector.
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.