read
R2026bRead data acquired by hardware
Syntax
Description
reads a span of input scans from the scanData = read(d,span)DataAcquisition object
d. You can specify span as a duration, number of
scans, or "all". When you read a span of input scans, counter inputs are
reset to the initial value.
[
reads acquired scans, and returns the scan data as a timetable and the scan trigger time as
a datetime.scanData,triggerTime] = read(___)
[
reads acquired scans, and returns the scan data, timestamps, and trigger time as a matrix.
The function returns timestamps as the second output argument only when you set the
scanData,timeStamp,triggerTime] = read(___,OutputFormat="Matrix")OutputFormat to "Matrix".
Note
The read operation occurs synchronously (in the foreground) or asynchronously (in the background).
Foreground acquisition (synchronous read) — To initiate foreground data acquisition, call the
readfunction. This action acquires data while blocking interaction with MATLAB® until the read operation completes.Background acquisition (asynchronous read) — To initiate background data acquisition, call the
startfunction before calling thereadfunction. Thestartfunction triggers the acquisition in the background and fills an internal buffer asynchronously. Thereadfunction, which you invoke later, acquires the specified range of data from this internal buffer. You can read any data remaining in the internal buffer even if you stop the acquisition.
Examples
Input Arguments
Output Arguments
Version History
Introduced in R2020a
