Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

UART buffer overruns at higher baud rates

We are coding up an Labview program that read data located on a serial port.  We are using a TI TUSB3410 UART to USB chipset.  Our application works by us writing to the instrument and then the instrument sends us back a known number of bytes (131176bytes).  Since it is a virtual com port driver and not a physical UART on the host (PC) side, we should be able to transfer data at much higher rates then classical UARTs.  We have successfully gotten our application to work with baud rates of 115200bps and 230400bps and sporadic success with 460800bps.  We never get the 921600bps to work.  The issue we are having is that for the higher baud rates we are getting buffer overruns.  We've tried the suggeested tips on on ni website where they suggest modifiying the receive buffer size in hardware device manager forcing the com port a higher OS priority -- but this did not work.

I've tried several different ways to read data back, however none have seemed to work any better then the others.  I have two methods detailed in the attached code.  I also have some questions as it realtes to "VISA Set I/O Buffer Size", what does this do?  Can this help my problem.  I've tried with and without it, and it never seems to effect the reliability. 

I've attached the code, does anyone know of a better way to do this?  Has anybody been successfull in getting the VISA serial port reads to work at faster baud rates?

thanks!


Here is the sepcific error:
Error -1073807252 occurred at VISA Read in 3410_USB_v2.vi

Possible reason(s):

VISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived.
0 Kudos
Message 1 of 3
(4,096 Views)
 

I'm not sure I accept your arguement that you should be able to support faster baud rates with a virtual port. Since the com port is being emulated by the USB driver, I think you would have addtional overhead. USB has a quite high latency and that might be a factor as well.

For a discussion on the receive buffer, did you see this this?

In your program, you are using local variables and none of these are required. There could be a problem with the Concantanate String function. As the string gets bigger and bigger, LabVIEW has to allocate more memory for it. It has no way of knowing in advance how large the string is going to be and the constant re-allocation can slow down your program. It won't help with getting all of the data, but you could try removing the Concantanate function to see if the VISA Read can keep up with the baud rate. I would also try using hardware flow control.

You might also want to think about the NI Serial Card for pci. This supports a 1 Mb/s rate. I think it's interesting that the fastest USB-RS232 converter from NI only supports a max baud rate of 230.4k

0 Kudos
Message 2 of 3
(4,074 Views)
I expect that you are likely just exceeding the capabilities of the TI chip, which has only a Full-Speed USB interface.  The TUSB3410 uses double 64-byte buffers to avoid overruns, but at 921.6 KBaud you can fill up a 64-byte buffer in about 694 microseconds. Considering that a Full-Speed USB frame is 1 ms, and that bulk USB I/O is the lowest priority on the bus, you are probably just not able to keep up with the sustained transfers at the higher baud rates.

-Jason S.
0 Kudos
Message 3 of 3
(4,056 Views)