Hello fred,
your While loop looks good...
Why can't you differ between normal read and answers to commands? First you write the command, then you read the answer. If "send command" is false, then you have a normal/continous reading.
If you just want to write commands, then you have to introduce a case structure around the VISA read. Make a boolean switch "Just write command" and wire this to the case selector.
I attached an older example of serial communication (made for Vötsch Climate chambers). It uses the old serial port vi's, but you can do the same with VISA. Just replace with appropriate vi (Read, Write and Bytes at Serial Port, all in VISA->Advanced->Serial).
Best regards,
GerdW
Best regards,
GerdW

using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019