How do you programmatically configure the Serial F

2019-08-23 05:16发布

问题:

From Device Manager in Windows it is possible to configure the Receive Buffer and Transmit FIFO Buffer sizes for a serial port from Advanced Settings for a COM port:

I would like to configure the values for the TX and RX FIFO buffers for COM ports programmatically. Ideally a method to do it in LabVIEW or even via .NET / command line as both are easy to interface with from LabVIEW.

Edit: Just to clarify this is in regards to the 16550 compatible UART FIFO buffers and not software buffers like the VISA I/O Buffer, etc.

回答1:

A few options are available that are not as ideal for this case but useful to note:

The CodeProject post by Vladimir titled "Serial Ports. Enumeration and FIFO control" has an approach that uses the Microsoft Driver Development Kit (DDK) which is now the Windows Driver Kit (WDK) in Visual C++.

The forum "How to set Serial port Fifo buffers without reboot" describes that the values can be changed in the registry (manually or programmatically I suppose) and then the serial port interface restarted using the DEVCON command-line tool. I am not sure how reliable that approach and documentation is hard to find.