LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW 2023 Q3 CRLF constant behaves strange

Solved!
Go to solution

Hi,

 

I encountered strange behavior of the CRLF constant. Windows compared to cRIO with Linux (9053). On Windows my driver worked fine and on the cRIO it didn't. Finally discovered something with the CRLF constant. The outgoing wire probe showed \r\n on Windows and \n on the cRIO !?

 

Is this expected behavior or a BUG?

CRLF cRIO issue.PNG

Regards,
André (CLA, CLED)
Message 1 of 14
(1,923 Views)
Solution
Accepted by topic author andre.buurman@carya

Yes, that's expected. It's the platform dependent end of line constant.

From the help:

dan_u_0-1700074463459.png

 

Message 2 of 14
(1,910 Views)

That is nice behavior when creating text files, but it is desastrous when implementing a device driver.

 

It's counter-intuitive to me, I always interpreted it as a convenient constant that prevented me from the need to combine 2 constants or put the constant string with \r\n in code mode.

 

Thx, for highlighting that. Didn't think of reading the manual.

Regards,
André (CLA, CLED)
0 Kudos
Message 3 of 14
(1,902 Views)

I never use that fixed constant for this reason. I always use a string constant with \ codes display because I find it to be the most readable, and least error-prone.

b.png

Message 4 of 14
(1,885 Views)

andre.buurman@carya wrote:

It's counter-intuitive to me, I always interpreted it as a convenient constant that prevented me from the need to combine 2 constants or put the constant string with \r\n in code mode.


The icon doesn't help:

 

wiebeCARYA_0-1700474088220.png

 

I'd argue it gives the wrong impression...

Message 5 of 14
(1,753 Views)

wiebe@CARYA wrote:

andre.buurman@carya wrote:

It's counter-intuitive to me, I always interpreted it as a convenient constant that prevented me from the need to combine 2 constants or put the constant string with \r\n in code mode.


The icon doesn't help:

 

wiebeCARYA_0-1700474088220.png

 

I'd argue it gives the wrong impression...


There is another thread somewhere not that long ago (a month or two maybe) with the same claim. Considering that these icons have been in LabVIEW since at least version 2.x entirely unchanged, and always with the same behavior, it is amazing that after over 30 years people suddenly seem to fall over this "pitfall". 😁

 

Especially if these people are not newbies. Anyone having ever worked on more than LabVIEW for Windows knew this since the beginning of times. 😁

Rolf Kalbermatter
My Blog
Message 6 of 14
(1,737 Views)

@rolfk wrote:

wiebe@CARYA wrote:

andre.buurman@carya wrote:

It's counter-intuitive to me, I always interpreted it as a convenient constant that prevented me from the need to combine 2 constants or put the constant string with \r\n in code mode.


The icon doesn't help:

 

wiebeCARYA_0-1700474088220.png

 

I'd argue it gives the wrong impression...


There is another thread somewhere not that long ago (a month or two maybe) with the same claim. Considering that these icons have been in LabVIEW since at least version 2.x entirely unchanged, and always with the same behavior, it is amazing that after over 30 years people suddenly seem to fall over this "pitfall". 😁

 

Especially if these people are not newbies. Anyone having ever worked on more than LabVIEW for Windows knew this since the beginning of times. 😁 


Well, about 15 years of those 30 years complaining was pretty much useless 😋.

 

There are lost of things in LabVIEW people don't (or stopped to) complain about, because they've gotten used to it. Those might actually be the worse kind of issues: the ones we got blind to.

 

This one is rather silly. It sure wouldn't be high on my list of things to fix. It should be a quick one though. If it changed, people will probably complain that it changed after 30 years.

 

I personally never use any of those string constants, because they are annoying to change and not too insightful.

Message 7 of 14
(1,714 Views)

I made the mistake once and then made myself a subvi CR+LF constant.  I also agree with Darren, using the string constant "\r\n" make it obvious.

cstorey_0-1700498943316.png

 

Message 8 of 14
(1,686 Views)

@rolfk wrote:

wiebe@CARYA wrote:

andre.buurman@carya wrote:

It's counter-intuitive to me, I always interpreted it as a convenient constant that prevented me from the need to combine 2 constants or put the constant string with \r\n in code mode.


The icon doesn't help:

 

wiebeCARYA_0-1700474088220.png

 

I'd argue it gives the wrong impression...


There is another thread somewhere not that long ago (a month or two maybe) with the same claim. Considering that these icons have been in LabVIEW since at least version 2.x entirely unchanged, and always with the same behavior, it is amazing that after over 30 years people suddenly seem to fall over this "pitfall". 😁

 

Especially if these people are not newbies. Anyone having ever worked on more than LabVIEW for Windows knew this since the beginning of times. 😁


A point in rolfk's favor, the same symbol in

 

billko_0-1700500145593.png

means "convert EOL".

 

Edit: In no way is it intuitive, though.  (But context help for the

billko_0-1700500429437.png

plainly shows it is a platform-dependent constant.)

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 9 of 14
(1,679 Views)

The slash between the two symbols is regularly used in sentences to indicate (either/or) and even as (either/or/both).

Rolf Kalbermatter
My Blog
Message 10 of 14
(1,663 Views)