LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange reading from visa read - carriage return?

Solved!
Go to solution

Hello,

I'm having a problem understanding what the visa read function returns at the end of all characters.

 

Basically, I set up my custom board to communicate with labview via serial port, and for testing purposes I'm using RealTerm terminal window to emulate my board to send and receive commands to communicate with LabView visa. 

 

I've set up all the communication protocols (baud rate, stop bits etc) properly and chosen carriage return to be a termination character. And as I write D as a command through terminal window, I'm expecting Visa read to return me the same character D. But instead it returns something weird which looks like a D followed by a carriage return but not exactly, as when I compared the thing I received with D followed by a return , it showed me "not equal".

 

Does anyone know what it possibly is? Please see the attached vi which contains two things that look exactly the same.

0 Kudos
Message 1 of 4
(2,308 Views)
Solution
Accepted by topic author FilipN

right click on both string constants and select "\" Codes Display. You will see the difference!

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 4
(2,302 Views)

Thanks very much, it helps. 

It now shows me the visa reads a D followed by a carriage return. But I thought what visa does is stripping the termination character from the reading and displays the message only. Any idea why that's happening? 

The relevant part of the vi is quite simple: Visa configuration(baud rate, stop bits etc, termination character as /r)--visa write(to request a reading)--visa read(reads what I send from the terminal window which is a single ascii character D)

0 Kudos
Message 3 of 4
(2,286 Views)

VISA Read does not strip off any termination characters.

 

You aren't just sending a D from the terminal window.  I bet you are hitting D then hitting the enter key which means you are sending a D and new line character.

0 Kudos
Message 4 of 4
(2,253 Views)