From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(2,240 Views)

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

S. Eren BALCI
IMESTEK
0 Kudos
Message 2 of 5
(2,211 Views)

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
(2,203 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
(2,170 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
IMESTEK
0 Kudos
Message 5 of 5
(2,163 Views)