Hi,
The error you got means that some times you read not fast enough,thus an overflow occures on driver level and data loss is the result.
This is caused perhaps by your case structure , which can prevent the Read to be executed. You should always read inside the while loop, so perhaps you can put the write in their own Case structure and remove the case from the read to read at every iteration.
DirkW