A: 

Are you trying to use Flag as the ack? The logic doesn't make sense. Don't you need to do something like

while (Flag == false)
    ; //wait for flag to become true after previous write
...write...
Flag = false;
mtrw
I have tried this simple way of keeping the loop running till the data_received_from_port doesn't set the flag to true again. It works when I run the program using breakpoints. But if I run it directly without a stop, it doesnot work. Acknowledgements are received (as checked by me using messageboxes) but probably the sync doesn't happen. Do you think the device doesn't send acks properly?
subho100
The problem is probably in timing. You have no control over when DataReceived happens - it could happen after 1 byte is received, or many. If it happens after 1 byte is received, and then you immediately send the next packet, you might be confusing the device. When you put MessageBoxes in, you change the timing considerably. It would be helpful if you update your code above with any changes you've made so far.
mtrw
A: 

You need a state machine pattern, or at least some way of storing state. By "State" I mean where you are in the process of reading/writing. State machines are a basic design pattern commonly used for communications (or any event driven programs), read up on them a bit:

http://www.codeproject.com/KB/architecture/statepatterncsharp.aspx

http://www.dofactory.com/Patterns/PatternState.aspx

http://en.wikipedia.org/wiki/State_pattern (I don't like the sample they chose here)

Addys
Thanks Addys. I am trying to understand how to implement this pattern in my case. I will surely get back with my replies once I get the answer.
subho100
A: 

Somehow this has worked out,

 byte[] data = "Your message to be sent on serial port";
    serialPort.Write(data, 0, data.Length);

    byte[] buffer = new byte[16];
    int vintctr = 0;
                    while (vintctr < 16)
                        vintctr  += serialPort.Read(buffer, 0, 16);

Debug this and you you can get the reply from the port.
subho100