This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

Setting the Serial Port Buffer Size for Receiving or Transmitting Data with VISA

Updated Apr 24, 2023

Reported In

Driver

  • NI-VISA

Issue Details

I would like to manually set the size of the receive and transmit buffers for my VISA serial resource. How do I do this?

Solution

The I/O (receive and transmit) buffers can be manually set in LabVIEW or LabWindows/CVI.

LabVIEW: 

Use the VISA Set I/O Buffer Size function to set the size (in bytes) of the receive or transmit buffer. 
 

The mask input designates whether to set the I/O receive buffer, I/O transmit buffer, or both. Size is the size of the buffer in bytes. You should set the buffer size to a value larger than the number of bytes you expect to read or write. If size is left unwired, a size of 4096 bytes is used.


 
LabWindows/CVI:

In LabWindows\CVI use the VISA viSetBuf function.

ViStatus viSetBuf(ViSession vi, ViUInt16 mask, ViUInt32 size)
For more information on how to set the mask parameter, refer to the NI-VISA help file for this function.
 

Additional Information

Before you call the VISA Set I/O Buffer Size function, you must call the VISA Configure Serial Port VI to initialize the VISA serial session.