alva:
In the first program, when I sent the data, the arduino was in 'delay' condition. But when the 'delay' condition was over, the data couldn't be processed.
What do you mean "the data couldn't be processed"? Can you please post what you are sending and what output you see? That is a pretty meaningless description.