LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Read size problem

Since the CR/LF terminator always occurs in that order, if you really want to "accept" a CR-without-the-LF or an LF-without-the-CR (that would be really weird, and would certainly violate sensible parsing of ASCII strings, designed to be "human-readable"), you could certainly code to accept "naked" terminators (choose LF as the Terminator, and when you get it, look at the preceding character in the string, which should be CR, and if not, you've probably got "Bad ASCII").

 

But much simpler (and likely to work 99.999% of the time) is to choose the termination character of the "sending device" and use that when setting up VISA (and if they send CR/LF, use LF).

 

Bob Schor

 

 

0 Kudos
Message 11 of 12
(107 Views)

@RTSLVU wrote:

Trim Whitespace works both ways, so in reality it does not matter if you choose CR or LF as your termination character in VISA Serial Configure. As it will trim space, CR, LF characters off both ends of the string.

 

trim2Capture.PNG

 

 


However if you use CR you'll never get the LF and it will be appended to the next message.

Edit: okay I see what you are getting at, but I still consider it improper to have the second half of the termination appear on the next message because it isn't part of the next message.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 12 of 12
(84 Views)