05-11-2010 12:40 PM
Hello,
I have to convert integer signed 16 bytes to is decimal value.
For example the lower byte has xCC and the high has xFF who do in decimal -52.
The string that come from the instrument is xFFCC. What I can use with Labview ?
Labview 6.1
Windows XP
Solved! Go to Solution.
05-11-2010 01:06 PM
Each character is a U8 use join to meke it a U16 then cast to I16.
FF join CC produces xFFCC or 65485 convert to I62 =-52
05-11-2010 01:06 PM
05-11-2010 01:21 PM
I think a type cast from string to I16 shall solve it.
05-11-2010 01:46 PM
Don't work
05-11-2010 02:03 PM
05-11-2010 02:28 PM
05-11-2010 03:07 PM - edited 05-11-2010 03:08 PM
You don't do anything differently.
If it is xFF and xCC, it will look like this in normal display.
Your issue was that you typed in FFCC in normal display which is 4 bytes consisting of x46 x46 x43 x43 (the ASCII values of "F" and "C")
05-11-2010 03:31 PM
My reading of the question is that the OP receives a string of 5 ascii characters from an instrument via RS-232 and would like to convert the hex number into an I16. I assume you receive 'xFFCC' from the instrument (5 characters). I am fairly certain this function was around in LV6.