Reading and Writing files to external controller with Agilent 4395A

Hi everyone,
I have been trying to store the Agilent 4395A Analyzer Compensation Files in an external controller, and then writing them back into the 4395A while running a program. I'm doing this because the 4395A's internal memory and disk storage are not large enough to store all the files I need. I know that the files are binary, and that they can only be read 16kB at a time (the maximum dump by the analyzer). I also know that each dump comes with a specific header that describes how long the dump is.
My problem is that when I read the files, I believe that something is being corrupted - either by the internal workings of LabVIEW or something in my program. In particular, I notice that when I attempt to use the "Write to Binary File" vi something is being added to the file that I had not intended. At the beginning of the file I notice the string of characters "  @" being added. I know that the analyzer is not giving me these characters so I suspect that LabVIEW is adding them somehow.
If anyone has any idea about where these extra characters may be coming from, or if you have previous experience with the read/write with the 4395A, any suggestions would be appreciated.
I have attached an image of the program which saves the files. It is pretty simple, and the only spot where data is actually being read is in the while loop.
Thank you!
Matt
Attachments:
4395A_SaveFile.jpg ‏2287 KB

Changing the extension of a bitmap file to get around the prohibition of posting them, is really inappropriate behavior. Use paint to save them as either jpg or png.
Your problem is probably because the default behavior of the Write to binary File is to prepend array or string size. This is an input to the function and is explained in the on-line help. Turn on Context help and click on 'Details'.

