Problem in writing to the file

I use this labview code to read and save some electrical measurement data from a set of instruments. I am having a problem that the code stops writing to the file after a while. It stops responding too. The only way to stop it then is to use the task manager and kill it. The code was written for an older version of labview but now I am using labview 9. Everything else seems updated but there's a section that uses Write characters to file vi and that may be causing the problem. I made a few futile attempts to change it. I would highly appreciate if someone takes a look at it and could tell me what's going wrong.
Attachments:
JANUS 2.2_4K Probe edit (2).vi ‏60 KB

I will second aeastet's advice - please look into how state machines and producer/consumer loops work and use them.  Your program is very inefficient, but is very similar to what I would have written before I learned about state machines and producer/consumer loops.  Start with the LabVIEW help and go from there.  These forums and the National Instruments website can give you lots of help.
Two things that will help you for this particular problem:
At every loop iteration, you are opening the file, seeking to the end of it, appending data, then closing the file.  This is very slow and the code you use, as mentioned above, will not work if the file size exceeds 2GBytes.  I would recommend you open the file once, then use the write primitive to write to it until you finish, then close it.  You do not need the write character to file VI.  No seeking.  No repetitive opening and closing.  You can either open and close outside the loop, or use case structures and boolean flags (as you have done for other things) to open and close inside the loop.
After you write to the file, if you choose to graph, you are reopening the file, reading the entire thing, and plotting this data.  This is another major slowdown that will only get worse as your file gets bigger.  You would be far better off caching the data in a shift register and plotting it on demand.  It would probably take less memory, as well.  You may want to read the tutorial Managing Large Data Sets in LabVIEW.
One last tip.  You use Value properties to read and set the values of front panel controls.  Local variables are far faster (about three orders of magnitude).  However, do not make the mistake of using local variables for data storage.  Data is wires.  Local variables are a way to communicate to the front panel.  You seem to have this down, but a reminder to others reading this thread is in order.
Let us know if you need more explanation or help.  Good luck!
This account is no longer active. Contact ShadesOfGray for current posts and information.

