Main Content

InputBufferSize

Specify size of input buffer in bytes

Description

You configureInputBufferSizeas 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 theInputBufferSizevalue. You can read text data with thefgetl,fgets, orfscanffunctions. You can read binary data with thefreadfunction.

You can configureInputBufferSizeonly when the instrument object is disconnected from the instrument. You disconnect an object with thefclosefunction. A disconnected object has aStatusproperty value ofclosed.

If you configureInputBufferSizewhile 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 is512bytes.

Examples

This example shows how to set the input buffer size for a serial port object. TheInputBufferSizeproperty specifies the total number of bytes that can be stored in the software input buffer during a read operation. By default,InputBufferSizeis512bytes. 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;

See Also

Properties

Status