LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Read Buffer string from VISA Read

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

0 Kudos
Message 1 of 5
(3,063 Views)

Are you sure you don't need carriage return or line-feed characters to terminate your commands?

0 Kudos
Message 2 of 5
(3,054 Views)

No, I can read everything OK up to that point.

0 Kudos
Message 3 of 5
(3,047 Views)

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???

0 Kudos
Message 4 of 5
(3,042 Views)

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,

 

 

Jorge
Applications Engineer
National Instruments
________________________________________
Certified LabVIEW Associate Developer (CLAD)
0 Kudos
Message 5 of 5
(3,008 Views)