writeAndRead
Write and read binary data from SPI instrument
Description
data = writeAndRead(
writes the data s
,dataToWrite
)dataToWrite
to the SPI instrument
s
and reads the data available from the instrument as a result of
writing dataToWrite
. s
must be a 1-by-1 SPI
interface object. Values are written and read as uint8
data.
The interface object must be connected to the device using 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
.
SPI protocol operates in full duplex mode, so input and output data transfers happen simultaneously. For every byte written to the device, a byte is read back from the device.
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