cancel
Showing results for 
Search instead for 
Did you mean: 

TERMINATION CHARACTER

SOLVED
Metachnet
Member
Solved!

TERMINATION CHARACTER

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.

15 REPLIES 15
Knight of NI

Re: TERMINATION CHARACTER

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.

Metachnet
Member

Re: TERMINATION CHARACTER

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.

altenbach
Knight of NI

Re: TERMINATION CHARACTER

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

Highlighted
Metachnet
Member

Re: TERMINATION CHARACTER

Message contains an attachment

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.

RavensFan
Knight of NI

Re: TERMINATION CHARACTER

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.

Knight of NI

Re: TERMINATION CHARACTER

Message contains an attachment

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.

altenbach
Knight of NI
Solution

Re: TERMINATION CHARACTER

Message contains an image Message contains an attachment

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:

 

 

 

Metachnet
Member

Re: TERMINATION CHARACTER

Thank you all very much

Metachnet
Member

Re: TERMINATION CHARACTER

YOU ALL WERE VERY HELPFUL

HOW CAN I ACCEPT ALL OF YOUR SOLUTIONS.