From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

Carriage return, Line Feed, End of Line constant problem

Hi there (again),

 

I had some problems with LabVIEW for ARM 2010 with strings (and sending this string data to UART and USB, to my pc)

I was adding <CR><LF> to end the lines and in hyperterminal/putty/LabVIEW pc application I always receive just a single <CR>

 

I've looked to what to code generation does with "End of line" constants and strings that have "\r\n"

 

A end of line constant difers from which version you are using of LabVIEW (windows = <CR><LF>, Linux = <CR> or something like that)

You can find this in LVDefs_plat.h with the define SSEOL, this is "\r" (Carriage return)

 

programming my code I use string constants to add an end of line ( "\r\n" )

Also here, the LabVIEW code generation makes it just a Carriage Return.

Looking at the code, it is placing also a SSEOL, which is a "\r"

 

If I make a constant like "\r\nblablalb\r\n",  I have a string with <CR><LF>

 

I think it's a problem when you define a constant (not a end of line constant vi) string explicit with just "\r\n" that it makes it a SSEOL ( "\r" )

 

My workaround is:

 

defining two constant strings ( "\r" and "\n" ) and concatenate those strings. LabVIEW code generation will make two constants "\r" and "\n" and your code makes it a "\r\n".

 

LV_CRLF.png

 

I will use this workaround for myself and I hope that others can use this if they have this problem also.

 

Wouter

Wouter.
"LabVIEW for ARM guru and bug destroyer"
Message 1 of 5
(15,253 Views)

Hello Sir, I am currently working on a vi which sends commands and in return gets the response from the device like the parameters, but i get only responses for few commands and if i ask for few others it throws an error, could you please help me with it? the device i am communicating is a small signal board. thanks in advance

 

0 Kudos
Message 2 of 5
(14,957 Views)

Hi Vinod00,

 

I think you should start a new topic.

But I've done a quick look at your code.

you are sure that the commands you send are correct? (with spaces etc and checking on end of line) windows EOL and ARM EOL are the same?

why you are reading 100 bytes back exactly? is this always 100 bytes? otherwise the function will wait for 100 bytes. (try to just reading the bytes that are at port)

Wouter.
"LabVIEW for ARM guru and bug destroyer"
0 Kudos
Message 3 of 5
(14,954 Views)

So could you just try modifying it and sending it back to me, as i have to finish this within today.Thanks in advance.

0 Kudos
Message 4 of 5
(14,952 Views)

I am trying to send a character R through serial port to a sensor through arduino board. My program is attached here. Unfortunately im not able to read my sensors and getting error. I have attached my program and error snapshot. 

The same sensors in arduino IDE does read on sending R in the serial monitor of arduino but not sure why not displaying results in labview. please check

Thanks for the help

Download All
0 Kudos
Message 5 of 5
(6,746 Views)