10-25-2011 12:24 PM
I am having some issues with my VI. I have a MARK-10 deflection test stand that I send text codes to the gauge and ram. In the "Get Reading" Case, when I send the "X" to retrieve the gauge reading, I can't pull the correct reading from the gauge. I instead receive the ram status which, in the previous Case Statement (Test Sample) is a "n".
The "code" acts like it doesn't fully flush the buffer. Even after I try the VISA Clear or VISA Flush items, I still receive the ram status.
It's driving me insane! Anyone have ANY ideas without rewriting the whole thing?
Eric
10-25-2011 01:41 PM
Are you sure you don't need carriage return or line-feed characters to terminate your commands?
10-25-2011 02:02 PM
No, I can read everything OK up to that point.
10-25-2011 02:19 PM
I've found the solution to my problem. I replaced the VISA Clear with the VISA Flush command at the end of the Test Sample Case. Not quite sure why that worked. I was under the impression that they were the same???
10-27-2011 03:45 PM
Hi Eric1977,
VISA Clear and VISA Flush I/O Buffer are not the same. LabVIEw help states:
VISA Clear Function: "Clears the input and output buffers of the device."
VISA Flush I/O Buffer Function: "Flushes the I/O buffer specified by mask."
Basically, VISA Clear will erase the information from the buffer, with VISA Flush you are acquiring the remaining data from the buffer. So, I think you were deleting the data before using it.
Regards,