Home > Software engineering >  A serial port server buffer
A serial port server buffer

Time:09-20

How to use MSCOMM control test serial port server buffer in bytes have been successfully send a serial port server, continue to write, after the expiration of the buffer buffer before writing bytes are valid?

CodePudding user response:


OutBufferCount attribute


Return to wait for the number of characters in the transmit buffer, it can also be used to remove transmission buffer, this attribute is invalid when the design,

Syntax

Object. OutBufferCount [=value]

OutBufferCount attribute syntax consists of the following parts:

Part of the description
Object expression, and its value is "applied" in the list of objects,
Value integer expression, waiting for the number of characters in the transmit buffer,


Description

Set OutBufferCount properties of 0 can remove transmission buffer,

Be careful not to OutBufferCount confused with OutBufferSize attribute, OutBufferSize property returns the entire transmission buffer size,

Data type

The Integer




OutBufferSize attribute


Set in the form of byte transmission and returns the size of the buffer,

Syntax

Object. OutBufferSize [=value]

OutBufferSize attribute syntax consists of the following parts:

Part of the description
Object expression, and its value is "applied" in the list of objects,
Value the integer expression, the size of the transmission buffer,


Description

OutBufferSize refers to the whole transmission buffer size: the default value is 512 bytes, don't put the confused with OutBufferCount attribute, OutBufferCount property returns the current transmission buffer for the number of bytes,

Note transmission buffer Settings is larger then the application of the available memory is smaller, but if the buffer is too small, if do not use the handshake protocol, it may have the danger of overflow, the general rule is, first of all, set up a 512 - byte buffer, if there is an overflow error, is by increasing the size of the buffer to control the transmission rate of application,

Data type

The Integer

CodePudding user response:

refer to the original poster qq_35803789 response:
how to use MSCOMM control test serial port server buffer in bytes has been successfully sent a serial port server, continue to write, after the expiration of the buffer buffer before writing bytes are valid?

As long as the sender serial port open, using MsComm controls the Output of the property, will be to write the data flow transmission buffer, the receiver is open has nothing to do with the sender,
Whether the serial port server receives the need communication both sides to be sure, the receiver to receive after return a have received instructions, this instruction to the communication protocol specifications,
  • Related