02-05-2024 02:33 PM - edited 02-05-2024 02:34 PM
Well, the CVI code is pretty weird, and I'm not really sure what you define as working. As it is programmed it of course will eventually end after at most 5 times writing the command and trying to read the response. It does however not check the return value of the ComRd() function at all, only that the string ComRd() is supposed to write data into is not anymore the initialized "xx" value. How you determine that "it works" is however highly questionable.
As far as an equivalent LabVIEW program would go it would more or less look like this:
Your VI sends rather "aoff\r\n". Are you sure that command is supposed to return something?
02-06-2024 10:49 AM
The CVI code was a general check that a response was received.
The issue of the Visa Read not responding is that it is responding with 2 messages one error and one expected. Removing the error checking ignores the error message and allows the expected response thru.