Are you in any way connected to any of the previous posters in this thread? Such as Ahed_123456
The original thread is from 2011. Ahed was very recent, but seems to be a completely different problem.
If yours is a new problem, you should have started a new thread rather than hijacking an old one.
You say "Is there any reason why there would be a connection issue?"
But yet you failed to tell us what is the connection issue you are having.
Did you get an error message?
I see several problems with your code.
- Your while loop is running as fast as possible.
- I can't tell if you are sending a termination character with your Write command. (I'm assuming you need to since it is a text based command and your serial port is set up to enable termination characters on read.
- You made the mistake of using Bytes at Port which is not required in 99% of serial communications.
- The mistake of Bytes at Port compounded with no wait after sending the command to give the instrument time to return a message. I bet if you put a probe on the blue wire coming from Bytes at Port, it will show a 0 the first time you run this code.