Initial order of parallel loop

Hi,
I have two parallel loops.  One of them must start first for one iteration.  After the first iteration, order of perference between the loops no longer matter.  I used notifier inside a case structure that gets activated only when i = 0.  Is there a better way?  If I want to do this with semaphore, how would I do that?  Thanks!
Kudos and Accepted as Solution are welcome!

Does the first loop have to complete its first loop before the second one starts, or does the first loop just have to start executing before the second one? If the later, you could also put a short delay in front of the loop you want to start second. This would guarantee that the other loop would always start first.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • Parallel Looping

    Hi,
    How does parallel looping works?
    I need to get every entry from afko-plnbez for every crhd-arbpl...
    Now for every crhd-arbpl and afko-plnbez,,, I have to get the mseg-menge where mseg-bwart = 101 and 102...Then,
    Add the values where mseg-bwart is 101 and subtract from that the summation of values where mseg-bwart is 102...
    I have the code below:
       REFRESH i_crhd.
       SELECT a~kostl
              b~objid
              b~vgwts
              b~arbpl
         FROM crco AS a INNER JOIN crhd AS b
           ON aobjid = bobjid
           INTO TABLE i_crhd
           WHERE b~arbpl IN s_arbpl.
       REFRESH i_mseg.
       SELECT a~mblnr
              a~bwart
              a~matnr
              a~werks
              a~dmbtr
              a~menge
              a~meins
              a~aufnr
              a~kostl
              b~budat
              FROM mseg AS a INNER JOIN mkpf AS b
              ON amblnr = bmblnr
              INTO TABLE i_mseg
                WHERE a~werks = p_werks
                  AND b~budat IN s_dates.
    IF i_mseg[] IS NOT INITIAL.
           REFRESH i_afko.
           SELECT aufnr
                  plnbez
                  aufpl
                  rsnum
             FROM afko INTO TABLE i_afko
             FOR ALL ENTRIES IN i_mseg
             WHERE aufnr = i_mseg-aufnr.
    endif.

    hi,
    hope this link will help u to know about parallel cursor ie using loops inside loops
    [http://www.****************/Tutorials/ABAP/ParallelCursor.htm]
    regards,
    priya

  • Performance enhancement for parallel loops

    Hi,
      I have performance problem for the following parallel loops.Please help me solve this to improve performance of report,urgently.
    LOOP AT xt_git_ekpo INTO lv_wa_ekpo.
    lv_wa_final-afnam     = lv_wa_ekpo-afnam.
    LOOP at xt_git_ekkn into lv_wa_ekkn  where ebeln = lv_wa_ekpo-ebeln
    and ebelp = lv_wa_ekpo-ebelp.
    lv_wa_final-meins     = lv_wa_ekpo-meins.
    READ TABLE xt_git_ekko INTO lv_wa_ekko
                                    WITH KEY ebeln = lv_wa_ekpo-ebeln
                                    BINARY SEARCH.
          IF sy-subrc IS INITIAL.
            lv_wa_final-ebeln     = lv_wa_ekko-ebeln.
            lv_wa_final-ebelp     = lv_wa_ekpo-ebelp.
            lv_wa_final-txz01     = lv_wa_ekpo-txz01.
            lv_wa_final-aedat     = lv_wa_ekko-aedat.
    READ TABLE xt_git_lfa1 INTO lv_wa_lfa1
                                          WITH KEY lifnr = lv_wa_ekko-lifnr
                                          BINARY SEARCH.
            IF sy-subrc IS INITIAL.
              lv_wa_final-lifnr = lv_wa_lfa1-lifnr.
              lv_wa_final-name1 = lv_wa_lfa1-name1.
            ENDIF.
         LOOP AT xt_git_ekbe INTO lv_wa_ekbe WHERE   ebeln      =   lv_wa_ekpo-ebeln
    AND  ebelp = lv_wa_ekpo-ebelp.
    waiting for quick reply.

    Hi
    U can use SORTED TABLE instead of STANDARD TABLE:
    DATA: xt_git_ekkn TYPE SORTED TABLE OF EKKN WITH NON-UNIQUE KEY EBELN EBELP,
              xt_git_ekbe  TYPE SORTED TABLE OF EKBE WITH NON-UNIQUE KEY EBELN EBELP.
    LOOP AT xt_git_ekpo INTO lv_wa_ekpo.
        lv_wa_final-afnam = lv_wa_ekpo-afnam.
        LOOP at xt_git_ekkn into lv_wa_ekkn where ebeln = lv_wa_ekpo-ebeln
                                                                  and ebelp = lv_wa_ekpo-ebelp.
            lv_wa_final-meins = lv_wa_ekpo-meins.
            READ TABLE xt_git_ekko INTO lv_wa_ekko WITH KEY ebeln = lv_wa_ekpo-ebeln
                                                                                    BINARY SEARCH.
            IF sy-subrc IS INITIAL.
              lv_wa_final-ebeln = lv_wa_ekko-ebeln.
              lv_wa_final-ebelp = lv_wa_ekpo-ebelp.
              lv_wa_final-txz01 = lv_wa_ekpo-txz01.
              lv_wa_final-aedat = lv_wa_ekko-aedat.
              READ TABLE xt_git_lfa1 INTO lv_wa_lfa1 WITH KEY lifnr = lv_wa_ekko-lifnr
                                                                                    BINARY SEARCH.
              IF sy-subrc IS INITIAL.
                 lv_wa_final-lifnr = lv_wa_lfa1-lifnr.
                 lv_wa_final-name1 = lv_wa_lfa1-name1.
             ENDIF.
             LOOP AT xt_git_ekbe INTO lv_wa_ekbe WHERE ebeln = lv_wa_ekpo-ebeln
                                                                             AND ebelp = lv_wa_ekpo-ebelp.
    Anyway u should considere to upload in the internal table only the record of the current document, in this case u need to insert the SELECT into the loop:
    SORT  xt_git_ekpo by EBELN EBELP.
    LOOP AT xt_git_ekpo INTO lv_wa_ekpo.
        lv_wa_final-afnam = lv_wa_ekpo-afnam.
       IF lv_wa_ekkn-EBELN <>  lv_wa_ekpo-EBELN.
         SELECT * FROM EKKN INTO TABLE xt_git_ekkn WHERE EBELN = lv_wa_ekpo-EBELN.
         SELECT * FROM EKBE INTO TABLE xt_git_ekbe WHERE EBELN = lv_wa_ekpo-EBELN.
       ENDIF.
        LOOP at xt_git_ekkn into lv_wa_ekkn where ebelp = lv_wa_ekpo-ebelp.
            lv_wa_final-meins = lv_wa_ekpo-meins.
            READ TABLE xt_git_ekko INTO lv_wa_ekko WITH KEY ebeln = lv_wa_ekpo-ebeln
                                                                                    BINARY SEARCH.
            IF sy-subrc IS INITIAL.
              lv_wa_final-ebeln = lv_wa_ekko-ebeln.
              lv_wa_final-ebelp = lv_wa_ekpo-ebelp.
              lv_wa_final-txz01 = lv_wa_ekpo-txz01.
              lv_wa_final-aedat = lv_wa_ekko-aedat.
              READ TABLE xt_git_lfa1 INTO lv_wa_lfa1 WITH KEY lifnr = lv_wa_ekko-lifnr
                                                                                    BINARY SEARCH.
              IF sy-subrc IS INITIAL.
                 lv_wa_final-lifnr = lv_wa_lfa1-lifnr.
                 lv_wa_final-name1 = lv_wa_lfa1-name1.
             ENDIF.
             LOOP AT xt_git_ekbe INTO lv_wa_ekbe WHERE ebelp = lv_wa_ekpo-ebelp.
    In my experience (for a very large number of records) this second solution was faster than the first one:
    - Using the first solution (upload all data in internal table and use sorted table): my job takes 2/3 days
    - Using the second solution: my job takes 1 hour.
    Max

  • Inconsiste​nt Parallel Loop Performanc​e

    My original question was can traditional DAQ devices run in parallel loops? I have some extensive data processing and additional automation that would be a lot easier to do in parallel with an acquisition loop rather than cram it all into the acquisition's while loop. As I was building an example VI, I discovered the answer seems to be "sometimes".
    I am working on a calibration rig for hot wire anemometers. It requires pressure values to be read into a PCI-4351 (traditional DAQ) for the duration of the calibration and record wire voltages to a PCI-6110 (DAQmx device) only when the pressure values have settled (i.e. the stream velocity is constant). Inevitably, both devices will be polling data simultaneously at some point.
    It seems that the 4351 would transfer its data to a parallel loop, but not when 6110 was running and vice versa - and sometimes the buttons to stop the loops wouldn't work. Will traditional DAQ and DAQmx devices not perform parallel tasks simultaneously?
    The attached VI might clear up the parallel structures I'm talking about.
    Andrew
    Andrew
    Attachments:
    ParallelLoopsExample.vi ‏32 KB

    Altenbach,
    You pointed me a good direction - I wasn't familiar with action engines until you mentioned them, but after some reading (namely Ben's AE nugget), you have me convinced (although not entirely sure on how to proceed) so here come the questions!
    1. I tried to use Ben's running average example as a template - what should the cases inside my AE be? Right now they're "initialize", "acquire", and "close". However, I have to pass a value from initialize to acquire to close - so as is, the VI won't run.
    2. Ben had his AE in a loop to add data to the array and in another loop to perform the running average calculation. Since you end up with two of the same thing in your BD, how is this better than creating a local variable?
    3. Best practice? I'm pulling values from several channels - should I isolate each channel an put it into its own SR within the AE or keep the data together and have a single SR for the 2D array?
    I don't expect anybody to have the 4351 drivers installed - so the what you're probably seeing as three "?" VIs in the "Initialize" panel are the VIs needed to initialize the device (sampling rate, number of scans, etc.), the single "?" in "Acquire" reads the data and the two in "Close" end the acquisition.
    Brad,
    Thanks for the tip - I'll keep that in mind when I'm implementing the 6110 acquisition into my code
    Andrew
    Attachments:
    InputAE.vi ‏20 KB

  • TOO MANY Parallel Loops in Main VI

    Hi,
    I have heard that all vi should fit on one screen.  I have a main vi that have multiple parallel loops.  The first loop is to detect the user request, the second loop is to perform the request, the third loop is to control my samples with digital out and analog out, the forth loop is to display analog in data on the screen, the fifth loop is to empty the daq buffer continuously, and the sixth loop is to log data into a file.  If I have 6 loops in parallel, it is impossible for this vi to fit on one screen.  Is there a better way to organize this?  BTW, this is a multiple producers and multiple consumers architecture.  Thanks!
    Kudos and Accepted as Solution are welcome!

    "jyang72211" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,&nbsp;I have heard that all vi should fit on one screen.&nbsp; I have a
    main vi that have multiple parallel loops.&nbsp; The first loop is to detect
    the user request, the second loop is to perform the request, the third loop
    is to control my samples with digital out and analog out, the forth loop is
    to display analog in data on the screen, the fifth loop is to empty the daq
    buffer continuously, and the&nbsp;sixth loop is to log data into a
    file.&nbsp; If I have&nbsp;6 loops in parallel, it is impossible for this vi
    to fit on one screen.&nbsp; Is there a better way to organize this?&nbsp;
    BTW, this is a multiple producers and multiple consumers architecture.&nbsp;
    Thanks!
    An ideal Vi should fit on screen, because it provides more overview.
    One way to "hide" the parallel loops, is but putting them in sub VI's. This
    is only useful if only one loop deals with UI stuff. If one loop does one
    type of DAQ, it's easy to put this in a sub VI. I'd start this sub VI
    dynamically in the UI loop, but you might as well keep it as a normal VI
    running parallel of the UI loops.
    But I wouldn't force this. There is absolutely nothing wrong with a few
    parallel loops, where each loop takes the full width, and 60% of the height
    of the screen! The reason this became a rule, is to avoid diagrams with: one
    big sequence. In it, four steps. In each step, a nested case, while loop,
    two parallel for loops and in there again two or three sequence structures
    with 8 steps, and 40 nodes kludged together. But shrinking something like
    this (with a few more sequence structures) is not helpful.
    I think there is nothing wrong with a few (perhaps un to 5 or 6) parallel
    loops, as long as there is a logic behind there existence. I often make a
    DAQ VI. In it, there are perhaps 10 loops that read data from serial, tcp/ip
    and fieldpoint devices. So, would it be helpful if I put them in subVI's? I
    think, in this case, not. The reason for the rule is it provides a better
    overview, and this solution would give *less* overview, so, not a good
    idea...
    I'd say: if there is a good reason, and you keep it structured, it is just
    as good as hiding the same stuff behind (dynamic) sub vi's...
    There are some benefits in keeping your diagrams small. It forces you to
    separate your code, and those peaces are more likely to be simpler (thus
    less errors), and more reusable. In the above example of the DAQ loop,
    putting the loops in seperate subVI's, would result in reusable DAQ VI's. So
    it's a delicate issue, don't follow the rules blindly, try to see why they
    are there.
    Regards,
    Wiebe.

  • What is the best way to stop parallel loops at the same time, from any loop?

    If there is a vi with two or more parallel while loops, what would be a good method to simultaneously stop parallel loop execution, from any of the parallel loops? My intent was to try and do this without local variables, so I used notifiers. This seems like an ok method for two loops, but how about for n loops?
    In addition, my code has a flaw. I use an OR block to compare the stop status of each of the loops. This works fine most of the time, but if both loops are triggered to stop at the same time,the boolean result will be false, causing the loops to never stop. How can this be avoided?
    Thanks,
    Curt
    Attachments:
    parallel_loop_w-stop.vi ‏54 KB

    I think you have the right idea, notifiers are one of the better ways to stop parallel loops. You can simplify things by using 1 notifier for everything. I modified your VI to use 1 notifier, it will set the notifier to True ONLY if the loop is stopping, then it stops. The other loop will read the notifier status, and stop based on it the next time it executes.
    I also changed the second loop to stop and notify if it has an error (that is usually a good idea, especally if you have I/O or other things that can cause problems)
    I also changed the switch mechanical action, that will eliminate the problems for your second question.
    The VI's attached are written in Labview 7.0
    P.S. If you have 7.1, the Queues are polymorphic, meaning that the typecast operat
    ions are NOT needed!
    Attachments:
    parallel_loop_w-stop7_0.vi ‏45 KB

  • Possible strange bug with parallel loops in LV2010

    I have a specific code which does not execute correctly in parallel, but making almost any small change to the code causes it to work.  Even more bizarre, I can change it so that it sometimes works correctly, and somtimes doesn't. Interested?  Read on...
    I have a relatively simple VI (to compute 2D Wavelet Denoising on planes of a 3D array) with the following block diagram (debugging not allowed):
    The parallel loop is set to 8 automatically-partitioned instances, and I've tested this on 2-core and 8-core machines.  When the #cores wired into the loop is not one, several of the iterations do not compute (for example 4 out of 24).  I can check this by putting a break in the VI called inside the loop and counting how many times it is called.
    I can do a number of things to make all iterations run:
    - put an indicator inside the loop on the iteration number, or anything else (except the P node)
    - wire the iteration number outside the loop to an indicator
    - remove the case structure
    - remove the loop in the other case (it's at the moment identical except for a call to a different VI which uses Discrete WT instead of Undecimated WT -- if I change the other case to match this one, the other case runs fine but this one still fails)
    - change code outside the loop
    - turn on debugging!
    - change the loop setup to another number of instances other than 8
    - change the loop setup to set the number of partitions
    I can also do a number of things that do not solve the problem:
    - rewriting the loop from scratch
    - copying the loop from the other case
    - saving for LV2009 (in which everything runs as expected) and then reloading (and presumably recompiling) in 2010
    Stranger still, if I replace the called VI with a dummy VI (which simply adds one to the input 2D array so I can tell if it executes), then as long as the other wires are still wired in, it sometimes executes all iterations, and sometimes doesn't (roughly 50% split)!!!  Any other changes and it always works fine.
    I've managed to replace as much as possible with dummy code and still keep the results the same (i.e. sometimes executing all iterations and sometimes not).
    If you want to check it out (on a multicore machine with LV2010), run LoopTest.vi, and the results at the index shown should sometimes be 13 and sometimes 14. Changing #cores to 1 will always give a result of 14, changing WT to DWT always gives 14, even though the code inside both cases is identical!
    Hope it's not just me, otherwise I'll be sure that LV hates me!
    Attachments:
    LoopTest.zip ‏355 KB

    OK, here's a new version that exhibits the same behaviour, but is hopefully simpler to understand.
    The expected result is to add one to the whole array, however sometimes not all of the parallel iterations are executed.  Run ParallelLoopTest.vi from the attached ZIP file on a multi-core machine to verify.  This screenshot shows that sometimes it works correctly, and sometimes not:
    The code in the other case is identical (created by duplicating the case) but always works correctly.
    Attachments:
    ParallelLoopTest.zip ‏63 KB

  • Adding parallel loops programatically

    Hi!
    I'm building a system with some instruments and I want to use the same instrument-VI for all instruments.
    One way is to do it set it up as 'Possible solution..' (see image).
    Is there some way where I can loop through the 'hardware settings'-array and create as many as necessary? Like the 'More what I want...' (see image)?
    Attachments:
    parallel loops.PNG ‏15 KB

    Hello again thread!
    So I'm back on the same problem...
    Summary:
    What I want to do is something like in the new picture 'parallel loops2.png'. Start X parallel loops that each handle the communication with a specific instrument. At the moment I have 9 instruments connected.
    If I use 'Configure Iteration Parallelism' I can set the 'Number of generated parallel loop instances' to the max number (=64 for me) and then use the P terminal with the 'array size' VI to get my 9 instrumentloops running.
    When reading this white paper
    http://www.ni.com/white-paper/9393/en/ ('Improving Performance with Parallel For Loops')
    I'm getting the feeling that the way I solved it is not the way right way. Since the P-terminal should equal the number of cores in the computer.
    The Run! VI does not have any outputs wired to its connector pane. It is reentrant (Preallocate clones - No debugging allowed).
    I havn't looked at Asyncchronous calls yet. Is that the way to go?
    Attachments:
    parallel loops2.PNG ‏3 KB

  • BPM - Parallel Looping - numberOfCompletedIterations.

    Hi,
    In the human activity when using parallel looping, two local attributes are generated automatically currentCollectionItem and numberOfCompletedIterations. I need the value in the numberOfCompletedIterations to my webdynpro java component. I mapped the attribute to the string attribute with function String(/numberOfCompletedIterations), irrespective of the number of iterations completed I am getting the value as 0.
    Any help will be really appreciated.
    Best Wishes
    Idhaya R

    hi,
    hope this link will help u to know about parallel cursor ie using loops inside loops
    [http://www.****************/Tutorials/ABAP/ParallelCursor.htm]
    regards,
    priya

  • No difference between using a local variable and a notifier in timed parallel loops?

    The example code "Pass Data With Notifiers.vi" that came with LV 7.1 illustrates using notifiers with parallel loops.  Just looking at two of the loops, the one that generates the sine wave and the one for "User 1", you can change the timing of the two loops and you can change the condition of the "Ignore Previous" status on the "Wait on Notification".  I have a special case of this to consider, where I'm wondering if there's any reason not to use a local variable instead of the notifier:
    Set the delay on the generator portion (which contains the Send Notification) to something very short, say 5 ms.  Set the delay on the User 1 (which contains the Wait on Notification) to something relatively longer, say 200 ms.  Set the Wait on Notification to False.  Now you have a situation where the User 1 loop action is contingent only upon the loop delay time, since each time the loop timer runs the loop there will always be a value in the notifier.  In this case it seems to behave just like the case where you update a local variable in the fast loop and read it in the slow one.
    Is my understanding correct?  Would there be a performance difference between the two methods?  What do you prefer in this situation and why?
    Thanks,
    Hosehead

    Hi H.,
    I think your idea is to write to a Global Variable in the data-producer VI, and read it in the data-consumer VI(?)
    One reason this might be less efficient than using Notifiers is if you want to graph every new value in the "consumer" - or make sure the value read in the consumer has changed at least once since the last loop.
    > since each time the [consumer] loop timer runs the loop there will always be a value in the notifier...
    > Would there be a performance difference between the two methods? 
    If you don't use the Notification "event" to synchronize the producer and consumer, then to be sure the consumer gets a new vaue, you've made the producer loop faster - every 5 ms - a waste of cpu-cycles.  More often the situation is reversed, that is, there's a consumer that needs to see every single new value, and (without events) the consumer must loop faster than the producer (to catch every new value) - this is called polling and it wastes cpu-cycles.
    Just about anytime one's tempted to make a loop execute "fast" to check on some value (or to make sure there's a fresh value,) there's an opportunity to improve performance through synchronization with events (including notifiers, queues, occurrances, semaphores, and rendezvous')
    tbd
    Message Edited by tbd on 07-09-2006 03:51 AM
    "Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)

  • Golden Gate - Initial Load using parallel process group

    Dear all,
    I am new to GG and I was wondering if GG can support initial load with parallel process groups? I have manage to do an initial load using "Direct BULK Load" and "File to Replicat", but I have several big tables and replicat is not catching up. I am aware that GG is not ideal for making initial load, but it is complicated to explain why I am using it.
    Is it possible to user @RANGE function while performing Initial Load regardless of which method is used (file to replicat, direct bulk, ...) ?
    Thanks in advance

    you may use datapump for initial load for large tables.

  • How can I start and stop two parallel loops?

    Hello,
    I want to control two parallel loops with different timing in a vi . That means to start loop 1, then loop 2, stop loop 1 or 2 restart loop 1 ...
    But if loop 1 is running I cannot start loop two and reverse.
    Can someone help me and show whats wrong in my example?
    Thanks,
    Christian
    Solved!
    Go to Solution.
    Attachments:
    Parallel loops Test.vi ‏46 KB

    Hello Christian,
    The reason why you can't do what you want is in fact quite simple.
    You have an external loop that is "over" the two inner loops.
    So when you stop one of the inner loops, the outer loop will still be in the same iteration until the other inner loop ends - stop the other inner loop.
    You can see it very easily if you probe the iteration counter of the outer loop - only when both the inner loops stop, it will incerment.
    So, to do what you want, you need to make them independent - you need two outer loops.
    Check my attachtment, see if that's what you need.
    Hope this helps,
    Paulo
    Attachments:
    Parallel loops Test2.vi ‏48 KB

  • Shutting down a queued event state machine with multiple parallel loops

    I am trying to find the best way to shutdown a program that consists of a queued event state machine architecture with multiple parallel loops. Can anyone recommend the best way to accomplish this in my attached VI? (From browsing the forum, this seems to be a common question but I haven't found a solution that works for me.)
    I welcome any other feedback on my code as well, if anyone is willing to offer it.
    My Program Requirements:
    If the user presses the "Shutdown" button, the program should prompt the user with "Are you sure you want to stop the program?" and then either return to the Idle state or proceed to stop the program. Additionally if there is an error, the program should prompt the user with "Clear error and continue, or Stop program?" Then either return to the Idle State or proceed to stop the program.
    Details of architecture:
    The program consists of 3 parallel loops: (1) an Event Handling loop that enqueues various States to a State Queue, (2) a State Machine which enters the latest state that is dequeued from the State Queue, and (3) an Error/Shutdown handling loop which processes any errors in the Error queue.
    During normal Shutdown, in the Event Handling loop the "Program.Shutdown" event case executes, and the States "Shutdown" and "Idle" are added to the State Queue. In the State Machine, the "Shutdown" state is invoked. A special error code "5000" is added to the Error Queue. In the Error/Shutdown handling loop, the "5000" error triggers a prompt that asks the user if they want to stop the program. If the user chooses not to stop, a notifier StopNotif is sent to the "Shutdown" state and "Program.Shutdown" event case with the notification "Go". If the user chooses to stop, the notifier sends the notification "Stop". The Event handling loop and State Machine are terminated if they receive the notification "Stop".
    In case of error, the program behaves similarly: if the user chooses to clear the error and continue, the program returns to the "Idle" state.
    HOWEVER - if the user chooses to stop the program, the program stalls. The notifier that is sent to stop the Event Handling Loop and State Machine cannot be read because the Program.Shutdown event case and the Shutdown state (which contain the "Wait for Notifier" function) are not active.
    I have been able to activate the Shutdown state by enqueuing it in the Error/Shutdown handling loop. But I don't know how to activate the "Program.Shutdown" event programmatically, and thereby access the "Wait for Notifier" function inside it.
    I tried to place the "Wait for Notifier" function outside the event structure, but then the Event Handling loop never completes. Placing timeouts on the "Wait for Notifier" and on the Event structure makes the program work, but I want to avoid using timeouts because I don't want to turn my event-driven program into a polling-based program. I'd also like to avoid using variables or property nodes to stop the loops, because that requires creating a control/indicator for something that the user doesnt need to interact with.
    Thank you!
    Solved!
    Go to Solution.
    Attachments:
    Queued event state machine parallel loops empty.vi ‏46 KB

    Thanks for clarifying that, Ravens Fan.
    I marked crossrulz as the solution for pointing out User Events to me.
    I also adopted Ravens Fan's suggestion to keep the Shutdown procedure out of the Error Handling Loop. This has simplified the architecture by eliminating the need for Notifiers. Instead, I have used booleans in case structures to stop the Event Loop and State Machine, and Release Queue to stop the Error Handling Loop.
    For reference, I'm attaching my corrected code.
    Thank you to everyone who helped!
    Attachments:
    Queued event state machine parallel loops empty in progress.vi ‏44 KB

  • Read and write data at different rates, parallel loops.

    Machine monitoring and datalogging application.
    imple question, maybe not so simple answer.
    I want to read fieldpoint channels at a certain rate, say every 2 seconds, so I can verify satisfactory operating conditions of a machine under test.
    I then want to write these values to a file at less frequent intervals, say once an hour, as I have no need to record all the data if the machine is running correctly.
    I thought parallel loops with "wait until next ms multiple" would be the way to go, but I am having trouble ensuring that the slower loop actually grabs the values I need. I am not clear on the intricacies of shared variables, local variable, and queues and not sure which way I need to go.
    Semaphores didn't seem to work for me as the faster loop grabbed control and the slower loop couldn't sneak in to read its values.
    Any help would be much appreciated,
    Thanks

     I would use a queue.  As you gather data, enqueue the data.  In the slower loop, process the data queued so far by reading from the queue until it is empty.  You can use the Queue Status vi and then flush the queue to get ready for new data.
    Here is some sample code to get you started.
    Message Edited by tbob on 08-06-2007 06:00 PM
    Message Edited by tbob on 08-06-2007 06:01 PM
    - tbob
    Inventor of the WORM Global
    Attachments:
    Queue.png ‏8 KB

  • Pass error references to parallel loops

    I have a program with two parallel loops, each of which are contained within subvis for compactness. One of the loops acquires data and writes it to a queue and the other reads the queue and performs calculations. The problem is that I would like to stop both loops if an error occurs in either loop but I get Error 1055 (Object reference is invalid) when trying to write the error to the reference. I know of several ways to get around this (i.e., depend on the timeout, write only the error status, etc.) but was wondering if anyone else has had a similar problem.
    Thanks,
    John

    I have attached jpegs of the code for the main vi and for the data acquisition vi which is giving the problem. I tried to recreate this problem in a scaled down program, but it worked properly. I'll continue taking a closer look at this while I also consider other options.
    Thanks
    Attachments:
    MainProgram.jpg ‏124 KB
    Acquire_subvi.jpg ‏94 KB

Maybe you are looking for

  • F-44 Open Item Selection

    Hello, A user goes into transaction F-44 to clear a vendor but when she hits Process Open Items and brings her to the "Clear Vendor Select Open Items' screen she does not have the field Company Code in the Open Items Selections box.  When other users

  • Is there a fuction call "on change of group" in CR2008?

    i want to summarize a field of the first record in each group, and than display the result in the report header. using "running total field" can summarize it but only calculated the first record if placing the result in the report header. i want to m

  • Exchange 2013 hosting

    Hi, we have three different mail domain hosted in different hosting companies, currently we need all mail domain should be work in exchange 2013. so we configured four servers 2 CAS server (RRDNS) 2 MB server with DAG, domains are hala.local hala.com

  • I got an e-mail that i think is fraud how do i send to apple?

    <Image Edited by Host>

  • Photoshop CS5 Repousse & Mac mini

    does anyone have experience with using the Repousse or other 3D functions of photoshop CS5? my pc graphics card won't support it and i'm looking to switch to Mac anyway, but i don't want to buy a Mac mini if it won't support Repousse and other 3D fun