Iteration of the loop only to store data

Hello

wouldn't be a good practice to use a while loop with:

  • his terminal State forced true,
  • Register shift not initialized

The idea is to store information useful to a VI only and avoid the addition of a registry to offset for the moment inside the main vi.

I have attached two screws as example.

Thank you

What you try to do this is already years back and it has become a common practice. Check on the driving force of

Tags: NI Software

Similar Questions

  • 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.

  • 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

  • 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
  • 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.

  • Graph waveform repeats with each iteration of the loop

    Hi guys,.

    I got some great responses from you many already, so I hope you can help me once more!

    I try now to simply take a voltage that is measured by a sensor, I tied to AI1, and I built a graph of very simple waveform using a DAQ assistant. I have the setup terminal to CSR, the acquisition value continuous sample mode and read samples and rate game to a control on the Panel before which I can control myself. All this is a while loop that is needed to collect data over time.

    However, the problem I have is that for each loop of the loop, it seems, to reset the graph, so my x-axis never increases over time, ideally I want it to do is to show results through from 0 to 100 on the x-axis to say, and then, when it comes to 101, he will start again on the extreme left of the graphic to the right to a crossing another 100 points given) (there's a term for this, but I forgot, sorry!). To be honest, this kind of logic like everything in the loop will be restarted, but after trying to chart the loop it does not work, so I'm fresh out of ideas.

    I think I might have to do is to manually build segments of data acquisition (DAQ mx) and have only certain parts of them in the loop, although I can't be sure. I tried various examples and online on the database of NOR (including tension-int acq & graphic clk which works well in the examples, but not at my request) but no luck for now

    If anyone can think of what could be the problem, then please let me know. FYI the sensor is optical fiber if it makes a difference. I have attached the file VI that I did does not really...

    See you soon!

    Ritchie

    Since you use a chart there is no way to fix it. If you choose to go to a XY chart you could solve this problem. See the example below.

  • use file Spreadhseet read 1 extra row each iteration of the loop

    Hello

    I wrote a program that uses number of data points according to the specified user to the settings. For each data point, I use a Spreadhseet VI reading to correct each data point according to the calibration spreadsheets I've already saved. For each data point, so I need to multiply/divide it by corresponding values in each spreadhseet of calibration. This corrected number is then displayed in a XY chart as recorded in another worksheet in the corrected values file. I placed indicators at the output of each worksheet VI reading to see what value is read. The program reads the first data in each worksheet correctly point but then to each successive iteration, the number is completely wrong, and I don't know what is happening.

    Essentially, I need to know how to read successive lines a spreadhseet file where the number of line that is read is consistent for the number of the iteration of the enclosing loop. I think that the problem lies in my inexperience with this VI because I don't know if I'm seizes my desired correctly parameters.

    I joined my program as well as two of the three calibration spreadsheet files related (the third is the same size and the same format as the worksheet example diode). The program is large enough, but the problem is contained in the case of IPCE. Spreadhseets in calibration are taken in the case of IPCE calibration.

    Thanks in advance,

    Kai

    Hello Kai,

    You should watch the context-sensitive help from and use the two ReadPosition inputs and output!

    You must provide a postion of file line-by-line reading and if you have to remember the position of reading of your last call to read. "Taking into account" can translate to LabVIEW speek by "shift register! BTW. reading a file once and using the data in the table afterwards generally are much easier for these small tables...

    But before tackle you this problem, you must get rid of at least 95% of all local variables. LabVIEW is all about the stream, it is not used (or even have) variables to process the data. Your "Overlord" VI is a bunch of (possible) race conditions mixed with a huge amount of RubeGoldberg...

    Kennst das deutschsprachige Forum LabVIEW?

  • Sort of the length of the sample segment longer that the iterations of the loop w/o shift registers?

    Hi all

    My loop runs about every s 0.06 and now I was prompted to add to program a function that will enjoy the latest 3 data and return the max/min value for two of the signals.  I can imagine a clumsy way by program to do this with SHIFT registers - take the max/min for each iteration, save-repeat-compare until you have enough iterations to fill 3 s of time.  But I can't help thinking there must be a cleaner way (better?) to do.

    Any help?

    Thank you

    Hello

    Try looking in a circular buffer.

    http://zone.NI.com/DevZone/CDA/tut/p/ID/7188

    Once you have determined how many times you put entries in the buffer, you will know exactly what is the size of a table to enter and do the Min/Max on.

    Another option is to use a circular table.

    http://decibel.NI.com/content/docs/doc-3414

    I would be created to operate somewhat like a Global functional or motor of the Action.   The Subvi would then be used in your loop DAQ for new data "stack."   Then called in another loop or part of your code to read every three seconds.

  • Then the iterations of the loop

    I copied Fig 4-11 of the labView 1 Basic manual and attached to it. The text establishes it stops when turned on and the value is greater than 10. It stops on the number above and below 10.

    Also if I run it with the disabled switch indicated iterations are not whole. Why is this? I thought that when looping meter would be still in one piece.

    Thank you

    JH

    Active switch: one chance to stop is when the random value is exactly, and I mean exactly equal to 1.  If I remember correctly, is not possible 0<= rand=""><>

    Iterations are integer values, if you are developing your indicator, you will find the Exhibitor being display in scientific notation.

  • stop the loop only in certain layers

    I have successfully stopped a loop in one of my layers, but it also affects the other layers, I want it. I have a layer of moving clouds that I would continue to animate during playback.

    Is it possible to have a stop(); applies only to one (or more) layers?

    Thank you

    No, a judgment will affect a whole chronology, not only a single layer.   You must create some movieclips of the things you want to keep moving or the things that you want to stop so that you can control their schedules individual (or not).  To start, try copying your images of clouds in a movieclip and place this movieclip as the layer of clouds, which extends the length of the layer so that they are present throughout it.

  • 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...

  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • What happens when you specify multiple iterations of the parallel loop that you have processors?

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    RnDMonkey wrote:

    I have an app that does the same things together up to 10 times for different material resources. For example, I have a list of 10 COM ports I want to send orders series. I want that they be executed as close to synchronous as possible, but up to 200 ms sync would be acceptable. Currently, I use a loop set up to 10 parallel iterations and assume that LabVIEW will juggle processors according to the needs, the iterations run it as simultaneously as possible. Experimentally, LabVIEW indeed seems to create 10 parallel loops, even when running on a computer with only 4 logical processors, otherwise you go 10-element inside the loop would only be not able to complete, right?

    My question is, I'm doing something verboten with my number of iterations of the loop? According to the help of LabVIEW for loop iteration parallelism dialog box: "If you plan to distribute the VI on multiple computers, set number of instances of parallel loop generated equal to the maximum number of logical processors, you wait for one of these computers contain never.» Clearly I'm violating this opinion and yet it seems to work. My performance will essentially be the same as if I had 10 blocks of code in parallel on the block diagram?

    "Reading'how many Threads don't LabVIEW allocates?" links to this page, it seems that, at worst, LabVIEW is hungry for thread and switching of threads between iterations, but my short demand slowing down enough to accommodate this suboptimal situation. At best, LabVIEW has allocated 4 threads per the enforcement system, so as long as I have at least 3 processors, there are at least more son than the parallelized loop iterations. It's all a bit confusing.

    In this case (where you're interacting with the external hardware and have an appointment) there will be a delay of inheirant at each iteration.  THUS, "Oversubscibing" or by allowing the parallel proceedings as logical processors, actually improves performance by running another period of waiting during the iteration.  In fact, you're not "Violate the advice" of oversubscibing.  You use this technique correctly! Just may not have read about this.  See Esp PP 4

  • loop nested using iteration of the outer loop as counter

    Hello world.  I have a moment where I perform calculations at each iteration of the loop and display on the front panel.  Then, in a loop iteration randomly (referred to here as I = 9 to test) it fires an event where that performs calculations on x number of iterations (iterations of the outer loop while) the result of external calculations, while performing at the same time and the view from the outside so that the calculations of the loop.  Is that two mathematics algorithms are synchronized in iterations.  After x iteration the program returns then to only calculate and display the while loop calculations using the value from the shift register, updated until another event is triggered (I do not show an another event trigger in the code example) I can just find a way to trigger an event , and at the same time to make two calculations with the same loop iterations.  Any suggestions?

    The VI of the sample in the previous post of crossrulz should provide the functionality you are looking for. The while loop acts to go through ten operations you want to perform and records time difference will allow him to record these values, as you understand. I think that crossrulz refers to shift registers on the while loop that surrounds the case structure that records the shift are unusable on a structure of the case, as you pointed out.

Maybe you are looking for