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.

Tags: NI Software

Similar Questions

  • Is it possible to use transparency AND the outer glow in a target of composition?

    I created a composition that uses a lot of buttons to display overlays of different on a background image. The idea is that you can see through the images superimposed with an opacity of 50% (for example) to see the image below, in order to understand the context of the overlay image. I also wanted to point out the image overlaid with an outer glow. This kind of work, but I can't get the outer glow AND the opacity to work together when it is applied to the State of the overlay image. If I ask to them both that I lose the opacity of 50%. In the end I had to apply the opacity of 50% of the target of composition itself, but it's not ideal because it affects other elements within the target (for example, a text box describing the overlay image). The outer glow and opacity properly when applied to an image outside the composition, for example a picture placed on the page.

    The link below will take you to the page that I'm working on.

    All targets of composition have opacity 50% (or 75% on click) applied to the target itself and the outer glow applied to the image EXCEPT 'Pair Cubby' which has opacity 50% applied to the image AND external glow. As you can see the pair "Cubby" seems to ignore the opacity setting and is 100% opaque.

    Under the hood (TCV - M)

    Any ideas?

    Edit: when I saw in Muse it works but not when I discovered in the browser (IE and Chrome, have not tried Firefox)

    I think I solved my own question. Instead of using "Opacity" next to the "Effects" option, I used "Fill" opacity. This seems to work fine now.

  • subqueries, nested, using elements of the other party of the request

    Hi all
    I have a delicate problem, and I'll try to explain my best:

    DB version is 11.2.0.3.0
    create table product_list (product_id number,
                    project_name varchar2(30))
    
    create table products (product_id number,
                    project_desc varchar2(30))
    
    create table total_counts (product_id number,
                    total_count number,
                    project_name varchar2(30))
    
    create table fixed_counts (product_id number,
                    fixed_count number,
                    project_name varchar2(30).
                        fixed_date date)
                        
    create table product_rating (product_id number,
                    rating number,
                    quarter_last_updated number)
                        
    create table quarters (quarter_id number,
                    quarter_end_date date)
    
    
    insert into product_list values (1, 'Prod 1');
    insert into product_list values (2, 'Prod 2');
    insert into product_list values (3, 'Prod 3');
    
    insert into products values (1, 'Prod 1');
    insert into products values (2, 'Prod 2');
    insert into products values (3, 'Prod 3');
    
    insert into total_counts values (1, 2000, 'Prod 1');
    insert into total_counts values (2, 1000, 'Prod 2');
    insert into total_counts values (3, 500, 'Prod 3');
    
    insert into fixed_counts values (1, 1, 'Prod 1', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (1, 3, 'Prod 1', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (2, 50, 'Prod 2', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (2, 2, 'Prod 2', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (2, 3, 'Prod 2', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (2, 3, 'Prod 2', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (3, 8, 'Prod 3', to_date('01/01/2013','DD/MM/YYYY'));
    insert into fixed_counts values (3, 3, 'Prod 3', to_date('01/03/2013','DD/MM/YYYY'));
    
    insert into product_rating values (1, 1, 1);
    insert into product_rating values (3, 2, 2);
    
    insert into quarters values (1, to_date('01/10/2012','DD/MM/YYYY'));
    insert into quarters values (2, to_date('01/02/2013','DD/MM/YYYY'));
    My current query joins actually 2 tables 'TOTAL_COUNTS' and 'FIXED_COUNTS '. The FIXED_COUNTS table is updated every day when a product has a patch against it and the query returns a list of all products and their "fixed" rate percentage (used in an interactive report of the APEX).
    select A.PRODUCT, A.TOTAL, B.FIXED, a.PROD_ID, round((FIXED/TOTAL) * 100,  2) percent
    from (
    select sum(a.total_count) TOTAL, a.product_id PROD_ID, d.Product_desc PRODUCT
    from total_counts a, product_list c, products d
    where a.product_id = c.product_id
    and lower(a.project_name) = lower(c.project_name) 
    and c.product_id = d.product_id
    group by a.product_id, d.product_desc
    ) A
    JOIN 
    (
    select sum(b.fixed_count) FIXED, b.product_id PROD_ID, d.Product_desc PRODUCT
    from fixed_counts b, product_list c, products d
    where b.product_id = c.product_id
    and lower(b.project_name) = lower(c.project_name) 
    and c.product_id = d.product_id
    group by b.product_id, d.product_desc
    ) B
    on A.PROD_ID = B.PROD_ID and A.PRODUCT = B.PRODUCT 
    It gives me a result like:
    PRODUCT     TOTAL     FIXED     PROD_ID     percent
    Prod 1     2000     4     1     0.2
    Prod 2     1000     58     2     5.8
    Prod 2      500     11     3     2.2
    The application works very well and does exactly the job I need. However, I now a requirement that when a product gets a percentage rate 'fixed' more than 1% of the product gets a point added against her in a table 'product_rating' and I have to recalculate the percentage of the date, the item has been added (so no points added we take all 'fixed').

    To do this, I added 2 new tables: "product_rating" and "quarters". The "product_rating" table contains the Product_id and points, he has accumulated so far. It is updated once a quarter. 'Quarters' table simply contains the dates for us to use for calculations again.

    Actually, I need to replace this:
    sum(b.fixed_count) FIXED
    with something like this:
    if a product has a point against it in the "product_rating" table then we just show fixes from the date the point was added i.e. 
    select sum(b.fixed_count) from fixed_counts b, product_rating c, quarters d
    where b.product_id = c.product_id and c.quarter_last_updated = d.quarter_id
    and b.product_id = PROD_ID
    and b.fixed_date > (select quarter_end_date from quarters where quarter_id = the_last_quarter_updated)
    Based on the values in the tables above the percentages for "3 Prod' should now be 0.6.» It is because he received a product_rating the quarter 2, then the new calculation is based on all the "corrections" after this date (only the last March 1 13').

    I tried many ways to integrate this into the current query, but I can't make it work. Sorry for not adding the info from the entire table, but the tables total_counts and fixed_counts have many more columns that I removed the query so it would be easier to observe. Thanks in advance for your help. If I can add more info ask please.
    Tom

    Published by: on May 14, 2013 TomH 08:54

    Published by: on May 14, 2013 TomH 08:58

    TomH wrote:
    of course, to the right, thank you.
    I added some info table and data that will hopefully a little easier to understand.

    OK, thank you... to the future but please try and run the commands yourself for you sure they work. What you provided is close, but it has not executed immediately without modifications.

    I will start by expressing my concerns for your data model, it seems... well, for lack of a better word. Although you said you deleted a bunch of stuff to make the example. You have someone, you you work who can look at the model for you?

    With respect to the query, it's not pretty (I'm in a bit of a rush here) so you can probably clean it considerably. I just tried to show the basics of what you're going to have to do.

    ME_XE? with base_data as
      2  (
      3     select
      4        b.fixed_date,
      5        b.fixed_count,
      6        b.product_id ,
      7        d.project_desc
      8     from fixed_counts b, product_list c, products d
      9     where b.product_id = c.product_id
     10     and lower(b.project_name) = lower(c.project_name)
     11     and c.product_id = d.product_id
     12  ),
     13     final_base_data as
     14  (
     15     select
     16        b.product_id      PROD_ID,
     17        b.project_desc    PRODUCT,
     18        sum
     19        (
     20           case
     21              when b.fixed_date >= stuff.quarter_end_date or stuff.quarter_end_date is null
     22              then
     23                 b.fixed_count
     24              else
     25                 0
     26           end
     27        )  as FIXED
     28     from base_data b
     29     left outer join
     30     (
     31        select
     32           pr.product_id,
     33           qr.quarter_end_date
     34        from product_rating pr , quarters qr
     35        where pr.quarter_last_updated = qr.quarter_id
     36     )  stuff
     37     on (stuff.product_id = b.product_id)
     38     group by b.product_id, b.project_desc
     39  )
     40  select A.PRODUCT, A.TOTAL, B.FIXED, a.PROD_ID, round((b.FIXED/a.TOTAL) * 100,  2) percent
     41  from
     42  (
     43     select sum(a.total_count) TOTAL, a.product_id PROD_ID, d.project_desc PRODUCT
     44     from total_counts a, product_list c, products d
     45     where a.product_id = c.product_id
     46     and lower(a.project_name) = lower(c.project_name)
     47     and c.product_id = d.product_id
     48     group by a.product_id, d.project_desc
     49  ) A
     50  JOIN final_base_data B
     51  on A.PROD_ID = B.PROD_ID and A.PRODUCT = B.PRODUCT
     52  ;
    
    PRODUCT                                     TOTAL              FIXED            PROD_ID            PERCENT
    ------------------------------ ------------------ ------------------ ------------------ ------------------
    Prod 1                                       2000                  4                  1                 .2
    Prod 2                                       1000                 58                  2                5.8
    Prod 3                                        500                  3                  3                 .6
    
    3 rows selected.
    

    See you soon,.

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

  • 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 the entry changes with each iteration of the while loop

    Hello

    can anyone explain (clarify) to know how or what contribution will be fed like the d block of adaptive filtering for the first, second entry (n) and remaining iterations of the while loop as shown in the picture as an attachment...

    As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

    Thank you.

    You have a shift register on the edge of the loop, so for the first iteration, the input (n) d will get everything that feeds the shift register on the left of the outside. After that the adaptive filtering performed, e (n) is injected in the shift to the right, register to be read from the shift register on the left on the next iteration. And so on. This seems pretty much what you want.

    PatanGova wrote:

    As I need to feed the e (n) out of the while loop as input d (n) to the Adaptive block for the first iteration for the next iteration of the previous output e (n) of the block Adaptive must be fed back as input (n) d and other x (n) of entry form the DAQmx.

    If you need retain the value in calls, use a node that is initialized in the world of feedback to feed out of the while loop at the entrance.

  • 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

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

  • 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

  • Is there a way to reset displays step status for iterations of the successive loop (NOR with active follow-up sequence editor)

    I'm running a sequence in the sequence editor (single-pass) with active follow-up.  I find that when I get a section in my sequence loop, the displayed State of stage starts in white, is preparing for the first passage through each step of the loop, and the steps are displayed to this status, unless / until modified in a loop later.  I would prefer that the status of step back empty at the beginning of each iteration of the loop and then get / displayed when the step is completed (yet) in order to better show the progress through the wrist strap.  Is there a way to do this?

    Thank you Ray!

    I've attached an example of using the method suggested by Ray reference.

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

  • 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

  • Windows Update crashed my computer, sending me into the 'frustration after the reboot loop.' I use Vista, by the way. (Even worse!)

    Hi MS. victims (be strong!)

    I have the same problem about the update of windows. What happened was that I had put just internet access at home, so I was invited later to "new windows updates available" so I agreed. After about an hour (because he was that much) it was done and was ready to be restarted. so I restart my computer without hesitation because I had already created a restore point. The Blue Screen of Death. so he started to happen... the "loop." no Safe Mode. no last good configuration that worked. No command prompt. none worked. I mean, it's just bad.

    Victims of the SP, please help. I use vista, by the way. even worse!

    Windows Update Forum:

    You will get the best help for any problem of Update/Service Pack in the Windows Update Forum; the link below:

    http://social.answers.Microsoft.com/forums/en-us/vistawu/threads

    When you repost here, kindly include the Error Codes, and exactly what is happening when you try to update.

    In this way, you will receive the best help.

    See you soon.

    Mick Murphy - Microsoft partner

  • Loop for stop the iteration to the first page

    I have a loop to apply a paragraph style, but it stops the iteration to the first page of the document.

    I need to apply the style to all of the document... can not understand why it does not work.

    Here is my script:

    myDocument var = app.activeDocument;

    var myParagraphStyle = myDocument.paragraphStyles.item ("paragraph Style");

    myDocument.pages.item (0).textFrames.item (0).paragraphs.item (0) .appliedParagraphStyle = myParagraphStyle;
    paragraphs var = myDocument.pages.item (0).textFrames.item (0) .paragraphs

    for (i = 0; i < paragraphs.length; i ++)
    {
    var point = paragraphs.item (i)

    paragraph.applyParagraphStyle (myParagraphStyle, true);
    }

    Thank you

    Thanks, I've cleaned up the script, but it always stops after the first page.

    Yes, because you talk to paragraphs in a (first) special textFrame and not to the story.

    You must change your third line or replace it with that:

    var  myParagraphs = myDocument.pages.item(0).textFrames.item(0).parentStory.paragraphs;
    
  • You can use photoshop to get out of the fisheye photo effect? [was: Fisheye]

    You can use photoshop to get out of the fisheye photo effect?

    Using Photoshop | The Adaptive Filter Wide Angle

Maybe you are looking for