Help CenterHelp Center
Clear buffers for communication with VISA resource
Since R2021a
flush(v)
flush(v,"input")
flush(v,"output")
example
flush(v) flushes all data from both the input and output buffers of the VISA resource v and clears the hardware output buffer of the instrument.
v
flush(v,"input") flushes only the input buffer of the VISA resource.
flush(v,"output") flushes only the output buffer of the VISA resource.
collapse all
Create a connection to a VISA resource. This example shows a connection to a device with the alias COM4 using the VISA-Serial interface.
COM4
v = visadev("COM4");
Write some data to the device and view the number of bytes available to be read in the input buffer.
write(v,1:5,"uint8") v.NumBytesAvailable
ans = 5
Flush both the input and output buffers.
View the number of bytes available to be read.
v.NumBytesAvailable
ans = 0
The input buffer has no data.
visadev
VISA resource, specified as a visadev object.
Example: flush(v) flushes data from the VISA resource v.
Introduced in R2021a
visadev | read | write
read
write
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office