LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TERMINATION CHARACTER

Solved!
Go to solution

1. How do I Input Termination Charecter  (\r\n) into Format into String Function.

It seams that there is a mismatch of Variablew/representation when I use the Pink LV EOL Constant.

2. What is the Format Spesificatopn (%) for (\r\n), in Format into string function input Constant.

 

Thanks.

0 Kudos
Message 1 of 16
(4,771 Views)

You can just hit the return key on your keyboard to enter new lines. If you change your string constant to show '\' codes (right-click and select '\' Codes Display) then you can see the explicit '\' codes and change \n\n to \r\n.

Message 2 of 16
(4,763 Views)

I did that,  (Code display is in "\") but in the output string instead of showing \r\n it shows D. maybe somthing wrong with the Formating.

0 Kudos
Message 3 of 16
(4,756 Views)

Please attach a small VI containing the string in question as default data in a string control. (make current value default before saving).

0 Kudos
Message 4 of 16
(4,751 Views)

was not able to set defalt value, but I used any Integer number.

 

1. why the output is D instaed of \r the display mode is "\"

2. Why it is only D which is \r, but not \r\n for EOL.

3. why it is not 0D. How to make it displat hex 0D.

0 Kudos
Message 5 of 16
(4,735 Views)

You are not sending the byte x0D which is a carriage return, but sending two characters of "0" and "D".  That is not the same thing.  If you set your string indicator to hex code display, you'll see.  You do not want to use the Format into String function.

 

Create a string constant.  Set it to \code display.  Type in \r.  Now you have a carriage return.  If you set it to hex code display, it will show 0D.

Message 6 of 16
(4,729 Views)

Now you are asking something different. Casting an EOL to a number doesn't make much sense since the EOL is platform-dependent. On Windows it's two characters: CRLF. On Linux it's LF. On Macs it's CR. If you explicitly want to add a CR LF then do as I said and simply enter that directly in the format string. As far as what to have it display, simply change the display mode.

 

It appears that you are trying to send commands to some instrument that requires byte values. In that case I think what you really want is to have the Type Cast on the number.

Message 7 of 16
(4,718 Views)
Solution
Accepted by topic author Metachnet

If you format as %x, you are translating the unprintable characters to letters and numbers. That's not what you want.

 

Here are two possible solutions:

 

 

 

Message 8 of 16
(4,717 Views)

Thank you all very much

0 Kudos
Message 9 of 16
(4,703 Views)

YOU ALL WERE VERY HELPFUL

HOW CAN I ACCEPT ALL OF YOUR SOLUTIONS.

0 Kudos
Message 10 of 16
(4,698 Views)