issue in clearing received buffer

5 posts / 0 new
Last post
erdeepakcs
issue in clearing received buffer

Hi Sir,

when data from meter of expected length doesn't come, then we retry the command again for reading same data,then previously received data also comes with the current data. how can i clear the buffer, so that i should get only current data not previous data.

BR
deepak

Kurumi
Kurumi's picture

Hi,

You must clear received bytes before you send command again.
Is this happening often?

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

erdeepakcs

This is happening, when communication is break and all data doesn't received. When retry again for data then previously received data also comes in currently received.
I have assigned p.Reply=null; before retry again but still getting previously received data.
Is there any other way to clear the buffer ?

Thanks
Deepak

Deepak

Kurumi
Kurumi's picture

Hi,

You can try to call ResetSynchronousBuffer. It will clear received data from sync buffer.

BR,

Mikko

________________________________________
Mikko Kurunsaari
Gurux Ltd
http://www.gurux.fi

erdeepakcs

thanks sir, this resolve my issue.

BR
deepak

Deepak