Simultaneously read and write device channel data
inScanData = readwrite(
outScanData to the DataAcquisition interface output channels, and
inScanData from the DataAcquisition interface input channels. Input
and output have the same number of scans, determined by the number of rows in the matrix
outScanData. By default, data is returned to
inScanData as a timetable.
readwrite supports only
foreground clocked operations, blocking MATLAB until complete.
performs the read and write operations, also returning the scan times as a column vector of
triggerTime] = readwrite(___,"OutputFormat","Matrix")
timeStamps, and the scan trigger time to
triggerTime as a datenum double. The rows of the
timeStamp vector correspond to the rows of the
Configure the DataAcquisition to measure and generate voltage simultaneously, in the foreground.
d = daq("ni"); addinput(d, "Dev1","ai0","Voltage"); addoutput(d, "Dev1","ao0","Voltage"); outScanData = linspace(0,1,d.Rate)'; % Increase output voltage with each scan. inScanData = readwrite(d,outScanData);
outScanData— Scan data for device output
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 interface. For a single channel, the data is a column vector. Single scans are not supported by this function, so M must be greater than 1.
inScanData— Input scan data from the device
Input scan data from the device, returned as a timetable or matrix of doubles,
depending on the
You can access the scan trigger time in the timetable property
inScanData.Properties.CustomProperties.TriggerTime, returned as a
triggerTime— Time that acquisition began
Time that acquisition began, returned as a datetime if
"Timetable" (default), or as a
information is also available as a datetime value in the timetable property
timeStamp— Times of scan acquisitions
Times of scan acquisitions, returned as a matrix of doubles. Each value represents
relative time in seconds after the first scan. This argument is returned only when
OutputFormat is specified as