The VI call on the n-th loop iteration

Hi all

I have a VI (let's call this VI1) looking for something like the one below.  How do I get it to call/run another VI (let's call VI2) when I = 2.  I can't put VI2 in the loop because VI2 must be made independently, and VI1 loop should not wait to VI2.  Thank you.

With the help of the whole for the case selector is a little lighter.

Tags: NI Software

Similar Questions

  • changing the values of loop iteration

    Happy new year everyone!

    I have a question about changing the loop iteration number set to a loop for. I made a simple example of what I had imagined in my mind, but I knew that it wouldn't work, however, it shows what I want to accomplish. I would use a switch or something to control the loop, so you can start running to essentially infinity, which is the constant from 1000000 and then go on a number of controlled if the loop ends in fact and the code can move. Each iteration is a second.

    Thanks for any ideas you may have

    A While loop is a loop For which has no fixed number of iterations (if you allow me, he 's going to try to go to infinity).  It has a Stop indicator that stops the loop if True is wired for it.  Note that if True is wired to the stop indicator when the loop begins, the loop will always be executed (once).  In this sense, it is slightly different from a loop For 0 cable to the input of N (which does nothing).

    So some time, use a loop to do this.

    Bob Schor

    PS - you should know...

    PPS: I just looked at your VI.  I'm sure you realize that the way to data flow rules you need to set the Boolean and order digital before start the programme - once it starts and gets into the while loop, changes you make outside the loop will have no influence on the code inside the loop.

    Have you taken the LabVIEW tutorials?  If so, and if not, go look again, attention to the program flow, loops, etc..

  • the sum of the time of loop iteration.

    Hello

    I need to estimate a time every time through the loop. The time is different (depending on the counter triggers). I need to estimate the time of each simple iteration and add the last time with the current iteration. For example the first iteration - 400ms, second time 350 ms (400 + 350) (, third 380 (400 + 350 + 380) Ms. I tried with check meter and register shift, but I got a sum of (absolute) the tick counter.) I will be grateful for any suggestion. I need at this point to draw the graph with measured values.

    Lukasz

    Hi Lukas.

    your question looks like a perfect example to learn how to use the shift registers. Is - this work at home?

    (With the help of a random wait for testing...)

  • Best practices with the sliders with loops

    I have the following code:

    Declare
    
        CURSOR c_contacts_cursor
        IS
          SELECT OUTLET_CODE,
            OUTLET_NAME,
            CONTACT_NAME,
            MOBILE_NO,
            ALT_NO,
            ADDRESS1,
            ADDRESS2,
            CITY,
            POSTCODE,
            EMAIL
          FROM SYNC_CONTACTS
          WHERE (source      = 'W' OR SOURCE = 'T') AND SURVIVAL_FLAG = 'Y';
    
        TYPE temp_string IS TABLE OF VARCHAR2 (2000);
            
        V_OUTLET_CODE  temp_string;
        V_OUTLET_NAME  temp_string;
        V_CONTACT_NAME temp_string;
        V_MOBILE_NO    temp_string;
        V_ALT_NO       temp_string;
        V_ADDRESS1     temp_string;
        V_ADDRESS2     temp_string;
        V_CITY         temp_string;
        V_POSTCODE     temp_string;
        V_EMAIL        temp_string;
           
    BEGIN
    
        OPEN c_contacts_cursor;
        FETCH c_contacts_cursor BULK COLLECT INTO
        V_OUTLET_CODE,
        V_OUTLET_NAME,
        V_CONTACT_NAME,
        V_MOBILE_NO,
        V_ALT_NO,
        V_ADDRESS1,
        V_ADDRESS2,
        V_CITY,
        V_POSTCODE,
        V_EMAIL;
        CLOSE c_contacts_cursor;
    
        FOR indx IN 1 .. V_OUTLET_CODE.count
        LOOP
          --xecutable statements on V_OUTLET_CODE(indx) and the like
    
        END LOOP;
    End;
    
    

    I used the above structure at length in many functions and procedures of all associated with an application and works very well. However, I began to review my code and I thought he might be better way to do it. One of the methods I've found is cursor for loop: http://www.techonthenet.com/oracle/loops/cursor_for.php

    and http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/cursor_for_loop_statement.htm#LNPLS1155

    I'm trying to understand the advantages and disadvantages of each method. I get the following (rating my approach is, and cursor for loop is B

    (1) A is faster because it uses in BULK COLLECT IN as opposed to B which is implicitly opens, fetch a row and close each round loop.

    (2) A is a bit messy, a lot more code as opposed to B which is readable, ranger.

    First of all, I would like to know, if my conclusions are correct or not?

    Second, what other differences might be between the two?

    Third, is there another approach, that I'm not aware? Or what improvement could be applied to my approach, if there is?

    Hawk333 wrote:

    Yes, I did. Executable statements are most HTTP POST and PUT request that write in MongoDB on a platform that does not write in BULK. So I have to write one record per HTTP request.

    Then pass PL/SQL to run multipe HTTP put and recorded at the same time. In which case manual removal bulk buys you no performance gain and zero scalability.

    Use DBMS_PARALLEL_EXECUTE to chunk the workload. Execute each thread (parallel work process) using a standard FOR cursor loop (for example for loop in(select...) end of loop; c...) --and inside the loop, make HTTP calls.

  • For the verification of loop fetch

    Hi experts,

    As everyone knows, for loop taken 100 lines per each iteration (network roundtrips to 100 by default). Please, if it is correct me if I'm wrong, I know the following codes are the same.


    for rec in (select * from employess)

    loop

    do_some_work

    end loop;


    declare

    cursor c is select * from custtable where rownum < 10;

    type of my_t is table of c%rowtype;

    REC my_t;

    if not c%isopen then

    Open c;

    end if;

    loop

    Fetch c bulk collect into rec limit 100;

    do_some_work

    output when rec.count = 0;

    end loop;

    Close c;

    My question is, when I try to check the FOR LOOP to retrieve the query 100 lines per iteration, I use view v$ sql. However, it does not work. Because the PL/SQL block is ready. I need not to see that the sql that is used in the LOOP FOR query. So, what should I do to check that the extraction of LOOP FOR 100 rows per each iteration? Dynamic operating modes should I watch?

    Thanks in advance.

    You can simply enable SQL_TRACE and check. I used a TEMP table that has 1000 rows.

    SQL > select count (*) temp;

    COUNT (*)
    ----------
    1000

    SQL > alter session set sql_trace = true;

    Modified session.

    SQL > alter session set tracefile_identifier = "kar28042014";

    Modified session.

    SQL > start
    2 for i in (select * from temp)
    loop 3
    4 null;
    5 end of loop;
    6 end;
    7.

    PL/SQL procedure successfully completed.

    SQL > alter session set sql_trace = false;

    Modified session.

    If you see the trace output, you can see 11 extraction operation is done. 10 * 100 = 1000 read lines. The extra 1 extraction is to check if there is nothing else to look for.

    Parsing user id: 191    (recursive depth: 2)
    Rows    Row Source Operation-------  ---------------------------------------------------      1  SORT AGGREGATE (cr=14 pr=0 pw=0 time=883 us)  1000  TABLE ACCESS FULL TEMP (cr=14 pr=0 pw=0 time=185 us)
    ********************************************************************************
    
    call    count      cpu    elapsed      disk      query    current        rows------- ------  -------- ---------- ---------- ---------- ----------  ----------Parse        1      0.01      0.00          0          1          0          0Execute      2      0.00      0.00          0          0          0          0Fetch      11      0.00      0.00          0        23          0       1000------- ------  -------- ---------- ---------- ---------- ----------  ----------total      14      0.01      0.01          0        24          0       1000
    
  • How to reduce the length of loop of HP

    Hello

    I'm running a model with a rate of 5 kHz in a quad core 2 to 2.6 GHz computer.

    If I put in "parallel" run mode model County is growing rapidly but the model rate keeps at 5 kHz.

    Changing the mode of execution of "Low latency" model remains at 0, rate model County goes to 2.5 kHz and increases the number of HP.

    The total allocation of processor of each carrot never passes over 58% in "Low latency" but reached 98% in "parallel".

    I tried several combinations of basic allowances (auto / manual) for loops and model, but the main factor is always to run mode.

    I have observed that, when you use a low latency, the length of loop of HP reached 218000 ns which explains why the model rate drops.

    Is there another setting I can use to leave the system without cost overruns?

    See you soon,.

    Claudio H.

    Hello

    I managed to include optimization during code generation options.

    In the Simulation > Configuration settings > RealTime workshop > NI Configuration > compiler optimizations, I put "To promote a quick code" and got:

    -size of the dll from 452 kb to 404 KB

    -Model occupation CPU loop from 98% to 82%

    -7% to 23% control loop

    -Data loop ranging from 8% to 49%

    -Account template more fast to very slow.

    It seems that now the model works more time and loop control and loop data have more work.

    We will work in the model to make it easier we can.

    See you soon.

  • Create a table in a loop 'for' (reset the number of loops)

    Hello

    I try to incorporate a signal of acceleration from an analog input CRIO to get speed and then further integrate to get the moving of a vibration system.

    I understand that to achieve integration, a table must be fed in. My problem is that I could not buffer the signal in a buffer block, as I couldn't find buffer blocks. so I decided to create my data table by using a loop "for". The nests of the loop 'for' inside a timed loop. The problem that I'm stuck on is how to reset the loop 'for' in order to fill the buffer with each iteration of the outer loop timed.

    I enclose the code if that helps. Note that I use labview in 2013.

    If anyone who has encountered a similar problem before can help me, I would be gratefull.

    Concerning

    Ali

    You can use a shift register initialized as inputs to your curls, to build your table of one. However, you realize, don't you, that the execution of your program as written loops as soon as the computer can spit out responses, then the output array may contain several points that took place before the entry has updated? Assuming that your thing cRIO (I've not worked with these) has integrated into its routine acquisition of calendar data, I suggest you put that inside the loop to get a data point by reading.

    And do you really want your graph to distance for update only every thousand points (points of acceleration million) speed?

    Cameron

  • calculations between two values of the sequential loop iterations

    Hi all

    I have a code that came out our power (DSP) of a FFT spectral density. An input frequency and then intervened at a value of input from the user. I would like to know the difference of the PSD between each stage of the frequency. Attached, that's what I would get. To avoid confusion, I don't want to produce a file that looks like this. I want just the column 'delta' as an indicator on the front panel, so I can control my change in PSD. I don't need the entire table, just the delta between the current iteration and the previous iteration. I tried to use a loop with shift registers, but I'm not sure where to go to from there. I thought that, since the shift registers sends the data of loop to loop, that I could output the value before it went into the next iteration, but I don't have a chance. Any help is appreciated. Unfortunately, I am unable to put the code due to the policy of the company. I know it makes things much more difficult.

    Thank you.

    Suggestions do not seem quite right, but I found a way to do it. Attached, is the way that I did.

  • Suggestions to maximize the performance of loop of RT

    I've attached a screenshot of a small portion of a RT data acquisition and treatment program. This loop treats 1 second blocks of data from a FIFO RT but very rarely (about once per day) the loop is slowing to the point where he is not able to track the data blocks 1 second coming from the producer loop (not shown). Normal loop iteration time is about a half a second, but when he falls behind, iteration rate slows down until almost 2 seconds and does not recover.

    The incoming data for the treatment are an array of 14 waveforms, 102400 each of the samples.

    1 channel is peeled off very early for the treatment of tachometer. For other analog channels, there are a few calibration and light filtering/RMS calculation then the data is sent to an another RT FIFO. Then the analog channels are highly filtered, decimated and sent an FFT / unit conversion/integration VI. The FFT results are transmitted over the network and then checked for overtaking in VI connected to the shared variable of the network 'fireplace data '. Step much more time of the whole process seems to be the wave filter vi form, just after the RT FIFO first write operation.

    I'm looking for suggestions on improving the performance and the deterministic nature of this loop. So far, I've only tried to turn off debugging and reentrant inline, all the vi if the sub vi supports. These measures have helped, but I see the question coming. I'm willing to try anything, so just point out something that does not look quite right. I will be happy to provide more details on one of the vi if this will help.

    I could considerably improve the performance by using the place in the structure of the element for the same vi, calibration and decimation. Then, I replaced all build tables with a subset of spare board. Finally, I have pipelined loop into two distinct stages. Since the target RT uses only one heart, so I don't get a multithreading performance gain, but it seemed a little better job, I don't know why...

  • Dividing the curves with loops and berries

    Greetings,

    I like a wave form and I need to divide the curve so that it consists of three segments, each segment starting at the value of a peak and ending to the next using loops and berries.  I also need to combine in a 2D array and draw the waveforms.

    I'm stuck on how to do it. I have attached my code.

    Can someone give me some ideas?

    Thank you!

    TheLT

    I'm picturing something along these lines.

  • output to the loop iteration

    Hi people!

    I am trying to use a very simple "loop For" with "16" iterations and Shift Registers starting at '0' and adding '4' on each iteration.

    But I am not successful to display each value in the iteration. Only the final value of '64 "!

    Is it possible to generate the value of each iteration in each loop?

    If this is the case, then could you give an example?

    See you soon!


  • Text added in loop file adds the value of delimiter unwanted at the end of each iteration.

    I use 'Export to Spreadsheet.vi' in a loop that records a text file and adds data to a waveform table 1 d for each iteration. My problem is that, at the end of each iteration of what an extra delimiter value is added to the file. When I then try to graph my data, I get the holes, as shown below (circled in black).

    When I start to analyze the data, I'm sure it will be a nuisance. I can't find a solution to this problem. Any advice would be greatly appreciated.

    Thank you.

    Any wire TRUE here

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

  • C6180: To avoid damage, use the power button / shutdown - message does not disappear and the printer is looping

    I have problems with my printer since arriving to a new home. I stop the printer before removing the cable, but seems could have pulled the power cable earlier than closing down.

    Since that time, the printer is looping with message "to avoid damage to use the off button /...» "- How do I stop and work again.

    Please help!

    Thank you.

    Heck!

    I was really hoping that would not be the issue.

    So, if I understand it, the question you receive looks like this;

    "It lights up and shows the HP logo and process bar animation for one minute, followed by the message:"abnormal termination. "  To avoid damage use on the button to turn off the printer.  Do not use a wall or the band switch to close.  Press OK.  Then he stops and leaves upward. »

     

    Try this:

    1. If the printer is still on, unplug all rigid and flexible cables at the back of the printer.

    2 unplug the power cord also from the wall...

    3. wait for two minutes.

    4 reconnect the power cord to a wall outlet first.

    5. hold the pound (#) and six 6 buttons.

    6. all by pressing the two buttons, reconnect the power cord to the back of the printer and at the end of two seconds, exit book and six buttons.

    7. turn on the printer if it goes out...

    Third times the charm, right? * fingers crossed *

     

  • How can I limit the amout of loops in my animated film

    I appreciate the opportunity to tick a box to ad loops but I can't for the life of figure me out how to limit the number of loops. Much necessary in web advertising.

    Help, please! I need two times in a loop. That's all. and what worked on board does on anime.

    Thank you!

    put this on the last frame of your animation.

    {if(!this.alreadyExecuted)}

    this.alreadyExecuted = true;

    this.loopNum = 1;

    } else {}

    this.loopNum ++;

    {if(this.loopNum==2)}

    This.Stop ();

    }

    }

Maybe you are looking for