ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clean the buffer

I want to clean my buffer after each command that I send to my device....
I sent before this message the following message:

I create a modbus driver ascii, and I´m communicating with a device, but it responds sometimes.... when I push the key RUN of Labview the device not respond and I have to stop.. but the second time the instriment respond perfectly... the instrument responds each two time....
I believe that the problem is because I use bytes at serial port immediately read serial port. In probe mode in labview (RUN) in read serial port the instrument stop... the second time it respond... I use this bytes at serial port and read serial port for clean the buffer...what can I do?"

Somebody responds with it isa problem of flush buffer, but I d
on´t know what parameters I must enter...
0 Kudos
Message 1 of 2
(2,686 Views)
Here is something you could try. At the beginning of your VI, read one byte at a time until it is empty. Have a timeout on the read VI with a small time and then check to see, each time, if you read a byte. If not, you know it is empty.
J.R. Allen
Message 2 of 2
(2,686 Views)