Is it possible to have a serial port read and write running at the same time without them deadlocking?
The structure I want is two while loops running in parallel. The first one waits for return to be pressed in an input field, writes the string to the serial port, and goes round again. The second one blocks on a serial port read until some data arrives, displays it, and goes back to waiting. Unfortunately the write in the first loop blocks if the second loop is waiting for data to read.
Some of the commands sent to the attached box will produce no output, some a known amount of output, and some will make it produce output until another command stops it. The program doesn't need to maintain any state about
the box, just read and display any data it sends, so this separation of read and write seems the cleanest way to handle things. Any better ideas would be welcome though.
I'm using the serial port compatability VIs because the attached box is a homemade device that sends binary data rather than ASCII formatted into lines.
Michael