09-11-2019 12:37 PM
I am sending the FlushInQ to the target port but when I check the GetInQLen. The buffer still having the same amount of data (I run GetInQLen before and after FlushInQ).
I am not setting any signal (CTS, RTS, etc)
09-11-2019 02:28 PM
What is the numeric value of the "same amount" you mentioned?
09-11-2019 03:23 PM
I am doing several transactions but must of the time payload is 20 to 32 bytes. Those are numbers of bytes in reading from the buffer before and after sending the FlushInQ command
09-12-2019 02:41 AM
It has happened to me too to observe some strange behavior of FlushInQ, as it takes some time to flush the queue. In some occasion I replaced it with a dummy ComRd to empty the queue.
I seemed to understand that it is faster than looping and waiting for the queue to be flushed, but it is only vague feeling: I didn't performed appropriate tests to confirm it.
09-12-2019 03:05 AM
Ok, I asked because, it might be the case that; when you have too many bytes coming in with a high baud rate, your buffer might get fulled up very quickly and you may be reading the in-queue length when the queue is full.
But if it ia just 20-30 bytes, it may be related to Roberto's response. And you can solve it with the workaround he proposed.