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.
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 ?
issue in clearing received buffer
Hi,
You must clear received bytes before you send command again.
Is this happening often?
BR,
Mikko
hi sir
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
issue in clearing received buffer
Hi,
You can try to call ResetSynchronousBuffer. It will clear received data from sync buffer.
BR,
Mikko
hi sir
thanks sir, this resolve my issue.
BR
deepak