Hex String to 'Ascii Hex' String!

I am having a mental block and wonder if someone can help!!
I am reading a serial device and getting a hex string back. I need to display this hex string to the operator within a pop-up box (PDA). The Message box will obviously contain normal text with the HEX code appended to the bottom.
When I run the code the pop-up box displays the legible message to the user but the HEX string returned appears in the appropriatte ascii characters (because the pop-up displays normal string).
My question is, how to make an hex string appear within a normal display string indicator 'the same' as it appears in its Hex display indicator:
0x0A1C - Hex display needs to appear as 0A1C in normal display string indicator.
Thanks in advance
ssk
Solved!
Go to Solution.

See picture.
Message Edited by andre.buurman@carya on 04-08-2009 12:41 PM
Regards,
André
Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)
Attachments:
Hex string to normal string.png ‏4 KB

Similar Messages

  • Hex string conversion to ASCII Character string

    I have a Hex String 494A4B4C and want this string to get converted in ASCII Character String. IJKL. How to do in Labview 8.5.

    Here is a screenshot of the described code:
    Ton
    Message Edited by TCPlomp on 30-09-2009 01:35 PM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Example_VI_BD.png ‏3 KB

  • Replace hex character in a string with another hex character

    Hi Guys,
    Heres a problem scenario, hex character 92 looks very much like hex character 27 (apostrophe).
    I need to write a program that can replace all hex character 92 to hex 27 in a string.
    Being a novice on the regular expressions, I would appreciate if somebody can show
    the exact syntax to to perform this replacement.
    Many Thanks
    -Anil

    I don't think you need to use regex to do this:
    String s = something();
    char a = 0x27;
    char b = 0x92;
    s.replace(a,b);
    And don't forget that since Strings are immutable you need:
    s = s.replace(a,b);to do anything useful.

  • Non-hex character in a hex string error message

    Hi everyone,
    I encountered n error message in Illustrator "Acrobat PDF File Format is having difficulties. Non-hex character in a hex string." when trying to open a particular file.
    File was originally created on a Windows 7 PC, tried opening file on Mac OS 10.7.5, same Illustrator version 18. Also tried opening in PDF, Distiller, but didn't help.
    Did tried to change Illustrator Preferences in both Windows and Mac, following the steps in the TecNote:
    http://kb2.adobe.com/cps/500/cpsid_50031.html
    When trying to open the file from the File > Open menu, with the keys held down, it did not open a blank file window, neither did it created a duplicate copy in the Finder where the file is located.
    The file in question had about 15 artboards,  a few embedded images, approx 2.6MB size.
    Any suggestions/assistance would be greatly appreciated.
    Thank you.

    Hi Monika,
    The file was .ai file, as mentioned earlier, was created in Illustrator ver 18.
    Not emailed, stored in the folder, on the Windows PC, not a server. Last saved few days ago, tried to reopen the file from the same computer, but could no longer opened.
    No, Illustrator did not crash, just the error message "Acrobat PDF File Format is having difficulties. Non-hex character in a hex string."

  • Non-hex character in a hex string

    My Illustrator file will not open in Illustrator and I get the "non-hex character in a hex string" window whenever I try to open it. It does open in Acrobat but nothing else. I can't even save it as a pdf file..
    Is there any way I can get around that or fix it?

    karam,
    The first thing to try is to use File>Place in a new document and see how much, if anything, is saved this way.
    The next thing to try is to repair the file code, which is more difficult. The basics are told in this TechNote, the actual recovery consists of changing/adding/deleting code.
    http://kb2.adobe.com/cps/500/cpsid_50031.html

  • Question about string constant in Hex display format

    how to get a plus of 2 string constant which is display in Hex display like attahced, for example I have string "28" and "5D" in Labview which has been in Hex format, the plus of this 2 string should be "85" in Hex. pls help on this, thanks
    Attachments:
    1.jpg ‏21 KB

    This'll work, too.  I'm afraid of casting types...
    Jm
    Jim
    You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
    Attachments:
    hex.png ‏2 KB
    hex.vi ‏7 KB

  • How can I convert a string of hex values to a hex format string programatically?

    Is there a way to convert a string of the following format:
    1400010107070D0305006A01 ........           ("Normal display" string)
    programatically to:
    1400 0101 0707 0D03 05006A01 ..........      ("Hex display" striing)
    I need to do this in order to calculate a CRC16 value.
    See attached VIs
    Thank you.
    Solved!
    Go to Solution.
    Attachments:
    CMM_SN_MULTI.vi ‏50 KB
    CMM_CRC16_Calculator.vi ‏23 KB

    You can iterate over the string and use the String to Hex VI. If you work with two bytes of the string at a time you can get a U8 array of the desired binary values. Then when you are complete you can either work with the byte array of convert it back to a string using Byte Array to String.
    EDIT: GerdW typed faster than I did.
    Message Edited by Mark Yedinak on 03-18-2010 02:55 PM
    Mark Yedinak
    "Does anyone know where the love of God goes when the waves turn the minutes to hours?"
    Wreck of the Edmund Fitzgerald - Gordon Lightfoot

  • Converting a hexadecimal string to ASCII-characters.

    I have long hexadecimal strings that I wish to convert to their corresponding ascii-characters. I know there are a series of functions for doing things like this - hex to number, number to string etc.
    At the moment, however, I am stuck at entering the hexadecimal string. I connect it to "hexadecimal string to number". What I get out is the decimal value of the two last digits of the hexadecimal number. No other wires are connected to the function. This means data is lost. How do I get around this? Is this particular function at all suitable for what I am trying to do?

    Hi Tzench,
    "hexadecimal string" isn't very accurate and conversion questions have been discussed many times before...
    See example on conversion of two different "hexadecimal" strings. There are other conversion methods, but those are most easiest to understand
    Message Edited by GerdW on 12-08-2008 11:27 AM
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome
    Attachments:
    HexString_LV71.vi ‏35 KB

  • How to convert signed ascii hex to float value

    Hi,
    I have a requirement to convert IEEE ascii hex to float value.
    Following code is working for +ve float value but it didn't work for -ve.
    public static float hexToFloat(String str){
              float floatVal= 0.0f;
              int decimalValue =Integer.parseInt(str,16);
              floatVal=Float.intBitsToFloat(decimalValue );
              return floatVal;
    for example "BE4CE1E6" should return -0.20 . (i verified in http://babbage.cs.qc.edu/IEEE-754/32bit.html )
    For the above string I am getting number format exception.
    pls help me.

    The problem is the parseInt method. It can only process numbers up to 2147483647 or 7FFFFFFF. Because that method expects a signed number.
    The solution is to use Long.parseLong() instead.
    public static float hexToFloat(String str){
    float floatVal= 0.0f;
    int decimalValue =(int)Long.parseLong(str,16);
    floatVal=Float.intBitsToFloat(decimalValue );
    return floatVal;
    }

  • Convert integers to equivalent characters in string - NOT ASCII code character

    I have to output my data and associated string information to a string array and then to a spreadsheet file.
    I want to do this by converting integers (and other numbers) to an identical string of characters.
    I have tried Type Cast with a string constant as the type input but it DOES NOT WORK.  Instead, I get the ASCII character whose numerical designation matches the integer, e.g. integer "50" become capital "P".
    I want integer "50" to be string "50".
    Please advise and no, I do not want to make arrays of clusters.
    Solved!
    Go to Solution.

    I found my answer but only after searching for "Number" conversion rather than "Integer" conversions.
    In the Programming palette  - String Functions - String/Number Conversion - Number to Decimal String:
    "Converts number to a string of decimal digits at least width characters wide or wider if necessary. If number is floating-point, it is rounded to a 64-bit integer before conversion."

  • How can i convert values in my string to ascii characters

    Hi guy.
    I am wrinting a code but i m stuck, I have a string with (Battle of Midway) in it, Now i want to convert each character in this string with the asci character,,,
    String temp = {"Battle of Midway"};
    so the ascii will be:
    B=66 a=97 t=116 l=108 e=101 o=111 f=102 M=77 i=105 d=100 w=119 y=121
    i found all these number for all the charachers, but i donno how to covert this string into ascii characerts... ofcurse i can do it one by one...but is there any class or method i can use for this,,,,, Once i convert all the character (from string) to ascii character THEN i have to convert it back from ascii to character,,
    Is anybody has any idea
    Thanks alot in Advance

    You get get the ascii code for those characters by doing something like:
    int ascii = str.charAt(0); //Get ascii value for the first character.
    Kaj

  • How to convert character string into ascii format correctly

    dear all
    I'm using encryption technique in my application(oracle formas 6i). character stream convert to the ascii format and add some numeric value and again convert to the character format
    >>>>
    here I'm using ASCII and CHR functions.
    >>>>
    .net program also using same algorithm to encrypt this password.....finally both the character strings are not equel.(This happens if the character string's ascii value greater than 127. otherwise both are equel).
    pls give me a solution for this
    thanks and regards
    buddhike

    hir dear
    do u want to encrypt & dcrypt your password.which version of oracle you are using
    first store these procedure in Oracle Databases: dbms_obfuscation_toolkit, dbms_crypto, Transparent Data Encryption
    now u can use these procedure to encrypt & dcrypt your password
    if you any query about those procedures you can ask me
    best regard
    amk

  • Converting unicode string to ASCII

    I'm using a 3rd party API and I'm receiving the following unicoded string through an API:
    Original string: "Bill%u002b%u002526%u002bHarry%u002bUsers"
    The ASCII value is supposed to be:
    Desired string: "Bill & Harry Users"
    How do I convert the original string to the desired string?
    Any sample code would be greatly appreciated!
    Thanks

    could look someething like:
    public class Decoder
      public static String decode(String string)
        StringBuffer result = null;   
        int pos = 0;
        int idx;      
        if( string != null )
          result = new StringBuffer();
          while( pos < string.length() )
            idx = string.indexOf("%u", pos);
            if( idx >= 0
                && idx + "u0000".length() < string.length() )
              result.append( string.substring(pos, idx));
              pos = idx;
              result.append( (char)Integer.parseInt(
                      string.substring( idx + "%u".length(), idx + "%u0000".length() )));          
              pos += "%u0000".length();
            else
              result.append( string.substring(pos));
              pos = idx;
        return result != null ? result.toString() : null;
    }

  • Re: conversion of hexa digit to ASCII format

    Hi all,
    Is it possible to convert hexa digit into ASCII format .
    Regards,
    Alex

    This will work:
    data: hex type x VALUE '20',    "for space character
          ascii type i.
    ascii = hex.
    write: / 'Hex:' x, 'Ascii: ' ascii.

  • Convert String from ASCII to ANSI

    Hi,
    a command line instruction via LabVIEW function "System Exec.vi" retrieves me a string in ASCII format. Is there a function to convert string from ASCII to ANSII format? I use LabVIEW 8.5 German Installation.
    Kind Regards
    Christian
    Test Engineering
    digades GmbH
    www.digades.com

    Hallo Christian,
    AFAIK there is no such in function in LabView...
    But you can:
    - use "Search and replace string" to search for ASCII chars and replace them by their corresponding ANSI char, do this in a loop for all chars to be replaced (acceptable speed for small strings...)
    - convert the string to an U8 array and use a lookup table to convert all bytes from ASCII to ANSI, convert back to string (may be faster for long strings...)
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

Maybe you are looking for