Convertion Hex String to 32bits Decimal floating point??

Hi,
I would like to know how to convert hexa like: 416b0ac3 in decimal 32bits floating-point. The result of this string is suppose to be 14.690127.
So i must be able to do:
From 32-bit Hexadecimal Representation To Decimal Floating-Point
Thanks for your support
RiderMerlin

RiderMerlin
You can use the typecast function to do this.
David
Message Edited by David Crawford on 09-06-2006 03:31 PM
Attachments:
Typecast to Single.jpg ‏6 KB

Similar Messages

  • How do I convert a string into a decimal

    I've been tryin to convert a string into decimal but I can't get it to work at all. I keep getting an exception.
    I've tried all of these:
    double myDouble = Double.valueOf(string).doubleValue();
    int myint = Interger.parseInt(string);
    float myfloat = Float.parseFloat(string);
    I can't get anything to work.
    That string i'm reading in is an array containing values with decimals. ex: -45.09348
    All the above work fine if there is no decimal, but fails when it comes to one.
    How do I go about doing this?
    Thanks!

    This works for me:String s = "-45.6789";
    double d = Double.parseDouble(s);
    System.out.println(d);Mark

  • Converting Hex string to unicode

    I am reading in a hex representation of Unicode characters as a string.(for example: 004100200042)
    I want to convert the string from hex to unicode, and write the corresponding characters to a file. The output should look like follow:
    A B (0041 = Capital A, 0020 = space, 0042 = Capital B)
    Could you please assist?

    Problem solved, no need to look into it. Thank you

  • How to convert hex string to time stamp?

    Hello everyone..
    I am currently working on a project in which I have to read the data from a unit and display that data using LabVIEW. I am using serial communication for reading the data. The read data is in hex format. 
    Now, I want to convert this hex string to a time stamp value. I am reading total 16 bytes. How to convert this hex data to a time stamp value. I have developed a VI. But I want to know that the displayed time stamp is correct or not? Or suggest me some other solution. 
    I am using LabVIEW 2011.
    Thanks & Regards,
    Manisha
    Attachments:
    Test.vi ‏7 KB

    Hi mancan,
                      As Iam using LV2009 Iam unable to open your example.Anyway for converting hex to time stamp
    Thanks as kudos only

  • Convert IEEE-754 32-bit Hexadecimal to decimal floating-point

    Would this be very difficult?? I'm trying to find info, but maybe I need some help, anyone? Thank you for your answers... =D

    Hi! Thank you for answering me. You're right, It has been asked before, and typecast is perfect... But I have another problem..
    I found in other thread a VI (attached) that works just fine, but I can't put an input to it, it just works when you type the hex number in the front panel.
    Why? I'm trying to create a subVI with this, but it doesn't work like that and I want to know what I'm doing wrong.. =( Thank you!
    Attachments:
    TypeCast_SGL[1].vi ‏17 KB

  • Convert HEX String into HEX Array

    Hi!
    Probably a silly question, but I am looking for a way to convert a ROM ID number such as "5E03C21000BA" into an short hexadecimal array.
    The way to do this in C would probably be
    char[17] str_romID = "5E03C21000BA";
    uchar[8] romID;
    sscanf(str_romID, "%02X%02X%02X%02X%02X%02X%02X%02X",
    &romID[0], &romID[1], &romID[2], &romID[3],
    &romID[4], &romID[5], &romID[6], &romID[7]);
    but I can't seem to find a way to do this in LabVIEW. I would be very grateful if you could help me out with a sample program. Thanks ever so much!
    Stefan

    Hello Blondchen,
    I have attached a picture to my last explanation. This example doesn't take care of strings with an uneven number of chars!
    My array has only 6 numbers as you only gave a string with 12 chars... That's what I asked before: how should we know where to split your string to the single numbers? Normally I would take 2 chars to form a byte (as I did in the example). If you give me 16 chars I give you 8 bytes...
    I also think your C byte array will be an U8 array in LabView. If you REALLY need I8 numbers you can change the default type of the "hex to string" or cast to I8 (advanced->data manipulation->type cast) after the conversion.
    Best regards,
    GerdW
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    ConvertHexHex.png ‏13 KB

  • How to convert PM Module Breakdown Duration (AUSZT) floating point value into Minutes

    Hi Frnds,
    My requirement is to display a normal alv report. Out of which one of the filed is from VIQMEL-AUSZT (Breakdown Duration).
    Which is of Data type FLTP.
    Details:
    AUZTV
    AUZTV
    TIMS
    6
    Start of Malfunction (Time)
    12:39:19
    AUZTB
    AUZTB
    TIMS
    6
    End of Malfunction (Time)
    12:42:00
    AUSZT
    AUSZT
    FLTP
    16
    Breakdown Duration
    1.6100000000000000E+02
    Now I want to convert the value '1.6100000000000000E+02' into Minutes.
    Kindly let me know the solution.
    Note: I tried with standard FM 'PM_TIME_CONVERSION' and converted the break down value into hours.
    For example: 1.6100000000000000E+02 to 4,472222222222222E-02.
    But i want to convert the break down duration value into perfect minutes.
    With Regards,
    Sudhir.

    Simply equate to a variable of type P decimals zero. It should give you value in seconds. Divide it by 60 to have it in minutes.

  • Converting Floating Point

    I am receiving numbers from a Tinius Olsen Model 290 Universal Testing System.  I made a little program to send commands to the machine and receive the responses back as strings.  For the decimal value 3.7620 I get the floating point number EDC57040.  This is obviously not correct.  The correct floating point representation is 4070C5ED, which is accomplished by swapping all the bits.  I need to know how to do this in labview, basically go from the string representation of the floating point to the correct swapped floating point.

    Here is a simple example:
    Be aware that if you have an ancient version of LabVIEW, this option (byte order) is not available and you need to swap the bytes manually. No big deal, really.
    Message Edited by altenbach on 05-08-2007 01:15 PM
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    LittleEndianSGL.png ‏7 KB

  • Profibus data type converting to floating point

    Hi, 
    Is there an efficient way to convert  the incoming data to the floating point in the NI cRIO Profibus system? 
    1) The system is : NI cRIO 9068 Controller with Comsoft profibus slave module. The lavview we are using is 2013. 
    2) We are using profibus slave example and are able to see a array of unsigned 8 bit data. Please see the Output data shown in the attachement.
    3) On the other side of profibus system, thrid party profibus master are converting floating points and tranmit the converted data to NI profibus slave. 
    Attachments:
    Screenshoot.png ‏7 KB

    If it's just a matter of converting data types once you have the data in LabVIEW, you can always manually scale and convert the data using the arithmetic functions and the "To Double Precision Float" or "To Single Precision Float" functions. You just have to know what floating point value the unsigned byte integer corresponds to. Is that what you're asking?
    If you're asking for a way to this inherently with the Profibus functions, I'm afraid I can't be of much help...
    Ryan K.

  • Convert from String to Int

    Hi,
    I have a question.
    How do I convert from String to Integer?
    Here is my code:
    try{
    String s="000111010101001101101010";
    int q=Integer.parseInt(s);
    answerStr = String.valueOf(q);
    catch (NumberFormatException e)
    answerStr="Error";
    but, everytime when i run the code, i always get the ERROR.
    is the value that i got, cannot be converted to int?
    i've done the same thing in c, and its working fine.
    thanks..

    6kyAngel wrote:
    actually it convert the string value into decimal value.In fact what it does is convert the (binary) string into an integer value. It's the String representation of integer quantities that have a base (two, ten, hex etc): the quantities themselves don't have a base.
    To take an integer quantity (in the form of an int) and convert it to a binary String, use the handy toString() method in the Integer class - like your other conversion, use the one that takes a radix argument.

  • Conversion from hex string to bytes withh out ascii

    how to convert hex string to byte numbers without ascii codes,then all the converted bytes should come into a packets

    rajkumar5 wrote:
    how to convert hex string to byte numbers without ascii codes,then all the converted bytes should come into a packets
    What people consider ASCII and Hex with strings varies so much, you pretty much need to supply an example.  The best way is to create a VI with default data in the string control and indicator (to show what you want out).

  • Convert Floating Point Decimal to Hex

    In my application I make some calculations using floating point format DBL,and need to write these values to a file in IEEE 754 Floating Point Hex format. Is there any way to do this using LabVIEW?

    Mike,
    Good news. LabVIEW has a function that does exactly what you want. It is well hidden though...
    In the Advanced/Data manipulation palette there is a function called Flatten to String. If you feed this funtion with your DBL precision digital value you get the IEEE-754 hexadecimal floating point representation (64 bit) at the data string terminal (as a text string).
    I attached a simple example that shows how it works.
    Hope this helps. /Mikael Garcia
    Attachments:
    ieee754converter.vi ‏10 KB

  • How could I choose some bytes from HEX string and then convert it to a decimal value?

    Hi I am working with an OMRON E5EN temperature controller using VISA serial to get data, I send the Read from Variable Area command and get this string  in hexa 0230 3130 3030 3030 3130 3130 3030 3030 3030 3030 3041 3203 71 or .01000001010000000000A2.q in ASCII this string means:
    02 STX
    3031 3030 Node and subadress
    3030 End Code Normal Completion
    3031 3031 Command Read from Variable Area
    3030 3030 respt code Normal completion
    3030 3030 3030 4132 Hexadecimal A2 = 162  (this is the temperature data that I want to show in decimal)
    03 ETX
    71 Block Check Character
    I want to choose the eight bytes for the temperature data and convert it to a decimal number. I have seen the examples to convert a Hexa string to decimal but I do not know how to choose the specifics bytes that I need.
    I have look for a driver but i didn´t find any. I am a beginner so please include especific topics for me to study in your answer.
    Thanks
    Carlos Fuentes Silva Queretaro Mexico 

    If the response always has the temperature starting with byte 15 and is always 8 bytes in length, you can use the String Subset function to get those bytes out of the string.  Then use Hex String to Number to convert to a decimal number.
    Well someone already beat me to the solution:
    Message Edited by tbob on 01-04-2008 04:42 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    HexStr2Decimal.png ‏7 KB

  • Convert string to floating-point

    Hi all,
    ..very basic question, but I tryed it for hours and only received short-dumps
    <b>How can I convert a string into a floating-point number?</b>
    Kind regards,
    Stefan

    hi
    try this
    to convert  string to float.
    data : a type f,
    s type string value '1.023'.
    a = s.
    write :/ a.
    to convert float to string.
    data : a type f value '1.023',
    s type string.
    s = a.
    write : s.

  • Convert hex to float

    I have to convert a bit Hex string into a float. I built a vi from the following C code, but it only works on positive numbers. Any suggestions?
    sample16 = (short) ((MSB << 8) | LSB);
    sample = (float)sample16/32768.0;
    sample*=10.0;
    Attachments:
    Parse Response.vi ‏13 KB

    [email protected] wrote:
    Hi altenbach
    The data is come from flowmeter by MODBUS. 
    Thanks
    Hong
    You are not giving us any useful information.  Look up the manual of your device.  Somewhere in there should be a definition of how the numbers are built up.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for

  • Windows 8 Laptop Boot Issue (and other related problems)

    My Toshiba Satellite S855D-S5148 laptop was bought about a month ago, but it's been giving me issues for the last week. The most significant one was a boot issue, where out of nowhere, the PC would not start, and after a hard restart, I received an e

  • E52 t9 typing lag

    hi nokia, i am having some problems with my e52 typing sms in t9. I have been using t9 nokia for many years and many previous models, but the e52 seems to be unable to detect my typing fast enough. I am very sure that i press the keys with a definite

  • Connecting 3rd party devices to my computer

    How do I connect lap tops and i phones to my imac so that they can access app stores etc?

  • Oracle 91 application server instalation

    i am trying to load oracle 9i on my system windows NT/95 from cd drive.i am getting a error message "invalid stage location.there atre no high level components available for windows 98 at this location". help me in this regard null

  • Syncing to one itunes, and video location.

    my first problem is that i got an itouch and first connected it with a computer and itunes that wasnt mine (family members) but now im using my own computer and itunes and i cant sync my itouch without erasing everything on it. itunes says that the i