Arduino Serial Communication with EEPROM

I'm using a C++ library "QextSerialPort" and combine with another opensource GUI library "Qt" to communicate with Arduino Duemilanove through USB Serial Port,then use it to read and write the EEPROM memory of arduino board.

application screenshot like this:


The application send/read String data to Arduino through serial port ,and the arduino program will read data from serial port , then display the receive data on the LCD which connected with arduino.

Second stage,now I have to implement EEPROM read/write from this application.
So I send a specific custom data protocol from application to let arduino know the application(computer end) wants to read/write data from its EEPROM memory,so arduino will handle the protocol to do EEPROM read/write ,just like below.....
Application->Arduino
Write protocol:@"address"#"data"$
Send this string to arduino will write the data to EEPROM memory address
etc:@123@111$ //write 123 to arduino EEPROM address 111
Read protocol:!address$
Send this string to arduino will read the arduino address's data,then send back to serial port
etc:!123$ //read address 123 from arduino EEPROM

Here is the problem, when i do the Read operation, the application receive the "send back" data from arduino,sometimes these data will lost . For Example, the above screenshot i send a Read protocol with address=1,which means "read address 1's data",then after several ms,application read serial port text area display the data send from arduino, data=100,but when i clicked consecutively the EEPROM read button, the data=100 sometimes lost in the send back serial communication, like 100-> '1'&'00' or '10'&'0' , instead of "100".

How it happen?? Is it normal situation in serial communication??
Do I need to create another protocol to ensure the completed send back read data?

And another simple question, application receive the send back Read data from the serial port, but i dont know how to let application handle it as the EEPROM data it wants, i mean its a normal serial port print message right? Not send back as soon as the application send the Read protocol.

Instead of replying with "100" (or whatever you read from EEPROM), you should reply with something like "Address:Value". This way, the Processing application can tell that a whole packet was received (if the < and > are both present), where the value is within the string (between the : and the >), and what address the value was fetched from (between the < and the :).

Thanks , I tried usd this method to slove the lost read problem, instead of Address:Value , i use !Address@Value$ as the similar one ha^^
After working whole day,now i can send the request for reading any address EEPROM's value without error, When application receive the send back data from arduino, it will check the protocol as if it contain start symbol '!' and end symbol '$' , if not ,application will send the read request again to let arduino send the data again , until the send back data contains both '@','!' . But its comes some minor problem , the incompleted send back data will cause the data stay in the serial port, when next time application asks a request for send back data, it will recieves the old one. so the send back data has to contain Address information to check if its the actual request address's data that the application wants.

But its comes some minor problem , the incompleted send back data will cause the data stay in the serial port, when next time application asks a request for send back data, it will recieves the old one.

The only way you know that the data is incomplete is to read it from the serial port. The process of reading data removes it from the serial port buffer, so that it is not available to read again.