read
Read binary data from SPI instrument
Syntax
Description
data = read(
reads the number of values specified by s
,count
)count
from the SPI device
s
and returns to data
. s
must
be a 1-by-1 SPI interface object. Values are read as uint8
data.
The interface object must be connected to the device with the connect
function before any data can be read from the device, otherwise an error is returned. A
connected interface object has a ConnectionStatus
property value of
connected
.
Available options for count
include: N
– read at
most N
values into a column vector. count
cannot be
set to INF
.
The SPI protocol operates in full duplex mode, input and output data transfers happen simultaneously. SPI communication requires N bytes of dummy data to be written into the device for reading N bytes of data from the device. The dummy data written is zeros.
For more information on using the SPI interface and this function, see Configuring SPI Communication and Transmitting Data over the SPI Interface.
Examples
Input Arguments
Version History
Introduced in R2013b