04-12-2011 04:32 PM
Hello,
I was wondering how to typecast a SGL Or DBL into a hex string? I tried number to hex, and format into string, etc but can't seem to figure it out.
The stirring doesnt need a sgl/dbl and is fine but the heating needs to work at a decimal point. since the device must multiply the heating by 10 (inputting 80 degrees gives out 800 to the device and it sets it to 80 degrees) turning it into a hex string shouldn't be a problem but i can't seem to figure this out.
Any help would be appreciated.
Thanks
04-12-2011 04:37 PM
Why not just typecast the the single precision number to a string (after multiplying by 10) just like you typecast the U16 to a string in the bottom portion?
04-12-2011 05:51 PM
as in replace the U16 with a SGL in between the numeric array and the type cast (in between the concatenating strings) ? i tried that but it doesn't work.
04-12-2011 07:14 PM
nevermind i put a U16 between 2 typecasts and converted the numbers. thanks for your help anyway!
04-12-2011 10:20 PM - edited 04-12-2011 10:21 PM
I meant like this which most closely represents what you did for the U16 conversion at the bottom half of your code.

04-12-2011 10:28 PM
i originally tried that but the device wouldn't read this command so instead i put a U16 convertor in between 2 typecasts after the multiplication sign. thus proceeding with the original commands.