Hi!
I'm using qextserialport as a solution for serial communication on Windows with an FTDI chip over a USB port. I'm exchanging approx. 60 bytes packets with a device every 12 ms.
Well I measured the performance and it turns out that while sending out the 60 bytes is below 1 ms, reading them takes over 30 ms. Here is my port config:
port = new QextSerialPort("COM4");
port->setBaudRate(BAUD115200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setTimeout(0,1);
port = new QextSerialPort("COM4");
port->setBaudRate(BAUD115200);
port->setFlowControl(FLOW_OFF);
port->setParity(PAR_NONE);
port->setDataBits(DATA_8);
port->setStopBits(STOP_1);
port->setTimeout(0,1);
To copy to clipboard, switch view to plain text mode
I'm explicitely setting the timeout to 0,1 otherwise the reading takes over 500ms!!! If I set the timeout to 0,0 the read() never returns. Does anyone have an explanation why reading is so slow? Is there something I can do to make it faster?
I already set the latency of the COM port in the device manager to the minimum of 1 ms.
Bookmarks