MATLAB 帮助中心
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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处