Hello,
Your diagram looks correct, but I think that it's possible that you could do this a little differently and maybe better. If you're getting more than 20 bytes at the port, it's most likely because your device or random line noise is causing your serial hardware to detect those extra bytes.
It seems that you are waiting for exactly 20 bytes at the port, so why not simply drop the delay at the "Get Bytes At Port" and read 20 bytes? If you do not get the 20 bytes, you will get a timeout error that you can trap and return a message to the user saying that the device didn't behave as expected. If you get more than the 20 bytes, you read only the first 20 and do whatever you want with the remainder (flush the buffer, save them for debugging, etc).
Agai
n, I'm pretty sure that the bytes are there at the port if the function calls say they are, so something is going unexpectedly with the device.
Hope this helps.
Scott B.
Applications Engineer
National Instruments