You have some dataflow problems and I think you have some timing issues. For one, you are using the Wait (ms) and because that function does not have an error in/error out connection, you don't know exactly when the wait is happening. Alos, immediately after you do a write, you check to see how many bytes are available and read that number. It's certainly possible that you are missing some information because the instrument hasn't yet transmitted the information yet. You might want to use a wait function after the write, then check number of bytes, and then do the read. Use the Time Delay function which does have error in/error out so that you can enforce dataflow with resorting to sequence structures. Sequence structures are not something you should use a lot of. You can also put a loop after the write and do a Bytes at Serial Port and exit the loop when the byte count is equal or greater to a certain number.