LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

STRING OUTPUT ASCII SPACE

Need to send space " " which is d32 or h20 ASCII character to form an output string.

my problem that on the output it ads extra h30.

how can I change the code to reflect this change.

Current output is 3230 0D0A

attached:

CODE

Thanks in advannced.

0 Kudos
Message 1 of 5
(3,658 Views)

Add a \s to your format string where you want the space.

 

Remove the space that goes in to the format string


Paul
Message 2 of 5
(3,645 Views)

Do you really know what you want to send?

 

First of all, your format string shows \r \n in normal display rather than \code display.

 

Second, you are converting a space (ASCII decimal 32, hex 20) to the hex string of "20" which shows up in your string indicator set for hex display as 32 30, the ascii codes in hex for a 2 and a 0.

 

You can just send the space character as string.  That or use typecase to cast the numerical value of 32 (dec) to a string (which is a space.)

Message 3 of 5
(3,644 Views)

 


@Ravens Fan wrote:

 

First of all, your format string shows \r \n in normal display rather than \code display.

 


for the format string input, you do not need the constant in \code 

 


Paul
Message 4 of 5
(3,639 Views)

You've actually already asked this question in a different way before. The 0x3230 is the value of the numeric control as a hex string. Your numeric is probably set to decimal 32. The %x conversion converts the number to a hex string, NOT a value displayed in hex. This is an important difference, and it was something I pointed out in my response #7 in your previous thread. This means you will get the string "20" from the format of %x. These are 2 characters: "2" and "0". The ASCII code for "2" is decimal 50 (hex 0x32), and the ASCII code for "0" is decimal 48 (hex 0x30). That's what the 3230 in your string is. It has nothing to do with a space.

 

Message 5 of 5
(3,638 Views)