Similar Messages

  • Quickest method for reading and writing files

    Hi
    I need help regarding file operations.(Reading and Writing). Currently I am using BufferedReader and BufferedWriter to read and write files. But the files (XML) are very huge files(from 30 -50 mb). This is slowing the application to a great extent. Is there any other approach to perform the above mentioned operations on XML files in a fast manner.
    Thank You
    Mansoor.

    Hi
    Can u let me know how to use the java.nio pavkage for primitve data types(int,float..., boolean). I have tried it but found no success.
    Thank You
    Mansoor

  • Reading and writing files in Mac OS X

    Hello, I am "kind of" experienced with Java (read a few books, and took one course in highschool, and I fool around with it from time to time).
    All of this however was on Windows XP, and all from the command line. Because I now have a Macbook Pro, I wish to start programming java on Mac OSX naturally. I've gotten over the shock and awe of using Xcode (I had never use a "package" before with multiple components), but I have come across a problem. I referenced one of my Java books on how to read from a .txt file (my intended program needs a database), but I've been trying for a few hours now, and I just can't seem to get it to work at all.
    I want to read the entire file and save it as a String. I don't know if there is a different procedure on OSX than Windows, but here is what I am using:
    import java.io.*;etc. etc.
    public String readPlease() {
         String str = "";
         try {
              FileReader file = new FileReader("database.txt");
              BufferedReader buff = new BufferedReader(file);
              str = buff.readLine();
              buff.close();
              return str;
         } catch (IOException e) {
              return e.toString();
    }And it is returning:
    java.io.FileNotFoundException: database.txt (No such file or directory)The .java file and the .txt file are in the same folder (src) and I've tried it while its in "resources" and "bin" (where the .class files are).

    That file needs to be in the directory that you launch your program from.
    Is that where it is? It might help if you showed us the command you are using to execute and where you are relative to your file etc.
    Also this
    BufferedReader buff = new BufferedReader(file);
    str = buff.readLine();
    buff.close();is going to only read one line of the file. Do you know that?
    If you want to read multiple lines you'll need a loop, and you should be using a StringBuilder and appending to it to build your String. Then you can call toString on the StringBuilder instance once at the end to get your string.

  • Reading and writing to a MySQL database with Java

    Anyone knows what's the best way to read and write from a MySQL database?

    > Anyone knows what's the best way to read and write
    from a MySQL database?
    Yep!
    The Java� Tutorial - Trail: JDBC� Database Access
    MySQL Reference Manual
    MySQL Connector/J Documentation
    Driver/Datasource Class Names, URL Syntax and Configuration Properties for Connector/J
    Best of luck!
    ~

  • Reading And Writing file

    Hi,
    i want to insert some lines of text some where in the text file
    can do it using only one file?
    Plz Help Me

    No.
    Yes, but I'll be charging you $85 per hour for the consulting work.
    This is a horrendously simple thing to do. Have you done a web search for code examples?
    Can you spell the wordl "please" if I gave you $10? How about the word "you"? Do you know what a questino mark is?
    Man...I'm getting sick of these people!

  • Have itl and xml files on external hd am running home premium. can  no longer access files, am told this is because they were created with a newer version of itunes. also when i try to download 10.3 it wont, just says invalid drive j and for me to try aga

    i am running vista home premium on desktop and vista basic on laptop. have placed my itunes music with .itl and .xml files onto external drive connected to another desktop running vista and can no longer access music on first two mentioned comps only on the one connected to external drive. always am told that the library cant be read because it was created using a newer version of itunes. have tried to download 10.3 but it always tells me that i have and invalid hard drive j and to try again. any ideas?

    Older versions of iTunes cannot read libraries created with newer versions of iTunes. You need to have the same version of iTunes on all your PCs. Is that the case?
    As far as the problem installing iTunes goes, see this article from b noir on dealing with the problem:
    https://discussions.apple.com/thread/2450004
    If you get to the point where you need the Microsoft Installer cleanup utility, you will need more help as it has been withdrawn by Microsoft. but I am hoping the virtual drive trick will work,

  • Switcher - Reading and Writing External IEEE HDD's

    Greetings,
    i'm trying to read and write with my external ieee drive on windows and the mac pro. it's format is ntfs, and is read only on the mac pro.
    i am admin and can't seem to change the permissions to read / write.
    the over all idea is i need to go back and forth between operating systems reading and writing from both sides of the house.
    here's a snapshot.
    http://briankross.com/images/500GBIEEEHDD.jpg
    Mac Pro   Mac OS X (10.4.8)  

    Unfortunately, no. In order to convert the drive to FAT32 it must be re-partitioned which is a destructive process.
    Why reward points?(Quoted from Discussions Terms of Use.)
    The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
    Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

  • Reading and Writing large Excel file using JExcel API

    hi,
    I am using JExcelAPI for reading and writing excel file. My problem is when I read file with 10000 records and 95 columns (file size about 14MB), I got out of memory error and application is crashed. Can anyone tell me is there any way that I can read large file using JExcelAPI throug streams or in any other way. Jakarta POI is also showing this behaviour.
    Thanks and advance

    Sorry when out of memory error is occurred no stack trace is printed as application is crashed. But I will quote some lines taken from JProfiler where this problem is occurred:
              reader = new FileInputStream(new File(filePath));
              workbook = Workbook.getWorkbook(reader);
              *sheeet = workbook.getSheet(0);* // here out of memory error is occured
               JProfiler tree:
    jxl.Workbook.getWorkBook
          jxl.read.biff.File 
                 jxl.read.biff.CompoundFile.getStream
                       jxl.read.biff.CompoundFile.getBigBlockStream Thanks

  • Problem on reading and writing from from a *.txt file

    I get Problem on reading and writing from from a *.txt file. The following is the read() method...
    The software said the DataInputStream is depreciated. Can anyone help me please?
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        String str = "";
        try
          in = new BufferedReader(file);
          //in = new FileInputStream(file);
          for(;;)
            str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);
      }

    Thank you for your reply. I have made some change. However, there is an incompetable type found error.
    in = new BufferedReader(new InputStreamReader(in));The following are all of the code.
    public void read()
        File file = new File("C://Documents and Settings//Charles//My Documents//Brunel//EE2065//Assignment and Lab//Assignment 4 and Lab 4//data.txt");
        FileInputStream in = null;
        //BufferedReader in = null;
        String str = "";
        try
          in = new BufferedReader(new InputStreamReader(in));
          //in = new FileInputStream(file);
          for(;;)
            BufferedReader Bstr = new BufferedReader(new InputStreamReader(in));
            //str = new BufferedReader(in).readLine();
            //str = new DataInputStream(in).readLine();
            if(str == null)
              break;
            System.out.print(str);
        in.close();
        catch(IOException e)
            System.err.println("execution error: " +e);

  • File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled.

    I have duplicated a project to work on another computer. The project opens fine but when I import new footage/audio files I get this message. "File importer detected an inconsistency in the file stucture of (file name). Reading and writing this file's metadata (XMP) has been disabled." Then I can't play my timeline and Premier Pro crashes.  I have to force quit and restart my computer to continue working. What does this error really mean? How do you rectify?
    Our workflow requires that we duplicate projects to make updates because we are frequently revising but need to keep original project unchanged and intact.

    I have a similar issue and message , but occurs when I import AVI clips from OnLocation CS4 to Premier Pro CS4.

  • IPhone4 how through the USB mobile phone file reading and writing?

    iPhone4 how through the USB mobile phone file reading and writing?

    No idea what you are asking.
    Please explain

  • Very slow painting while reading and writing doubles into file

    for 15MB length file i = 7662080
    for 50MB length file i = 12414368
    Part of Code for writing into file follows like this:
    try{
    fos = new FileOutputStream("Angel.txt");
    File f = new File("Angel.txt");
         if(f.length() >=4)
         f.delete();
    fos = new FileOutputStream("Angel.txt");     
    dos = new DataOutputStream(new BufferedOutputStream(fos,1000000));
    int x=0;
    double y_last, y_new;
    for(int j=0 ;j<i ;j++)
    if(some condition)
    y_new = ....;
    try{
    //previously in vectors
    y_last = y_new;
    vect.add(new Line2D.Double(x, y_last, x, y_new)_;
    dos.writeDouble(y_new);
         }catch(Exception e){System.out.println(e);}
    dos.close();
    fos.close();
    x++;
    }catch(Exception excp){System.out.println(excp);}
    part of code for reading from file follows like this:
    public void paint(Graphics g)
    try{
         double y1, y2 =0;               
         Line2D.Double doub;
         raf = new RandomAccessFile("Angel.txt","r");
         dis = new DataInputStream(new BufferedInputStream(new FileInputStream(raf.getFD(),1000000)));
         raf.seek((rect.x*8));
         for (int i = 0/any value; (i < value as per choice); i++)
              g2.setStroke(new BasicStroke(0)); //2
              y1 = y2;
         y2 =dis.readDouble();
              doub=new Line2D.Double(i,y1,i,y2);
              g2.draw(doub);
    dis.close();
         raf.close();
    }catch(Exception excp){System.out.println(excp);}
    I tried using Object Streams but NotSerializable Exception is thrown as Line2D.Double objects
    are not serialized.
    Any idea to make reading and writing into file specially from MB files faster is appreciated.

    Why are you reading in the file in the paint method ?
    Create your data once before painting.
    I think you should explain what is your goal and what behavior you want.
    Denis

  • How to overwrite a log and bad file in external table in oracle 10g

    Hi,
    I have used external table in oracle 10g.whenever use select query in external table orace internally create one log file in specified directory,
    but this log file is growing.How can i overwrite the log file(old to replace with new).I need overwrite a log and bad file in external table.
    kindly give the solutions.
    By
    Siva

    I don't believe that is possible with the LOGFILE clause, but it may be with the BADFILE clause. Here is an excerpt from the documentation :
    The LOGFILE clause names the file that contains messages generated by the external tables utility while it was accessing data in the datafile. If a log file already exists by the same name, the access driver reopens that log file and appends new log information to the end. This is different from bad files and discard files, which overwrite any existing file. NOLOGFILE is used to prevent creation of a log file.
    If you specify LOGFILE, you must specify a filename or you will receive an error.
    If neither LOGFILE nor NOLOGFILE is specified, the default is to create a log file. The name of the file will be the table name followed by _%p and it will have an extension of .log.

  • How to read and write files using flex?

    Using flex, we would like to make some utility that will do a
    lot of reading and writing from local files.
    The writing is what I am more worried about. How is this
    possible?
    I want to make .zip files containing many xml files, and some
    assorted media files such as .swf jpeg, html, etc.
    I am new to flex btw, I've never used it properly before, and
    this is the main concern I have with flex, which is that it doesn't
    let me write and read lots of files.
    Mainly we are looking for a good cross platform solution that
    will let us develop an app, and flex looks professional and it is
    cross platform. The "internet app" side of things, isn't so much
    what we need really.
    Would wxWidgets be better suited to our needs?

    The Flash player sand box will not allow reading and writing
    local files. If you want to use Flex to create a desktop you will
    need the Apollo runtime. The alpha is available at Adobe
    Labs.

  • Reading and writing a ByteArray

    This question was posted in response to the following article: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d54.html

    I believe that the example of Reading and Writing Objects needs a rewrite
    First, the attempt to use comments to interleave a Flex-ified example with a Flash example of the uses of the ByteArray Class is a shortcut that ultimately fails.  Take the time to create two, separately valid examples for the two different frameworks.
    Second, the interlinea comments show a rather poor example of how to write clean code, and are entirely confusing to the person you you trying to help learn how to use your library.  Look at the declaration of a variable called outFile:File, a comment about some function that is to be declared somewhere with the same name, outFile(), and indeed, if this code were to compile -- which I am sure it could not -- the compiler would see that you try to invoke an outFile() function.  No one gets through an interview who writes code that way.
    Third, I am not sure you understand how the readBytes and writeBytes methods work. In the upper example, where an order is being written to the file system, the writeBytes method uses data.length correctly.  At the point in time that it is used, the XML object will have been written into the bytes:ByteArray, so it will have a proper length.
    On the other hand, in the second half of the example, where the readBytes method similarly passes data.length, the reader has to be very lucky to note that at that point in time data.length will have a value of zero.  The inBytes:ByteArray was only instantiated, not populated with anything, as, indeed it should not be, at that point in the logic flow.  Most importantly, when the program does need to readBytes, there is no way for the program to know in advance what the length of the byte stream coming in from the file system will be.  Your example would be more correct, and could make a useful point in showing that readBytes (data) is the correct way to pass the arguments because the default behavior will then be used and the default behavior will be to make data whatever length it needs to be in order to hold the content from the file system.  The program can know the value of data.length after the read has taken place, but not before.

Maybe you are looking for