09-01-2011 11:09 AM
I am attempting to communicate via serial to a circulating bath, however it requires all commands as a hexadecimal string. I generate a portion of the string as a constant however I need to convert a decimal setpoint and append it to the end of the string. I can convert the decimal into hexadecimal just fine, but when I concatenate the strings the setpoint is in ASCII not hex. I have tried a number of different avenues but am not having success. Any help out there?
Solved! Go to Solution.
09-01-2011 12:02 PM
Nevermind. Got it. Just needed to convert to I16 then typecast to hex.
09-01-2011 12:05 PM
This is something from my reuse library.
09-01-2011 02:13 PM
@Steve Chandler wrote:
This is something from my reuse library.
<Code deleted>
@Steve Chandler wrote:
This is something from my reuse library.
<Code deleted>
While very useful I don't think this addressed the issue the OP had. Rather than saying he needed the data in hexidecimal format I believe the correct term should have been binary. I read the post as stating he needed to send the binary equivilant of the number but need to have it as a string.
09-01-2011 02:29 PM
I was a unclear on that. I figured it out when I saw the typecast reply but that was posted before I hit submit.
I still don't know what "typecast to hex" means. The computer does not know what hex is and there is no "hex" datatype. It is something that is a human concept. But looking back at the original post again I see I should have read "binary"