02-04-2014 12:34 PM
@Detox92 wrote:
38 3832 34 as my data to send is incorrect im trying to send 8624 and it sends 3836 3234 instead (the ASCII version being converted to HEX i presume.)
Change your Number to Hex String to a Typce Cast.
02-04-2014 12:39 PM - edited 02-04-2014 12:39 PM
Can you please post your code so I can see what you're doing? I really think you're making things harder by using codes display or hex display as they show what is being sent in a less understandable fasion.
02-04-2014 12:40 PM
Yep, you are converting your number to a hexadecimal string, i.e., sending out the hex characters for "8","6","2","4". You want to typecast it (under Numeric->Data Manipulation). Use a string constant (any string) for data type. You won't see "8624", but "5618" because this is the hex version. If you really want to send "8624" then you multiply your original number (MHz) by 16, instead of 10.
Cameron
02-04-2014 12:42 PM
I think we're all making things harder than they are. A simple string containing the characters you want should do the job.
02-04-2014 12:52 PM
Code Added
02-04-2014 12:55 PM - edited 02-04-2014 12:56 PM
You forgot to replace that "convert number to hexadecimal string" to with "typecast":
Cameron
02-04-2014 12:58 PM
I'm not sure that's the problem. I think the problem comes where you split the hex string into 2 parts and add a 0 if needed. You're switching the noorder of the string and adding the 0 to the wrong part.
02-04-2014 01:07 PM - edited 02-04-2014 01:08 PM
Oh, I didn't notice that split string fork. Throw all that out.
Cameron
02-04-2014 01:26 PM
Also, your string constants are in hex display instead of normal display. What are you trying to send? Do you need to send ASCII Hex or numeric values? If ASCII Hex this won't work because what you see is not what you get because of the display setting of your string constants.
02-04-2014 01:42 PM
Assuming you want to send ASCII Hex try this:
The string constants are set to NORMAL display. The upper one has a space at the end, the lower one has a space at the beginning.
The TRUE case is just wired straight through.