07-29-2020 02:54 AM
07-29-2020 04:36 AM
Bytes at port is no good. Waits are no good.
Use the end termination character. Use serial init to set the end termination character, and you'll get a robust interface... Pretty sure the device sends termination characters, as you attach a \n to your message.
Why isn't your code working? Probably you have to use a longer wait... How long? Who knows... That's why waits are no good. You'll have to consider the longest wait, and add a margin. Even if the data is ready 99% of the time...
Why does the simple serial work, but not the first time? Probably because the first time there is no data (needs a longer wait) and the next iteration, you're reading the result of the first iteration.
07-29-2020 05:45 AM
Duplicated post from here: https://forums.ni.com/t5/LabVIEW/Bytes-at-Port-is-zero-after-VISA-Write/td-p/4071000