Similar Messages

  • Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Itunes 10.6.1.7 problem: when I change the file "media type" from 'Music' to 'Podcast' the file disapears from ITUNES. I do this via (1) right click, (2) select 'Get Info', (3) select 'options' tab, and (4) change media type. What is the problem?

    Hi Memalyn
    Essentially, the bare issue is that you have a 500GB hard drive with only 10GB free. That is not sufficient to run the system properly. The two options you have are to move/remove files to another location, or to install a larger hard drive (eg 2TB). Drive space has nothing to do with SMC firmware, and usually large media files are to blame.
    My first recommendation is this: download and run the free OmniDiskSweeper. This will identify the exact size of all your folders - you can drill down into the subfolders and figure out where your largest culprits are. For example, you might find that your Pictures folder contains both an iPhoto Library and copies that you've brought in from a camera but are outside the iPhoto Library structure. Or perhaps you have a lot of purchased video content in iTunes.
    If you find files that you KNOW you do not need, you can delete them. Don't delete them just because you have a backup, since if the backup fails, you will lose all your copies.
    Don't worry about "cleaners" for now - they don't save much space and can actually cause problems. Deal with the large file situation first and see how you get on.
    Let us know what you find out, and if you manage to get your space back.
    Matt

  • Problem in dynamically generating the file upload field

    Hello all
    I am using netbeans 5.5 and visualwebpack for my jsf project.
    i have a problem in dynamically generating the file upload field and using it.
    I have a panel say "panelA" which holds file upload fields.
    Depending upon the count value i generate the file upload field using following code snippet:
    Upload upload1 = new Upload();
    upload1.setId("upload1");
    getPanelA.getChildren().add(upload1);
    The page successfully shows up the file upload fields. While the user clicks the submit button, i have used following logic to perform upload:
    List components = getPanelA().getChildren();
    for(int i = 0; i<components.size(); i++){
    if(components.get(i) instanceof Upload){
    UploadedFile uploadedFile = ((Upload)components.get(i)).getUploadedFile();
    I am getting this UploadedFile object null.
    How can i solve this problem.

    Anyway,
    I solved the problem.
    Actually i was using label property of the upload field due to which i got null pointer exception.
    I removed the label property of the upload field and things worked as i wanted.

  • I am new to Muse so I am following the tutorial for Katie's Cafe.  I downloaded the sample files.  The problem is not all the files are in the folder as are on the tutorial.  The colour sample for instance is not there.  The CC Getting Started Katies.muli

    I am new to Muse so I am following the tutorial for Katie's Cafe.  I downloaded the sample files.  The problem is not all the files are in the folder as are on the tutorial.  The colour sample for instance is not there.  The CC Getting Started Katies.mulib file is also not there so you cannot automatically download all the necessary library files.  Can anyone help?

    found it in another area
    Where do I find the cc getting started Katies.mulib File ?

  • -- A file association problem exists, which prevents the file you're trying to download from being associated with the correct application by the operating system using window 7  IE 11

    A file association problem exists, which prevents the file you're trying to download from being associated with the correct application by the operating system
    USING WINDOW 7  IE 11  HOW CAN I FIX???

    Try downloading the offline installers:
    Adobe Reader
    Flash Player for Internet Exporer - ActiveX
    Flash Player for Firefox - NPAPI

  • Word Web App cannot open this document due to an unknown error. If the problem persists, try opening the file in Microsoft Word.

    Word Web App cannot open this document due to an unknown error. If the problem persists, try opening the file in Microsoft Word.
    Can anybody pls help me how to resolve this for which got strucked !!!!
    Cheers !!
    Praveen
    Thanks in Advance !!! Cheers !!! Praveen

    Hi  Satheesh,
    Thanks for quick Reply !!!
    can u pls have a look that the below are Log Errors am getting .
    Pls suggest me how to resolve that the all the services are in the running state only ,
    1.     Could not find default ServiceProxy or it does not implement      
    IWacServiceApplicationProxy.
    2.      Default service proxy not found while trying to get setting
     WORDVIEWERSILVERLIGHTONLY.
    Rgrds//Praveen
    Thanks in Advance !!! Cheers !!! Praveen

  • Problem in writing into the excel file using java code

    Hai ,
    I will be getting the data as a string and i am writing into the excel file. the problem is .if it has numeric values even now i will writing as a string data ,at this time i am getting the message in the excel file as "Number in the cell is formatted as text".
    I need to remove this thru my code..but i can write only as a string .
    To write in a excel file ,i used HSSFWorkbook.

    just check out
    http://www.andykhan.com/

  • Problem with writing into txt file on the Web

    Hello friends - please could you give me an advice? Java console says:
    Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.io.FilePermission http:\web.telecom.cz\jiriczech\xanado.txt write)
    Thank you a lot in advance:)!!

    The place you are trying to write the file to does not have write permission.

  • Problem with opening of the file in CV03N

    Hi,
    I had the file in DIR as I check in CV03N, I am not able to open the file. help is appreciated in finding what may be the problem.
    Regards,

    Hi,
    I have same requirement.
    I need to cnvert smartform->pdf->send mail.
    The mail is send but the attachment is corrupted.
    Can you tell me what code you have written so its working in developement?

  • There was a problem downloading song. The file seems to be corrupted.

    Hi
    I'm trying to download an album i purchased but i'm constantly getting the message "There was a problem downloading X. The file seems to be corrupted" for every song I try to download. Also if i try to stream the song it says "This computer is not authorized to play X. Would you like to authorize it". But my computer is already authorized and when I try to authorize it again, it says this computer is already authorized.
    I've tried downloading them through the purchased section of the store (which causes itunes to crash 50% of the time) with no luck. I've also reinstalled itunes. This only started happening once I installed the latest version of itunes.
    Any help would be appreciated

    I'd report the problem to the iTunes Store.
    Log in to the Store. Click on "Account" in your Quick Links. When you're in your Account information screen, go down to Purchase History and click "See all".
    Find the item that is not downloading properly. If you can't see "Report a Problem" next to the entry, click the "Report a problem" button. Now click the "Report a Problem" link next to the item.
    (Not entirely sure what happens after you click that link, but fingers crossed it should be relatively straightforward.)

  • Problem in reading from the File

    Hi,
    I have a dataset.txt file which is as follows:
    2
    4
    1 2 3 4
    2 3 4 5
    3 4 5 6now that I need the value that is present in the 1st line of the file(ie;2) and value present in the 2nd line of the file(ie;4), upon that i'll be reading the data into an array.
    for this task of mine to accomplish , i'm using the following code
    String line_1;
    String line_2;
              int first_line,second_line;
              DataInputStream dis1 =null;
              DataInputStream dis2 =null;
              System.out.println("Print this");
              try
                   File f1=null;
                   f1 = new File ("dataset.txt");
                   File f2=null;
                  f2 = new File ("dataset.txt");
                 FileInputStream fis1 = new FileInputStream(f1);
                 FileInputStream fis2 = new FileInputStream(f2);
                 dis1 = new DataInputStream(fis1);
                 dis2 = new DataInputStream(fis2);
                           BufferedReader line1 = new BufferedReader(new InputStreamReader(dis1));
                      line_1=line1.readLine();
                      first_line=Integer.parseInt(line_1);
                      System.out.println("Value of First_line is:     "+first_line);
                      BufferedReader line2 = new BufferedReader(new InputStreamReader(dis2));
                      line_2=line2.readLine();
                      second_line=Integer.parseInt(line_2);
                      System.out.println("Value of Second_line is:     "+second_line);
    }//end of try
    catch(Exception e)
    {e.printStackTrace();}The problem here I'm having is, when i'm printing I'm getting the follow result
    Value of First_line is:2
    Value of Second_line is:2Instead of printing the value of Second_line as 4, it is printing 2.
    Why is this happening?
    Any kind of response is appreciated.
    Thanks is advance

    You dont have to make 2 data stream objects of the file.
    To read two lines you can just do with it object
    BufferedReader line1 = new BufferedReader(new InputStreamReader(dis1));and just call readLine( ) method twice
    line_1=line1.readLine();
    line_2=line1.readLine();

  • Problem in writing to a file

    hi all ...
    i am writing a simple html to a file in swing applicaiotn,the file is created but the content is not writing what may be the reason..can any one help me......
    Thanks
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import java.io.*;
    import java.lang.*;
    import java.sql.*;
    import javax.swing.filechooser.*;
    public class MyAppFrame extends JFrame implements ActionListener{
         //-- class members
         JTextField jtf_Text;
         JButton jb_Button,G_Button;
         JList j1_List;
         Vector v;
    private JScrollPane jpane;
    final JFileChooser fc = new JFileChooser();
    MyAppFrame(String title) {
         super(title);
         setSize(600,500);
         Container contentPane = getContentPane();
         contentPane.setLayout(new BorderLayout());
              JPanel panel = new JPanel();
         panel.setLayout(new FlowLayout());
              panel.add(new JLabel("Target Folder: "));
    panel.add(jtf_Text = new JTextField(10));
    jb_Button=new JButton("List");
    jb_Button.addActionListener(this);
    panel.add(jb_Button);
    G_Button=new JButton("Generate");
    panel.add(G_Button);
    G_Button.addActionListener(this);
    contentPane.add(panel,BorderLayout.NORTH);
    panel = new JPanel();
              panel.setLayout(new GridLayout(2,1));
              panel.add(new JLabel("Selected Forms:"));
    v=new Vector();
    panel.add(j1_List = new JList());
    //j1_List.setEnabled(false);
    jpane = new JScrollPane();
    jpane.getViewport().add(j1_List);
    contentPane.add(panel, BorderLayout.CENTER);
    panel.add(jpane);
              addWindowListener(new ExitListener());
         setVisible(true);
         public static void main(String[] args) {
         MyAppFrame maf = new MyAppFrame("Form Selection");
    class ExitListener extends WindowAdapter{
    public void windowClosing(WindowEvent event) {
    System.exit(0);
    private void con(){
              Connection con=null;
         ResultSet rs=null;
         try{
         Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         con = DriverManager.getConnection("jdbc:odbc:satya");
         System.out.println("Set Connection");
         Statement st=con.createStatement();
         String query="select form_name from form";
         System.out.println(query);
    rs=st.executeQuery(query);
    while(rs.next()){
              String name = rs.getString("form_name");
              //JLabel l=new JLabel(name);
              //j1_List.add(l);
              v.add(name);
              // System.out.println(name);
                   j1_List.setListData(v);
                   catch(Exception e)
    e.printStackTrace();
    public void actionPerformed(ActionEvent e) {
    String flag = e.getActionCommand();
    if(flag.equals("List")){
    this.con();
    else
         StringBuffer sb = new StringBuffer();
         sb.append("<html><h1>Hai</h1></html>");
         String formname=(String)j1_List.getSelectedValue();
         String Dir=jtf_Text.getText();
         Dir +="\\0ne.txt";
         if(formname!=null && Dir !=null)
         try
         PrintWriter out= new PrintWriter(new FileWriter(Dir));
    //BufferedWriter br=new BufferedWriter(out);
         out.println(sb);
    catch(Exception e1)
    System.out.println(e1);
         //jb_Button.setEnabled(false);
    //jb_Button.addActionListener(this);
    //StringBuffer Sb = new StringBuffer();

    http://forum.java.sun.com/thread.jsp?forum=57&thread=299655

  • Problem in writing data in file......

    i am having problem in passing a String object path ;
    taken from user in following way
    FileWriter fw = new FileWriter(path,append);
    error is : (The filename, directory name, or volume label syntax is incorrect)
    but if i am using
    FileWriter fw = new FileWriter("f.txt",append);
    it works...
    but i want filename from user... how to achieve this

    class writeData
         public String getName()
                        String name=null;
         try
              char c;
              StringBuffer bf=new StringBuffer();
              System.out.print("Enter the File Name:- ");
              while((c=(char)System.in.read())!='\n')
                   bf.append(c);
              name=bf.toString();
              catch(Exception e)
              System.out.println("Error is:-"+e);
              return name;
    public void wfile(String name1)
              try
              String path ="D:/fname.txt";
              boolean append = true;
              FileWriter fw=new FileWriter(path); // its not working....
              //FileWriter fw=new FileWriter("D:/fname.txt");
              catch(Exception e)
                   System.out.println("Error is :- "+e);
    public class bravo
         public static void main(String args[])
              writeData wd = new writeData();
              String n = wd.getName();
              wd.wfile(n);
    }

  • Problem in extraction of the file.

    When trying the download of the browser I pressed run in run/save option. Later the computer screen shows the file is corrupt and the extraction fails.
    Pls,guide what shall I do to download the browser.
    == Operating system ==
    windows

    Originally posted by: eclipse-news.rizzoweb.com
    Jason lee wrote:
    > Hi Eric,
    >
    > Thanks for the prompt reply. I have tried to remove the GCJ after the
    > installation of Eclipse. Now when i queried "java -version", it returns
    > me :-
    >
    > java version "1.5.0_13"
    > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05)
    > Java HotSpot(TM) Client VM (build 1.5.0_13-b05, mixed mode, sharing)
    >
    > Currently I am kind of confused on whether installing Eclipse CDT is
    > sufficient as IDE or do I need to isntall the main Eclipse program?
    >
    > I could not see any icon or hint to startup the Eclipse CDT.
    What, exactly, did you download and extract? If it was the "Eclipse IDE
    for C/C++ Developers" package, then you've got everything you need. Make
    sure to read the "Find out more..." link on the downloads page.
    To run, there should just be an executable named "eclipse." But I'm not
    a Linux user so I can't offer any more insight.
    Hope this helps,
    Eric

  • Problems when I eliminate the files in ucm

    Hi, good morning.
    When I eliminate a file of ucm the URL of the file does not disappear, if I realise a content search remains the URL of the file although this already she has been eliminated, as I can avoid this.

    Hello.
    Yes, I am waiting for the indexer cycle, the URL is the Link that adds ucm to be able to visualize the file as well as its information, I eliminate the content and this if it is eliminated but URL follows there, if I give click in sends a message to me that says the action cannot be realised so that is not the file.

Maybe you are looking for

  • Unable Print Purchase Order Report as BITMAP

    I am working on customizing POXPRPOP purchase order report by adding layout with some lines and boxes, around some of the fields. When we test to print it. The boxes and lines print as ------ instead of solid lines. I believe its something to do with

  • CR2 Files from 5D Mark II

    I have a new Canon 5D Mark II which came out of the box with firmware rev 1.0.7. When I upload RAW CR2 files from this camera these files are not recognized by Camera Raw CS4 ver 5.0. I tried to convert the CS2 files to DNG automatically using Bridge

  • How to read multiple lines from a command prompt?

    I usually read from a command prompt like this: String answer; System.out.println("Please enter the required data"); try { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); answer = reader.readLine(); reader = null; } catc

  • Indesign CS5.5 / CS6 crash under Mountain Lion DP4

    Hi all I've a "developer mac" at my office, where we're testing Mountain Lion. On this computer we also have two Adobe installations (CS5.5 and CS6). Until the last OS update, all Adobe applications seem to run without any problem worthy of note. Aft

  • Encode QT to MPEG-1 with audio - how/where to set output frame size?

    I'm using the MPEG-1 template in Compressor and wish to encode my source files to MPEG-1 with 352x288 in output resolution. Compressor sets the resolution to 320x240 and it seems I cannot change that. But surely it should be possible? The source is P