Wait until analog input or output device object stops running
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.
A device object or an array of device objects.
The maximum time to wait for
the MATLAB Command Window, and waits for
stop running. You specify the maximum waiting time, in seconds, with
the value specified for the
obj is an array of device objects, then
wait up to the specified time for each device object in the array.
wait is particularly useful if you want to
guarantee that the specified data is acquired before another task
Create the analog input object
ai for a National Instruments® board,
add eight channels to it, and configure a 25-second acquisition.
ai = analoginput('nidaq','Dev1'); ch = addchannel(ai,0:7); ai.SampleRate = 2000; ai.TriggerRepeat = 4; ai.SamplesPerTrigger = 10000;
You can use
wait to block the MATLAB Command
Window until all the requested data is acquired. Because the expected
acquisition time is 25 seconds, the
26. If the acquisition does not complete within
this time, then a timeout occurs.
obj is not running when
issued, or if an error occurs while
obj is running,
wait immediately relinquishes control of the
obj stops running, its
Running property is automatically set to
stop running under one of these conditions:
The requested number of samples is acquired (analog input) or sent out (analog output).
is issued on that object.
A run-time error occurs.
value is reached (
waittime supersedes this value).
All callbacks, including the
are executed before