InputBufferSize
Specify size of input buffer in bytes
Description
You configureInputBufferSize
as the total number of bytes that can be stored in the software input buffer during a read operation.
A read operation is terminated if the amount of data stored in the input buffer equals theInputBufferSize
value. You can read text data with thefgetl
,fgets
, orfscanf
functions. You can read binary data with thefread
function.
You can configureInputBufferSize
only when the instrument object is disconnected from the instrument. You disconnect an object with thefclose
function. A disconnected object has aStatus
property value ofclosed
.
If you configureInputBufferSize
while there is data in the input buffer, then that data is flushed.
Characteristics
Usage |
Any instrument object |
Read only |
While open |
Data type |
Double |
Values
The default value is512
bytes.
Examples
This example shows how to set the input buffer size for a serial port object. TheInputBufferSize
property specifies the total number of bytes that can be stored in the software input buffer during a read operation. By default,InputBufferSize
is512
bytes. There could be a case when you would want to increase it to higher than the default size.
创建一个串口对象相关的有限公司M1 port. Set the input buffer size to 768 bytes.
s = serial('COM1'); s.InputBufferSize = 768;