Write command to VISA resource and read response
writes the ASCII text
response = writeread(
command followed by the terminator to the VISA
v, then reads the ASCII text returned from the resource. You
can use this function to query the resource. The function suspends MATLAB® execution until the specified
command is sent to the
resource and a response is received.
Query a VISA Resource for ID
Create a connection to a VISA resource. This example shows a connection to a Keysight Technologies® (formerly Agilent Technologies®) X-Series Signal Analyzer (N9030A, PXA Signal Analyzer) using the VISA-TCP/IP interface. The specified resource name is unique to this example.
v = visadev("TCPI0::172.31.165.102::inst0::INSTR");
Write an instrument identification SCPI command to the instrument and read the response.
ans = "Agilent Technologies,N9030A,US00071181,A.14.16"
The instrument response to the
*IDN? command identifies the name,
model, and serial number of the instrument.
v — VISA resource
VISA resource, specified as a
writeread(v,"*IDN?") sends an ASCII text command to the
command — ASCII text command to write to device
character vector | string scalar
ASCII text command to write to device, specified as a character vector or string scalar.
writeread(v,"*IDN?") sends the ASCII command