Help Center
Clear buffers for communication with VISA resource
Since R2021a
flush(v)
flush(v,"input")
flush(v,"output")
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
example
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
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
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
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
Europe
Asia Pacific
Contact your local office