How to display char code properly?

Hi all,
  I am trying to convert the decimal numebr (0 to 127) to a char (ASCII code). I found the code here http://digital.ni.com/public.nsf/allkb/894CF5FE064​971BF8625758400014993
I try with several numbers but it doesn't shown the same character as shown in http://digital.ni.com/public.nsf/allkb/475C4E4F3A6​38AA58625795F007EC531?OpenDocument
For example, I tried 104, it shows "@ " but it should be "h". I tried 33, it shows "@" but it should be "!" (no quotation). I wonder what's the right way to do the converstion or is it the wrong way to display it?
By the way, if I have an array for decimal numbers, besides using loop and code like above to convert all of them to ASCII one by one, is that any faster way to do the conversion? Thanks.
Solved!
Go to Solution.

johnsold wrote:
PKIM,
Typecast is not the function to use for what you want to do. It forces the binary representation of the data to be re-interpreted as a different datatype. The Extended datatype is particularly problematic as it uses different binary representations on different platforms.
1. You should use a binary datatype, specifically U8, for numbers which will be converted to characters in a string.
2. If the input is U8, typecast to string actually works.
3. For an array (of U8) use the Byte Array to String function.
4. To convert a string to an array of U8 use the complemantary String to Byte Array function. 
5. These functions may be found in Nuumeric >> Conversion or String >> Path/Array/String Conversion palettes/
Lynn
Thanks johnsold, it does help. I have a question about the data conversion. If the array of interger is a word (two-byte integer) and I would like to convert each byte of the word to ASCII. How can I do that? I mean how can I extract the first 8 bits and bit 8 to bit 15 from a word in labview? It is pretty easy to do so in C/C++ but I don't know how to do that in labview.

