Help CenterHelp Center
Clear buffers for communication with VISA resource
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.
visadev | read | write
read
write
다음 MATLAB 명령에 해당하는 링크를 클릭했습니다.
명령을 실행하려면 MATLAB 명령 창에 입력하십시오. 웹 브라우저는 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