First iteration of a loop problem

I'm having a problem with the first iteration of a while loop. I want to save all the data a data acquisition over a period of time. In order to keep the unique 'small' file, I'm doing a VI that produce a new file every 10 min. about. But the first file I want to do is not due to the following problem:

The first time I use the DaqMX read in the loop, it returns a blank. Why does do that?

I'm not entirely sure why, but I just set the number of samples to a specific value so that you do not need the function of Ms. wait 100 in the loop.

Tone

Tags: NI Software

Similar Questions

  • Other results: preliminary report does not properly during the first run in a loop

    I have an unusual problem with NI TestStand 4.1. I have a loop For and it contains, I have a call from sequence configured as a test of numerical limit. This test is configured to report additional results. All other results are preconditioned test cases. Here's the unusual part: during the first iteration of the loop, the test passes yet additional results for the parameters of all inputs are reported (output parameters are not presented at the time, but more on this later). Spend all additional this test iterations in the loop For and additional results are not reported.

    Regarding output parameters... If a test fails I'm expecting (input and output parameters) results to report. However when I encounter a failure only the additional results that are output parameters are displayed on the test report. Input parameters are not reported.

    If anyone else has experienced this? My expectation was that all additional results would be declared in case of failure. In addition, in the absence of a failure I expect not to see additional results. Thanks in advance!

    The short answer is that the condition of additional results for input is evaluated before it's called the subsequence, so that it uses the value of the previous iteration Step.Result.Numeric (or by default on the first).

    You can see this described as stage 15 in the following link:

    http://zone.NI.com/reference/en-XX/help/370052P-01/tsfundamentals/infotopics/step_execution/

    Kind regards

  • URGENT::opening multiple files - i have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    bbmChatDB of public database;

    public static FileConnection fconnRead = null;
    public static String fileReadData = "";
    public static InputStream is = null;
    data Byte [] = null;
    DataInputStream is = null;

    Here is my code...

    I have 3 files in my directory... When I run the code I can open a file and read it... but the while loop get blocked after the first iteration... can someone me help or give some indications

    try {}

    FileConnection fc = Connector.open("file:///store/home/user/documents/BSM/") (FileConnection); "

    If (fc.exists ()) {}

    Enumeration e = fc.list ();

    While (e.hasMoreElements ()) {}

    System.out.println ("files are:" + (String) e.nextElement ());

    play this file
    StringBuffer stringBuff = new StringBuffer();
    try {}
    System.out.println ("opening file")-;
    System.out.println ("file name is:" + (String) e.nextElement ());
    fconnRead = Connector.open("file:///store/home/user/documents/BSM/(String)e.nextElement(),Connector.READ_WRITE) (FileConnection);
    System.out.println ("data length")-;
    If (fconnRead.exists ()) {}
    is = fconnRead.openDataInputStream ();
    data = IOUtilities.streamToBytes (is);
    Ddd = new String string (data);
    fileReadData = ddd.toString ();
    System.out.println ("length of data:" + fileReadData.length ());
    System.out.println ("read data :" + fileReadData);

    }

    } catch (IOException ee) {}
    ee.printStackTrace ();
    System.out.println ("Exception in the read data :")
    + ee.getMessage ());
    }

    }
    }

    } catch (IOException e) {}

    e.printStackTrace ();
    }

    {Finally

    try {}
    If (is! = null) {}
    is. Close();
    }
    System.out.println ("is closed...");
    } catch (IOException e1) {}

    E1. PrintStackTrace();
    }

    If (fconnRead! = null) {}
    try {}
    fconnRead.close ();
    } catch (Exception e) {}
    System.out.println (try ());
    }

    }

    }

    You can recode this treatment so that it uses only:

    e.nextElement ())

    Once a loop iteration.

    Directly at the start saying something like:

    String fileName = e.nextElement ());

    and use fileName everywhere in your loop.

    Also be aware that printStackTrace() will do nothing in your situation, it only works if you catch Throwable.  So make sure you something output all your catches exception and also have a catch (Throwable t) to catch the things you miss, as follows:

    {} catch (Throwable t)

    t.printStackTrace ();

    System.out.println ("Eception exception:" + t.toString ());

    }

    I think your code is thrown an exception and you don't see it.

  • "timing" on the first iteration of bad

    Hi people!

    I have a problem with a timer, which gives me a wrong result (only) on the first iteration (see code below).  This test code is assumed to measure time, the loop should iterate x times.

    I expect to get always the same time (i.e. difference  ('period' = 10 (msec) if the settings used in the screenshot) but in fact, the results of the first iteration allways in a smaller number.

    but each iteration after the first gives a good result.

    Thanks a lot for your help in advance!

    Luke

    As I said, at the first iteration, the code that runs to check the time that happens in parallel with the code that makes the calculation of time difference.  In fact, the error in your time will appear in the nth iteration when the differences of time N times, but you have run only waiting for N - 1.  Nth waiting happens in parallel (so after) the calculation of the umpteenth time.

    Next time around you will not see the problem because the nth wait will have been held prior to the iteration n + 1.

    You need to set up a dependency of data stream (possibly a mere 2 framed flat sequence) in the loop so that the calculations occur after the wait function.

  • A generated within a loop in a subvi output data can be transferred to the main program for each iteration of the loop?

    Hi LV users,.

    I have a very basic question, I have not succeeded to asnwer using basic considerations.

    I made a sub - vi that performs a scan of current-voltage using a unit of measurement-source Keithley and a loop FOR.

    The subvi outputs 2 tables with my data (essentially an array of voltage and the corresponding current table). I also defined a Terminal at the exit of a group of these 2 tables in order to plot a graph XY - output. Specifically, I indexed this cluster to update after each iteration of the loop FOR, in my sub - vi (the indicator is placed outside the loop, of course).

    My problem is that I want my main program to display the XY-graph in real time, with an update after each iteration of the loop FOR which is in my sub - vi.

    I have a problem because my sub - vi output terminals are available for the main program concluded as soon as the sub - vi has completed its own execution (which is what we expect of sub - vi to do).

    How can I use a sub - vi (because it's handy) and get in the main program in the course of its performance data that are generated from the loops of sub - vi?

    Thanks in advance for your help,

    Yoyo87

    Elements of the queue in the Subvi them put your main VI where you want to display the data and the.

    It is similar to the architecture of producer/consumer. There are examples of it in LabVIEW. The examples work with 2 parallel loops, in your case a loop (the producer) will be in the Subvi.

  • How do you give each iteration of a loop IF %

    Subject: Send a signal to step to a stepper motor driver at regular intervals.   My first try to use a loop was a failure because the data is only passed on a loop when the loop ends.   Instead this application requires the data to be passed on a loop on each iteration.

    What happens if changes can be made to a loop for output at each iteration?  Or, if a loop is not suitable for this application which is preferable?

    Howard

    A loop looks like a reasonable approach. But you will have to send the signal to each iteration of the loop, then talk to the stepper motor inside the loop on each iteration. You can also think of calendar of loop (how fast you want to send commands to your engine) and stop the loop (for example, the user clicks on a stop button).

    Another concept, you can familiarize yourself with are state machines. LabVIEW courses cover these, and there are many messages about the machinery of State here on the forum.

  • Write on the worksheet while loop problem

    Hello dear Labviewers. I have a 'writing on spreadsheet"with a table 2D DBL connected on it, but the problem occurs inside the while loop. I want exactly those time six values in my excel document, but it restarts after every "two seconds" and I cannot get rid of this problem. I want exactly the same numbers in the Excel document as it is in the table.

    I tried to move the two "write to the spreadsheet' boxes outside the while loop, but the Excel document does not display a single value in the table, when I do this. It shows that the two headers

    My second problem is rounded off on the numbers. Even if I wrote "%.6f" in the part of the format, it gives me a single decimal value.

    Thanks in advance

    Orlando

    Orlando says:

    Thanks for the help Ravensfan

    But the "worksheet to write" not a not an output port, then how can I do this?

    I downloaded my VI

    I never said anything about writing about a spreadsheet file with an output port.

    See the attached VI for changes.  It's only the new data of this iteration of the loop that will write it on the spreadsheet file VI, not made all of the table from all iterations.  There is an entry of table 1 d to the spreadsheet file.

  • repeating nodes using loop but when XML string concating then concating only last iteration of the loop FOr?

    I stuck with a problem that I use FOR loop to generate expandable nodes.
    Now when I concat the node generated in the primary node and then I only last iteration of the loop FOR.
    can someone suggest me a way to manage this error...
    BECAUSE me IN 1.pl_phone_tab. County
    LOOP
    SELECT xmlelement ("phone"
    , xmlelement ("PHONETYPE", xmlattributes ('01' AS "dmnADRP_PHONETYPE"), pl_phone_tab (i) .p_phtype_tab)
    , xmlelement ("PHONENUM", pl_phone_tab (i) .p_phnum_tab)
    , xmlelement ("PRIMARY_CONTACT", pl_phone_tab (i) .p_prcon_tab)
    )
    IN p_phone_xml
    DOUBLE; END LOOP;
    SELECT xmlelement ("PhoneInfo"
    xmlconcat (p_phone_xml))
    IN p_phone_info_xml
    DOUBLE;
    Here, I'm a single node, but there must be two nodes for node of PHONE
  • Dynamics of code in loop problem with event handlers

    Hello

    What I'm trying to do, is to assign dynamically a deployment and behavior pleased each movieclip with a certain name on my stage. I'm a loop through and attach a function to the event of each movieclip. So far, it works. All the clips on roller and more doing something. However the problem I'm having is dynamically changing values in each function for each different movieclip in a loop. For example, I store the clip I'm targeting original X and Y coordinates in an array that I push in the value to each loop. I draw it to test and trace it correctly on each loop of each value of X and Y for this clip. The problem I have is I am tempted to call orgX and orgy to each loop and attach that to each function, but all the clips using the last value in the table. It is not dynamically attaching the new orgX and orgy to each individual event deployment clips. All deployment events and more are called for each clip, but when I try to put any dynamic code in the function he always uses only the last value. Even if I put a trace in the RollOver event and try to find the instance name of movieclip clips all the clips to trace the last name of the clip on working capital. My logic looks OK but it has to do with how flash events attached runtime? How can I solve this problem?

    These tables are not something and orgX and orgy change values with each iteration of the loop for. at the moment where you deploying your movieclip orgX and orgy will be the last value in the loop for.

    to remedy to try:

  • Equium M50-244: loop problem internal ati2dvag.dll

    I had a M50-244 XP Home Edition (sp2) who have ATI onboard until I uninstalled it completely. The laptop has become totally useless vomit ati2dvag.dll inner loop problem and nothing seemed to heal so I decided to completely get rid of ATI.

    It started with VGASAVE which, with a few adjustments, work is fine and so my machine now. I disabled the video as controller he kept coming up with "new hardware found" and I didn't load the drivers more who would do what he started crashing again.

    Currently its on 'test' and I'm doing everything possible to see if it will crash once again, I hope not.

    Maybe I need another driver and activate the video controller, but I am hated for doing anything more now that his works normally, finally!

    Some said the installation of the graphics driver on the site omegadrivers.net and improves the performance of the graphics card.
    Maybe an installation of the driver from the site could be useful.

    Check it out

  • How can I get my Teststand report to display only the data of the latest iteration of a loop DoWhile ONLY stage?

    Good so I a DoWhile loop with a numeric value to test.  The loop will run 10 times.  I want only the status of success/failure of the test of the numerical value of the last iteration of the loop is displayed in the report.  I don't like on the other iterations.  Help, please!  Thanks in advance I think that this can be accomplished with the recall of ModifyReportEntry and fancy logic...

    Thanks for your comments everyone.  I ended up changing the reportgen_txt.seq to identify during my test was in a loop (by setting an additional result in the different stages of my comment loop-step to say "Record last loop.".)  Once this indicator lies in the ResultList I turn to reportgen_txt, I have to loop through all the ResultList entries and if the current entry has the same name and the "record last of loop." as a previous entry, I delete the previous entry and store the current.  All this way, I have to do is to set a flag in my test sequence, and if when debugging, I want to see all the data for all the iterations, I just remove the flag.

    The reportgen_txt.seq include:

    C:\Program NIUninstaller Instruments\TestStand 2010\Components\Models\TestStandModels

    I'm not worried about the time constants on my generation of report and I am not limited to stress strict memory so this seemed like the best way for me to do what I had accomplished.  I'm sure there are better ways, but it seemed simpler than the generation of report definition to be disabled and then enabled...

  • compariing of data between iterations of the loop

    I am data acquisition of temperature with a Thermocouple NI 9213 drive and DAQ Assistant in a while loop.  I need to compare the temperature of a channel in an iteration of the loop with the temperature of the same string in the previous iteration.  The data collected in each iteration are delivered to a chart and a data storage file.  I know how to get the temperature from the data table in the current iteration, but don't know how to get the temperature of the previous iteration, except perhaps by reading the entire file in a table, determining the size of the table and query the last entries. This seems a bit ridiculous for each iteration of the loop and perhaps even embarrassing.   Any suggestions?

    Put the data in a record time difference. The left terminal of the shift register will have the data of the previous iteration.

    Lynn

  • How to read the data processed on frm loop on each iteration of the loop?

    Hello...

    I need to display numbers as 1, 2, 3... constantly using the loop on each iteration (IE out of the loop using threads). I generated the numbers 1 2 3... using the back power node... I can read the final value after the last iteration of the loop for.

    I connected an indicator of the loop for. This indicator displays the value as a 4 If the number of loops that 4. I couldn't view 1 2 3 4 an indicator of items at each iteration.

    I'm in a position to read the value of the variable on each iteration of the loop. Please help me fromthis regard...

    Thanks in advance...

    In fact, I'm programming for multiplication of two table 2D.

    I need to select the particular code to perform this action using the structure of the case. who is right for which I need to give the value select 1,2,3 to a case selector, so I finish the task. you got my point?

    Thanks for the reply

  • The rehabilitation of the iterations of the loop to 0

    I need help resetting my iterations of the loop back to 0.  Most of the time it works very well but has a bug.  Some background on what I'm trying to do.  Basically, I'm ordering a motor with a brake on the subject.  On the brake, there is a manual replacement option that I follow with a proximity sensor.  If the magnetic field is broken, it will stop the VI with the iteration, that he stopped.  When I press the Start button, the iteration continues. The VI stops when equal iterations # Set value witness of Cycles.  I tried the reset of the iteration option to 0 if I wanted at any time, so I put a reset button in the VI.  It works very well with the one bug. This bug is that if for some reason, the number of iterations is higher than the Set # the number of Cycles, the VI will continue to operate.  This is where I need help, because I don't know how to go about it other that pretend by setting the threshold min by a large number, forcing the operator to reset the counter.  Is attached to a peg of the area of the code.  Any help or suggestions are greatly appreciated.  Thank you!

    swins wrote:

    The LabView run VI put the button in a State of "rest" and does not run until I press the Start button.  Thanks for the reply.

    Many people write their programs as they come out of the main loop when the program is finished. Then they on the LabVIEW run button to run the application again. Worse still, they have no main loop and push the button of continuous running. Both are wrong and the latter much more.

    Sorry, I assumed you were doing that, but without seeing more code, I could only guess.

    Changing the equals or is more than one stage of debugging. What is the loop that you want continue to run or just the rest of your application? If the loop continues to run then the output of the speaker or is always false, which means that the output of equal to is never true.

    You put sensors on the exit of the tunnel connected to the Terminal to stop loop and register iterations to offset? Also to put sensors on the three terminals of equal to and activate execution of climax.

  • If I started a project in first Cs5 and want to finish it in first Pro CC it causes problems exporting my sequence and get into the new software?

    If I started a project in first Cs5 and want to finish it in first Pro CC it causes problems exporting my sequence and get into the new software?

    Better is to import the cs5 project in the new project of CC.

    And Yes this could have problems, he could not.

    I would have ended up in CS5. Export to the lossless format and encode with SOUL CC until the final destination.

Maybe you are looking for

  • How can I remove Content Analysis Manager

    As the title says, how to remove the handler content analysis. I want to "delete", not just turn it off.

  • TX2-1375DX drivers

    Hi Tech HP. I have a Hp TouchSmart PC TX2-1375DX and that you have installed Windows 8 pro on it and everything is fine. But I have 2 things in my device manager I'm not sure what they are or what drivers are needed. Any help would be Mint. Thank you

  • the hp G42 laptop screen problem

    Hello.  I have a notebook hp g42 I can't see the screen-he made an entry and goes, then - it seemed to me that he will return when the outside frame of the computer has been adjusted, but that is not the case, more... I see a slight insight of what i

  • Protection of the rights of intellectual property in file Bar

    Hello I generate file *.bar for my application of stunts, but I decovert that the file (* .bar) can open by WinRAR and all my *.qml files can be read! So, where is the protection of intellectual property rights?

  • error message: default mail client not properly installed how to fix?

    was doing something earlier don't even remember whaty now after 4-5 hours of searching in the help files long story short, I got a message saying operation could not be customer e-mail by default is not installed correctly What is - this and how to f