LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

FlushInQ

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)

0 Kudos
Message 1 of 5
(195 Views)

What is the numeric value of the "same amount" you mentioned? 

S. Eren BALCI
www.aselsan.com.tr
0 Kudos
Message 2 of 5
(166 Views)
Highlighted

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 


 

0 Kudos
Message 3 of 5
(158 Views)

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.



Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
________________________________________
If I have helped you, why not giving me a kudos?
0 Kudos
Message 4 of 5
(125 Views)

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. 

S. Eren BALCI
www.aselsan.com.tr
0 Kudos
Message 5 of 5
(118 Views)