Similar Messages

  • How to display source code of a webpage in Safari 7.0?

    Hello. I'm unable to find how we used to once enable developing tools in Safari Preferences or simply CMD + ALT + A to display the source code of a webpage. Now I've no clue how to display source code of a webpage in Safari 7.0 on Mac OS X Mavericks. Help.

    Hi gss2,
    Make sure you are not under the Apple icon but under Safari>Preferences>Advanced. All the way at the bottom check the box that says: "Show Develop menu in menu bar."
    Now go back to the page you want to get the source code for, right click on it and choose Inspect Element. Hope this helps.
    Cheers,
    LURDS LLC

  • How to display COMPANY CODE DESCRIPTION ON THE TOP LEFT OF PAGE

    How to display COMPANY CODE DESCRIPTION(Field BUTXT) ON THE TOP LEFT OF EVERY PAGE OF THE REPORT GENERATED.
       Actually I have collected BUTXT using
    'select butxt into table itab from t001 where bukrs = p_bukrs'
    where p_bukrs is the selection screen field.
    REQUIREMENT: Depending on what company code we give on the selection screen, corresponding company code description(butxt) should be displayed at the top left of every page. how would i display it in TOP-OF-PAGE EVENT.

    Hi
    It's very simple, but what is the need to use <b>into table itab</b> in your select query.
    Rather, define a variable
    data: v_butxt type t001-butxt.
    Select butxt into v_butxt from t001 where bukrs = pbukrs.
    TOP-OF-PAGE.
    write :/ v_butxt.
    Regards
    Surya.

  • How to display BAR-CODE through ABAP report

    Hi,
    Could you please help me, how to display BAR-CODE through the ABAP report.
    I am writing below code, but BAR-CODE is not displaying on report.
               PRINT-CONTROL FUNCTION 'SBP01'.
                WRITE: 20  BAR_CODE1 NO-GAP.
               PRINT-CONTROL FUNCTION 'SBS01'.
    Regards,
    SSRAJU.

    Hi RAJU,
    you can see this forum link and its sub-links, here it is clear about it.
    Re: Barcode printing on report
    Thanks & Regards,
    Dileep .C

  • Please let me know how to display source code

    Hi everyone.
    my name is Kazuma working in Japan.
    We have a problem with SE38.
    We transport one of executives program, which made from other development system, to our system.
    When we use SE38 and display botton, we encounter short dump like below and can't see source code.
    We want to know how we change BASIS or program.
    If somebody know similar situation, please let us know.
    >>ERROR MESSAGE
    The Import dataset has been destroyed
    What happened?
    The current ABAP/4 program "SAPLLOCAL_EDT1" had to be terminated because one of the statements could not be executed
    This is probably due to an error in the ABAP/4 program
    Error analysis
    The dataset could not be imported because it was in an unexpected format
    This is usually because the dataset has been destroyed as a result of directly manipulating the IMPORT/EXPORT data by other means (such as explicitly deleting parts of the dataset with SQL commands instead of using DELETE FROM DATABASE, u2026)
    In this case, the dataset header is already invalid
    In other words: The version ID of the dataset is invalid
    System environment
    SAP Release          4.6C
    Application server          sdax31
    Operating system          SunOS
    Release                    5.8
    Hardware type          sun4us
    Database server          sdax31
    Database type          ORACLE
    Database owner          SAPR3
    SAP kernel          46D
    Patch lebel          1646
    Patch text          ""
    Information of where termination occurred
    The termination occurred in the ABAP/4 program "SAPLLOCAL_EDT1" in "GET_MODIFICATION_INFORMATION"
    The main program was "RSABAPPROGRAM"
    The termination occurred in line 143 of the source code of program "LLOCAL_EDT1U36" (when calling the editor 1430)
    Edited by: kazuma mukai on Mar 3, 2009 6:34 PM

    Welcome to SCN
    Try to
    create the same program in your DEV client , by cut & paste the code from the other envionment , this will create a transport, activate the program and transport.
    This will be roundway solution
    Do you have any previous version to this program in the version management?

  • How to display plant code instead plant description?

    Hi,
    In tx ME21N, ME22N and ME23N, how can I display the plant code instead the plant description?
    Thanks in advance.

    Hi,
    Click the personal setting push button.  There click the display key check box.  Then try.
    Regards,

  • How to display html code in posts?

    I thought it was < code> and < /code> to show the actual html.

    No.
    Not looking to do a link.
    I want to show the actual htlm code on the screen.
    I want to display this;
    is this working
    but in order for me to do it, I had to put a space after the "<"http://discussions.apple.com/thread.jspa?threadID=649518&tstart=0">is this working

  • How to display html code in diplaytag field?

    Hi all,
    I have a html text that needs to be displayed in a table. I build the dynamic table using display tag library. I tried using TableDecorator. But I dont want to build the message on the fly when jsp is opened, instead I want to display the text which is already stored in database as preformatted html text. Can I able to do this, without using any decorator class. Do I need to set any attribute value to achieve this. Any help is appreciated.
    Thanks

    No.
    Not looking to do a link.
    I want to show the actual htlm code on the screen.
    I want to display this;
    is this working
    but in order for me to do it, I had to put a space after the "<"http://discussions.apple.com/thread.jspa?threadID=649518&tstart=0">is this working

  • How to display xml code in page?

    Hi,
       I have a string which content is a xml file, I want to display the content of string in xml mode, such like dispalying a xml file in IE browser. How to do it?
        Thanks a lot!

    set the MIME type of the page to "text/xml".
    while creating the page if you create it with extention .xml, the system would automatically set this for the page.
    and just place the string holding the XML in the layout .
    <%=stringholdingxml%>
    Regards
    Raja

  • In jsp how to display code?

    in jsp how to display some code like this:
    String body=body1;
    String body_new="";
    int Position = 0;
    while(true){
    int index = body.indexOf(0x0D, Position);
    if(index == -1){break;}
    if(index > Position){
    body_new += body.substring(Position, index);
    body_new += "<br>";
    Position = index +1;
    if(Position >= 0){
    body_new += body.substring(Position);
    body=body_new;
    ==================
    i find IE will not display the "<br>" and some char like "'"
    i use text textarea post
    thanks

    let us say this page as code.jsp
    code.jsp
    this is the u need to follow.........
    String body=body1;
    String body_new="";
    int Position = 0;
    while(true){
    int index = body.indexOf(0x0D, Position);
    if(index == -1){break;}
    if(index > Position){
    body_new += body.substring(Position, index);
    body_new += "<br>";
    Position = index +1;
    if(Position >= 0){
    body_new += body.substring(Position);
    body=body_new
    this is the sample usage ok

  • How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    How to display or generate PDF417 barcode dynamically in PDF form? I am using Acrobat XI Professional and there is a Bar Code Field in the same through which I generated the same. But I want to generate the same dynamically.

    What do you mean by dynamically? When yo set up a 2D bar code field you specify which field name/value pairs you want to include, along with other parameters. But be aware that they won't work with Reader unless you Reader-enable the document with LiveCycle Reader Extensions and include the bar code usage right. It will work with Acrobat Standard/Pro.

  • How can I display char if a variable is null

    Hi All,
    How can I display char if a variable is null  in sap business object
    item name
    Office Visits
    Non-Emergency ED Utilization
    Non-Preferred Pharmacy
    above items are value and they are populating for this month but form next month "Inpatient Stays" a new item will add at database level
    i want to display this item with current month
    final result should be
    item name
    Office Visits
    Non-Emergency ED Utilization
    Non-Preferred Pharmacy
    Inpatient Stays
    i have tried with ISNULL function but it is not working
    please help i am using SAP BO 3.1
    Thanks in Advance
    Ranjeet

    You should be able to findout NULL using isnull([object]) function.. at report layer..
    Try with the below formula which should work for you
    =If Isnull(trim([object])) then "Inpatient Stays" else [Object]

  • How to display values and new char line (blank line)

    Hi,
    In database, one field contains values followed by new character lines (blank lines) after blank lines there is no values. Finally, I would say the field contains values and blank lines. Every thing is fine in database.
    In Crystal Reports the field is displaying only values. Need to display values and blank line.
    User is asking after values new character lines (blank line) to be shown. They enter like that in an application. The user doubt is why report is not showing what they enter in the application.
    In detail explanation, front end tool is ASP.NET and backend is SQL Server.
    User enter some values in note field, after that they hit enter button in the same field, cursor will go next line...user may hit u2018enter buttonu2019 more than 5 times. So note field contain values and some blank lines which are created by after hitting enter button.
    If user opens the application, they could see values plus blank lines in the note field.
    They are fine with the application.
    In Crystal Reports, the note field shows only values.
    User is questioning that why we could not see in report we enter.
    I checked in .Net application and SQL server database it is fine. It is displaying values and blank line.
    Please help me out how to display values followed by blank lines in Crystal Reports - the way they enter in the application.
    Thanks and Regards,
    Manjunath N. Jogin

    Hi,
    Sharonmat,
    I tried as you suggested. It is still displaying only values.
    I would like to explain again.
    it is not exactly null values.
    In .Net application it is called 'new char line'.
    it shows those many lines look like null.
    it is working fine in database.
    Why it is not working in Crystal Reports? I am wondering...
    Thanks for your suggestion.
    Debi,
    User may enter any number of blank lines or they may not enter blank lines.
    That is the reason I can not always give more height or blank text object.
    Thanks for your suggestion.
    Please suggest me some more suggestions,
    Thanks and Regards,
    Manjunath N. Jogin

  • How to display the data of CJ2C(T-CODE) using web dynpro abap

    Hi all:
        How to display the data of CJ2C(T-CODE) using web dynpro abap.
        CJ2C used to display a Gantt Chart.
        Thanks.

    Hi,
    Create a Value attribute (resource) of type Resource, bind it with the property of File Upload UI element.
    On action place the code and Deploy the application
    byte[] bytes = new byte[ 1024];
    FileOutputStream out = new FileOutputStream( new File( <path in server>));
    InputStream in = resource.read( true);
    int len;
    while( ( len = in.read( bytes)) > 0)
         out.write( bytes, 0, len);
    in.close();
    out.close();
    Regards
         Vinod V

  • How to display rectangles with the following code in a JPanel?

    I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
    //Declare variables
        private int x;
        private int y;
        private int width;
        private int height;
        private Color color;
        Random rand = new Random();
        public class RectanglePanel extends JPanel
            public void displayRectangles()
                // Declare an arraylist of MyRectangles
                ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
                int maxNumber = 300;
               // Declare Frame and Panel
                JFrame frame = new JFrame();
                Container pane = frame.getContentPane();
                RectanglePanel rect = new RectanglePanel();
                // Set Frame attributes
                frame.setSize(700, 500);
                frame.setLocation(100,100);
                frame.setAlwaysOnTop(true);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setTitle(" Rectangle Program");
                frame.setVisible(true);
                for (int i = 0; i < maxNumber; i++)
                    MyRectangle rec = createRandomRec();
                    myArray.add(rec);
                    rect.repaint();
            public MyRectangle createRandomRec()  
                   x = rand.nextInt();
                   y = rand.nextInt();
                   width = rand.nextInt();
                   height = rand.nextInt();
                   color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
                   return new MyRectangle(x, y , width, height, color);
        }

    I am trying to make a bunch of random rectangles appear inside a JPanel on a GUI form. Im not sire how to display the form and panel with random rectangles. I have in my package the MyRectangle class, a blank JForm class called RectGUI and the class for the panel RectGUIPanel. The following code is from my panel and it should create random rectangles okay but how do I display them inside of a Panel on my RectGUI form? Thanks for the assistance.
    //Declare variables
        private int x;
        private int y;
        private int width;
        private int height;
        private Color color;
        Random rand = new Random();
        public class RectanglePanel extends JPanel
            public void displayRectangles()
                // Declare an arraylist of MyRectangles
                ArrayList<MyRectangle> myArray = new ArrayList<MyRectangle>();
                int maxNumber = 300;
               // Declare Frame and Panel
                JFrame frame = new JFrame();
                Container pane = frame.getContentPane();
                RectanglePanel rect = new RectanglePanel();
                // Set Frame attributes
                frame.setSize(700, 500);
                frame.setLocation(100,100);
                frame.setAlwaysOnTop(true);
                frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                frame.setTitle(" Rectangle Program");
                frame.setVisible(true);
                for (int i = 0; i < maxNumber; i++)
                    MyRectangle rec = createRandomRec();
                    myArray.add(rec);
                    rect.repaint();
            public MyRectangle createRandomRec()  
                   x = rand.nextInt();
                   y = rand.nextInt();
                   width = rand.nextInt();
                   height = rand.nextInt();
                   color = new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
                   return new MyRectangle(x, y , width, height, color);
        }

Maybe you are looking for