LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DOUBT WITH THE POSITION OF THE "LINE FEED" AND "CARRIAGE RETURN" CHARACTERS

Hello!

 

I have a question, when sending a data string from a microcontroller to Labview, 
is it better to send a line break at the beginning of the data string and send a
carriage return at the end? Or is it better to send the carriage return first and
the line feed last? The data will be read by VISA Serial in LabVIEW. Best regards,

Mayra
0 Kudos
Message 1 of 4
(765 Views)

Hi Marya,

 

send just a LF at the end of your message…

 

(Watch this video!)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(759 Views)

Many devices will send a Carriage Return and a Line Feed (in that order).  Many others just send a Line Feed.  Occasionally, I'll run into an instrument that only sends a Carriage Return.  But I recommend just sending the Line Feed at the end of the message.  Then you can use that as the Termination Character and VISA will take care of quite a bit for you.  Watch the video Gerd linked to and things should be more clear.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 4
(730 Views)

Generally, CR precedes LF.  This is a remnant from the days of electromechanical user interface devices.  The earliest one I remember is the TeleType model ASR-33.  It ran at 110 baud (10 chrs/sec).

CR moved the print head back to home (all the way to the left), LF advanced the paper up one line.  They were separate functions because sometimes you wanted to do one without the other.

They had to come in the order CR then LF because if the carriage is far to the right, it takes more than 1/10 second to return; thus the chr. after the CR gets executed while the carriage if slamming to the left.  If that chr. is an LF, no problem; but you wouldn't want a printable chr. to come right after a CR because it would get printed somewhere in the middle of the paper instead of at the far left.

"If you weren't supposed to push it, it wouldn't be a button."
Message 4 of 4
(704 Views)