11-10-2010 09:41 AM
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:
Thanks in advannced.
11-10-2010 09:56 AM - edited 11-10-2010 09:56 AM
Add a \s to your format string where you want the space.
Remove the space that goes in to the format string
11-10-2010 09:56 AM
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.)
11-10-2010 09:58 AM
@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
11-10-2010 09:58 AM
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.