How to display a binary file

Hello,
I am working on creating program that lets me display data I've collected and stored in a binary file. Here is the code (+pic of the program) for collecting and storing the data. Data will be recorded on multiple channels (possibly 4 channels). The program I've attached can display the data in real time as data is being collected. My issue is just to call back all the data and display it in a graph that shows all the data from all channels. I'm stuck on creating this display program. Any help would be greatly appreciated.
Thank you
Attachments:
Program.vi ‏190 KB
program1.JPG ‏91 KB

The way that data is stored in disk in LabVIEW is documented.  Check out the waveform datatype in this help file.
I had a fairly indepth discussion about this with someone who wanted to use this to do a 'random access' read of the variant attributes of a waveform, without loading the whole thing.
It's fairly deep in the grass, but then again you are dealing with 1's and 0's
Regards,
Peter D

Similar Messages

  • How to display a pdf file in jsp

    hi,
    How to display a pdf file in jsp iam having a class which will return fileinputstream of the file object. the pdf file is in server.
    regards
    Arul

    A JSP is a combo of HTML and Java, so you can't really "display" a PDF file in a JSP.
    You can provider a href link to the PDF file in your JSP.
    You can use some utility package to read the contents of the PDF, pull certain things out of it, and display that in your JSP as html
    In a servlet you can set the content type to application/pdf and write the binary data of the PDF back to the browser. Once the browser finishes reading in the data it should open the PDF.

  • How to read labview binary files in Matlab

    I would like to read Labview binary files with Matlab. I read some articles of the subject and I am more interesting in know how labview store this data into file. What is the format use by Labview to store this data?
    Any help is appreciated,
    Hernando

    The term "binary file" means that the data on disk is a (pretty close) duplication of the binary format of the data in memory.  For example, a String will appear as an array of Bytes that, if looked at with a text editor, would be "human-readable".  
    An I32 or U32 integer would take 4 bytes, but the order (or "Endian setting") can be Big-Endian or Little -Endian (and I won't confuse both of us by trying to say which is which).  Thus the number "1" would appear as four byte of 0, 0, 0, 1 or 1, 0, 0, 0.  Floating point (Dbl) also has an "Endian" consideration, but the numbers are encoded as a mantissa and exponent, with sign appearing somewhere.  However, if you get the Endian and precision (Sgl, Dbl, etc.) right, both MatLab and LabVIEW should be able to read each other's data.
    Be careful with Booleans.  It wouldn't hurt to do an experiment and see how many bits/bytes are used for simple Boolean data.
    One other "gotcha" -- in LabVIEW, you can prepend Array and String writes with a U32 that is the length of the Array/String -- you obviously want to take this into account.
    Something that I've found helpful when dealing (in both Matlab and LabVIEW) with "unknown" binary data files is to use an old-fashioned "binary editor", something capable of displaying a file as Text and Bytes.  Strings "stand out", and if they seem to be preceded with 4 bytes that are mostly 0 with one Byte more-or-less the length of the String (sign that String Length was prepended).  If you see a lot of byte data that look like they could be 2 or 4 byte integers, they probably are.  If they are four bytes of numeric data that have few zero bytes (i.e. if most of the 32 bits seem to be used), they may well be floats.  Make a guess at the format and write a short routine to read according to your guess -- do you get meaningful data?  Go ahead, be a Scientist, not an Engineer -- study the data, form a hypothesis, then design and do an Experiment and see if you need to reject your hypothesis ...
    Bob (Neuroscientist) Schor

  • How to display a binary image in a webpage?

    Hi,
    I want to display a binary image in a webage. The image has been stored in a DB as binary format. I am using servlet. How could I retrieve it and display it on a webpage? Could you give me some suggestions?
    I have read some metrial about JAI, the method 'createImageEncoder( )', which seems very helpful! I am on the right way, right? Thanks for your any comments!
    Best Regards,
    Hai

    Here is my idea to display the pic on the webpage:
    The pic is stored in DB as binary, after retrieving it, the binary data will be converted to JPEG pic. Then, the pic will be saved to the local machine automaticly. After that, I get the pic's SRC, and use html display it.
    My code is as follow (not completed), some errors in it.     public static String getPayoffSRC(Services serv, long fileId)
                                                                    throws FileNotFoundException,
                                                                  DBException,
                                                                  DbFileNotFoundException,
                                                              IOException {
            BufferedImage buffy = new BufferedImage(300, 400,
                                                        java.awt.image.BufferedImage.TYPE_INT_RGB);   
            FileOutputStream out = new FileOutputStream(serv.getFileManager().getFileDb(fileId).getFileName());
            JPEGImageEncoder jencoder = JPEGCodec.createJPEGEncoder(out);
            JPEGEncodeParam enParam = jencoder.getDefaultJPEGEncodeParam(buffy);
            enParam.setQuality(1.0F, true);
            jencoder.setJPEGEncodeParam(enParam);
            jencoder.encode(buffy);
            out.close();
            return Pic's SRC,
        }

  • How to Display the SAVE  file name dialogue in Forms 6i

    Dear All,
    Just like we use Get_file_Name to display the MS Open file dialogue..
    how do we display the SAVE file dialogue in forms..??
    whats the function name???
    regards,
    Sidhant

    hello friend,
    u can use webutill lib to open/save dialog box
    also must refer this link,
    Re: How To Call Save As Dialog?
    Regards
    Chandan

  • How to display an XMl file in a webydynpro Application.

    Hi All,
    I am working with a webdynpro application where i have an xml file. when ever i run the webdynpro application it has to display that xml file in the browser instead of view. It would be appreciable if anyone give me some idea on how to start this application
              Thanks in advance
    Regards
    ravi

    HI Ravi,
    Insert a portalIFRame or IFrame with width 100%.
    Create a context variable (Say xmlFile) of type String and bind to Source property of PoratlIFrame .
    Put the xmlfile inside Project\src\mimes\Components\Package\
    Let the xml file name be Config1.xml.
    Write the following code inside wdDoinit()
    wdContext.currentContextElement().setPortalFrame(WDURLGenerator.getWebResourceURL(wdComponentAPI.getComponent().getDeployableObjectPart(),"Config1.xml"));
    Regards
    Fahad Hamsa

  • How to read a binary file written in LabVIEW 6.1 using VB ?

    How to read a file saved in binay forrmat in LabVIEW 6.1 platform through VB.
    Is there any code ?
    Thanks

    Hello,
    LabVIEW files stored in binary can take on just about any format that
    you choose, so there will not be a single piece of code that will give
    you what you are looking for.  You can use VB's standard file
    operation functions to read in a binary file created by LabVIEW, just
    as you would read in any other binary file.  See this page
    on Microsoft's web site for more information on the binary file read
    operation.  How you stored the data in the binary file will
    determine how you need to extract it from the byte array.  So, if
    the first element stored in the file was a 32-bit integer, you could
    extract an int from the byte stream to recover that piece of your
    data.  You would need to know in advance how the file was
    formatted in order to successfully retrieve the information.  If
    you need a reference for the VB functions, the microsoft link above
    will get you to some good information.
    Cheers,
    Matt Pollock
    National Instruments

  • How to display a .txt file?

    i would like to ask if JAVA can open and display a text file by issuing a command from my application
    is it possible to do it without using a JEditorPane?
    something else too, how can i set the background for my application to be a .jpg image?
    i searched and realised there is no such method as
    setBackground(String url)

    Try this... Note you need to add adequate exception trapping and detect special cases like the file being larger than the allocatable size of a character array (in which case you can't convert the file to a string and will need to 'display' the file in sections)...
    import java.io.*;
    public class LoadFile {
      public static String fileToString(File file) throws IOException {
        char[] fileContents = new char[(int) file.length()];
        FileReader fr = new FileReader(file);
        if(fr.read(fileContents) != fileContents.length) {
          System.err.println("There was a problem reading the file contents");
          return null;
        else return new String(fileContents);
      public static void main(String[] args) throws IOException {
        if(args.length != 1) System.err.println("Usage:\n\tjava LoadFile <filename>");
        else {
          File f = new File(args[0]);
          try {
            String s = fileToString(f);
            System.out.println(s);
          } catch(IOException e) {
            System.err.println("Whoops");
    }Hope that helps...

  • How to display the attached file of DMS in WEB Dynpro

    Hello everybody! I have to work with DMS documents on the portal. Do You know, how display the attached files of DMS document in WEB Dynpro?
    Pavel Truhlář

    Hi Pavel,
    By using the below F.M we can display DMS Document.
    CALL FUNCTION 'CVAPI_DOC_VIEW'
      EXPORTING
        PF_DOKAR               = 'ZAP'
        PF_DOKNR               = LS_DMS_TABLE-DOKNR
        PF_DOKVR               = '00'
        PF_DOKTL               = '000'
       PF_HOSTNAME            = 'DEFAULT'
       PF_APPL_START          = ' '
       PF_GET_URL             = 'X'
    IMPORTING
       PFX_URL                 = V_URL
    EXCEPTIONS
       ERROR                  = 1
       NOT_FOUND              = 2
       NO_AUTH                = 3
       NO_ORIGINAL            = 4
       OTHERS                 = 5.
    After getting the V_URL Create External Window.
      LO_API_COMPONENT  = WD_THIS->WD_GET_API( ).
      LO_WINDOW_MANAGER = LO_API_COMPONENT->GET_WINDOW_MANAGER( ).
      LO_WINDOW         = LO_WINDOW_MANAGER->CREATE_EXTERNAL_WINDOW(
                    URL = LW_URL ).
    BR,
    Jack.

  • How to display a large file in JTextArea

    i am displaying a large file(a multi MB) in a JTextArea, it is showing java.lang.outofmemoryerror
    are there any solutions for this problem or is there any better way other than JTextArea ???

    thanks for replying but its all abt Tables
    i am new to java
    i asked how to display a large Text file in a JTextAreathanx
    --santosh                                                                                                                                                                                                                                                                                                   

  • How to display thumbnail of files????

    i want to display my avi file list in thumbnail view as windows explorer is providing... can anyone tell me... how can i implement the same??

    Cross post: http://forum.java.sun.com/thread.jspa?threadID=646758

  • How to display new downloaded files soon

    I have begun to use Mac instead of PC.
    I have a question.
    When I download some files with Safari from some websites, I save them on Desktop.
    But there are not the files I have downloaded on Desktop and they can be only founded through Finder (Finder > Desktop) until Mac is rebooted. It is not until reboot that I directly find the files exist on Desktop.
    Does anyone know how to display downloaded files soon after getting them?

    Hi Nikaku ............
    The best thing to do to find your downloads - an not spread ALL over the desktop an a easy way to find them is to create a NEW folder on your desktop an call it something like - Downloads -
    * After you did this, open Safari an go to the preferences, now select in the section 'Location downloaded files' search for the folder you created an select it.
    Next time you download something you will find it in that folder 'Downloads'
    Good luck ...
    Dimaxum

  • How to convert proprietary binary file

    Hi All,
    I've got a problem that i can only tell you a little about due to the fact that i've signed a non-disclosure agreement which prevents me from telling you all the information that i have. I know my way around LV reasonably well but have no experience of programming C or C++. I have a data capture device that saves files in a properitary binary format.
    I've got partially there - i have a Read From Binary File.vi working to read in a string. I then typecast this to U8 and hey presto i get out most of the data that i am looking for. The problem is that there is a mix of ints, chars, and others and i don't have access to that data (which is what i want).
    The manufacturer has given me a bit of code that explains the file format, but the problem is that i cannot quite understand it (nor can i post it). However, it goes something like this:
    #define blah blah
    struct blah blah
          union
                  unsigned char blah;
                  struct
                           unsigned char blah     :1;
                           unsigned char blah     :3;
                           unsigned char blah     :2;
                  }    blah;
           }blah;
          unsigned char blah;
          double blah;
          int blah;
          int blah;
    Blah stand for various variables.
    Could someone have a stab at explaining what is going on. I am guessing that if i use some sort of cluster (=struct??) then i might be able to get the info that i need.
    Thanks.
    Phil

    Easy part out of the way first: You do not need to read the file into a string and then typecast to a U8. You can simply read as a byte array by just doing this:
    OK. Next part. What's probably stumbling you is the use of struct and union. Yes, a struct is basically a cluster. A structure is an ordered set of items. Each member is located in memory one after the other (I'm ignoring memory alignment here for the sake of illustration). A union, on the other hand describes an object in which all of the members start at the same memory location. However, only one member is actually present in terms of value. The amount of storage is the size of the largest member. In the example you provided what's being described is the following (again, ignoring memory alignment considerations here for the sake of illustration):
    "something" that is 3 bytes long (since the struct member is longer than the single unsigned char)
    a 1 byte unsigned char
    a double (8 bytes - most likely)
    an int (4 bytes - most likely)
    an int (4 bytes - most likely)
    The "something" is the union, and it can be represent either a single 1 byte value (with the other 2 bytes being meaningless), or a structure of 3 separate 1 byte values. Which one it is depends on the variable values that were written to file, so you need to know something about what was written. 
    Now I said that I was ignoring memory alignment issues for illustration. Well, you can't.  This just means that the amount of memory used will be larger than a simple addition of the size of each datatype. Let's take a simple example:
    struct y {
       char a;
       short b;
       char c;
    How many bytes is y? The direct addition would tell you 4 (1 + 2 + 1). However, the more likely answer is 6 since memory alignment consideration dictate that you need to start on an "even" memory address. A C compiler will tell you the correct answer because this is platform dependent.
    So what does all this mean to you? Well, my suggestion is that you write a wrapper DLL to convert the file since you will be able to cast the data you read from file directly into a variable of the type of the overall struct. Trying to deal with this in LabVIEW is probably not worth the effort.
    Caveat: I'm no C expert, so I hope that I didn't say anything that was outrageously wrong. If I did, someone please correct me!
    Message Edited by smercurio_fc on 11-07-2008 10:00 AM
    Attachments:
    Example_VI_BD.png ‏1 KB

  • How to transfer a binary file through the socket?

    hi,
    i have a problem when I want to transfer a binary file through the socket. On the server side we write a program with C. On the client side with use java. The socket worked fine when we transfer some asci files. But failed when transfer the binary file. How to solve the problem? Can someone give me some advice? Thanks a lot.
    sincerely,
    zheng chuanbo

    i use streams to read the binary file. The problem is I don't know when the transfered stream finished. With text file I can recognize the end of the transfer by a special string, but how to deal with the end of a stream? should the server send an "EOF" or something else to the client to notify the end?

  • How to display a html file without tags?

    Hello,
    I am new for Java programming. Now i have to display a html file without all the tags. My code is the fllowing:
    u = new URL("http://www.ncbi.nlm.nih.gov/entrez/viewer.fcgi?db=protein&val=55584070");
    BufferedReader in = new BufferedReader(new InputStreamReader(u.openStream()));
    while ((s = in.readLine()) != null) {
    System.out.println(s);
    in.close();
    Unforturnately, the output is the soucecode of the html file and I just want the content.
    Please help me.
    Thanks a lot in advance,
    Danica

    Here's a simple example
    http://forum.java.sun.com/thread.jspa?threadID=293830
    I haven't tested it, but I bet camickr did.

Maybe you are looking for

  • Is it possible to create a page with a signature, that can be then applied to other pages?

    I want to know if I can create a page, with a place for an ink signature, and that signature can be then copied onto other pages within the pdf where the same person's signature is needed.

  • Change of mobile provider has caused a problem with BIS on my bb pearl

    Hi, hope someone can help. I have just changed mobile provider from O2 to Orange via sim only contract.  I had BIS set up when I was with O2 although it took approximately 2 weeks before my e-mails could be pushed to my handset.  Now I am with Orange

  • [SOLVED]Strange file /etc/ld.so.confe

    Dear community, Starting with filesystem 2010.01-1, after each filesystem update I am finding a file called /etc/ld.co.confe, which is a copy of /etc/ld.co.conf (this is besides the usual /etc/ld.co.conf.pacnew). I took a quick look at PKGBUILD and f

  • Old .mac photo pages and new iweb pages

    I have photo albums and movies previously published on a .mac homepage. I also have new photo album pages published through iweb. Are the two connected or related in any way? Do I just have to republish the old pages through iweb, or should they be l

  • Java code number formatting

    Wonder if you could help me, I am a student and I've written an applet program for an assignment that creates an array of objects, each object has 3 elements. A string, another string, and a float. The float is multiplied with an integer in another m