MASTER/SLAVE PATTERN: how to stop slave loop without stop main loop

Hi All, I am studying the master/slave loop and saw an examples are like this (only master block shows)
From this case, as I understand, if we click "set" button, slave loop will run. If we click this button again to mak it "Flase", the slave loop will be stopped as well as the main loop will be stopped as well.
Now if I have a multi-function main loop, I just want to start or stop slave loop when click "set" button, how can I do it? Thank you very much! 

bhl3302 wrote:
From this case, as I understand, if we click "set" button, slave loop will run. If we click this button again to mak it "Flase", the slave loop will be stopped as well as the main loop will be stopped as well.
Your understanding is completely wrong.  There is nothing in the image you show that would stop either loop.  In this situation the "set" button would normally have a latching mechanical action, meaning that when it is pushed, it will stay true until it is read once, at which point it will return to false.  Placing the control terminal inside the event case causes the terminal to be read and resets the button to false.  With a latching mechanical action, there will be only one event generated even though the boolean will change value twice (from false to true, and from true to false).  You'll never have a situation where you push the button once to set it true, and again to set it false.  However, even if the mechanical action is switching, not latching, it still won't make a difference here - the event case does the same thing whenever the value changes, regardless of whether it's true or false.

Similar Messages

  • PL/SQL Loop without stopping

    Hi, I have a list of procedure name in PROCLIST table. I am planning to fetch it and interate using loop. Inside loop I have to execute the same name procedure.
    Problem : The procedure I have to execute without stopping means in the 1st iteration execute 1st procedure, before completion of the 1st procedure it should iterate for next and execute the 2nd procedure. so my task is to execute this all the procedures parallely. Any type of help is appreciated.

    Hi,
    Thanks for reply. I have tried with the same package. but my all the procedure's name in table which I am fetching using cursor loop.
    My task is to fetch procedure name from the loop and executed it but the loop shouldn't wait for the 1st procedure to complete. Without waiting for 1st procedure to complete, it should interate for the next & fetch the 2nd procedure's name and execute 2nd procedure parallely.

  • How to stop execution in while loop without stopping execution of other loops in the same vi

    HI
    I am quite a novice in Labview.
    I have a problem in my project. I used a while loop inside my vi to build an array of ten values along with other loops. Then I used a stop button to stop manually the while loop. But it seems like the loop doesn't stop in the middle of the array building and so other loops in the vi doesn't work until the while loop finishes building the array and as soon as while loop execution is over, the complete vi stops. But all that I wanted was to build the array using the shift register along with the control to stop building array anytime. And not to stop execution of other structures when the while loop finishes.
    Can anyone help me?
    Rahul

    Hi Rahul,
    Modified ur Vi to work with single button.
    But the subtract case is not in any loop.
    So, once both the loops stop, the subtract case will execute only once. Depending on state of subtaract boolean at that time, corresponding case will be executed and the Vi will stop.
    so think of a logic where u can put this also in a new loop.
    Or you can also incorporate it in one of the two loops and pass the other loop's data to it.
    Let us know how you will proceed in this regard
    I am posting your VI as well a VI with my modifications VI in Labview 7.0 so that Thomas can give his suggestions too
    Plus, always keep a time delay in your while loops.
    Oh sorry, the "arrayinouttestnewfinal.vi" is the modified vi
    Regards
    Dev
    Message Edited by devchander on 01-10-2006 06:15 AM
    Message Edited by devchander on 01-10-2006 06:19 AM
    Attachments:
    arrayinouttestnewfinalnew4.vi ‏59 KB
    arrayinouttestnewfinal.vi ‏63 KB

  • How to run all slides without stop?

    I´m watching an online course made with Flash.The course consists
    of several chapters/slides. After every slide I have to press the play button
    to start the next slide, which is a huge interference
    How do I make all slides run without me having to start all of them manually??

    There are plenty of folks that design things that don't do what others expect they should.  These forums themselves are a grim example of that.  I, personally, wouldn't bother getting so worked up about it--there are far greater woes in life than presentations that don't play thru without using controls.

  • Stopping a SubVI without stopping the main VI

    Hi,
    I have a VI with two SubVIs which are being executed sequently, with the second SubVI waiting for an user event in the first SubVI. The SubVI front panels are open and used as the user interface when they are executed. When I push the stop button on the second SubVI's front panel, I do not want the whole VI to stop, but only that SubVI and execute the first SubVI once again.
    Does anyone have any idea how to achieve that?
    Thanks,
    LordSnow.

    P@Anand wrote:
    LordSnow wrote:
    Hi,
    I have a VI with two SubVIs which are being executed sequently, with the second SubVI waiting for an user event in the first SubVI. The SubVI front panels are open and used as the user interface when they are executed. When I push the stop button on the second SubVI's front panel, I do not want the whole VI to stop, but only that SubVI and execute the first SubVI once again.
    Does anyone have any idea how to achieve that?
    Thanks,
    LordSnow.
    I am bit confused of what you try to achive. How you are executing your sub vi's if you can attach your ode it would be easy to see what you are trying to do.
    Regretfully, I can't upload my code. Therefore, I will try to be more precise in my description. I open the main VI and execute it. This opens and executes the first SubVI, which waits for the user to interact with the front panel. Once this interaction has taken place, the second SubVI is executed which includes pretty much all the code there is. When I did everything I wanted to do in this second SubVI I push the previously mentioned stop button in order to stop that SubVI and that SubVI only, but right now all the VIs stop. My intention is to open the first SubVI again after I stopped the second SubVI.
    Does that help?

  • How to close sub-application without close main-application?

    My main application has a menu which is used to open sub-application window. When I want to close the sub-application, I do not want to use System.exit(0), because it will close the main-application too.
    And if I use setVisible(false), the sub-application remains in memory.
    How can I close a sub-application clearly and keep the main-application open?

    Stephen:
    Some other object may be holding reference to this object.
    Here is how you debug such as problem.
    1. Run your app in the IDE's debugger.
    2. After you think all refs to the object should have gone away, pause the debug session.
    3. Using the View/Debug Windows/Heap menu, bring up the heap window.
    4. Right mouse click on the heap window. Enter the class name (package qualified) of the object which isn't being collected.
    5. Then, find the object that instance. Select it.
    6. Do right mouse click on that and select 'Show Reference Paths.'
    It will show paths to this object. It will show you who's holding ref to this object, preventing it from being garbage collected.
    Thanks.
    Sung

  • I use internode and imap. When the ipad deletes emails it also removes them from the mac. How can I reverse this so the mac is the master and the ipad is the slave?ipa

    I use internode and imap. When the ipad deletes emails it also removes them from the mac. How can I reverse this so the mac is the master and the ipad is the slave?

    Thanks for the info. - I now know that deletion works both ways!! - (unlike POP where emails deleted from the ipad also deleted them from the mac even before I could read them,  whereas emails deleted from the mac were not removed from the ipad!!! - ie. the ipad was the master over the mac - the slave).  Prior to changing to imap I used to transfer all nongarbage emails from inbox to mailboxes before my husband could ask if he could delete emails on his ipad. I have noticed however if you do this in imap, they are removed from the inbox on the ipad as well (this did not happen with POP). So we still have to check but the number is less so we like imap better than POP.
    Thank again

  • I have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    i have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    Hi fais,
    Following through with what JB suggested. The steps involved in replacing the inner for loop with a while loop are outlined below.
    You can replace the inner for loop with a while by doing the following.
    1) Right-click of the for loop and select "Repalce" then navigate to the "while loop".
    2) Make sure the tunnels you where indexing on with the for loop are still indexing.
    3) Drop an "array size" node on your diagram. Wire the array that determines the number of iterations your for loop executes into this "array size".
    4) Wire the output of the array size into the new while loop.
    5) Set the condition terminal to "stop if true".
    6)Drop an "OR" gate inside the while loop and wire its output to the while loops condition terminal.
    7) C
    reate a local of the boolean "stop" button, and wire it into one of the inputs of your OR gate. This will allow you to stop the inner loop.
    8) Drop a "less than" node inside the inner while loop.
    9) Wire your iteration count into the bottom input of the "less than".
    10) Wire the count (see step 4 above) into the top input of the less than. This will stop the inner loop when ever the inner loop has processed the last element of your array.
    Provided I have not mixed up my tops and bottoms this should accomplish the replacement.
    I will let others explain how to takle this task using the "case solution".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to make a button to stop and run a for loop?

    How to make a button to stop and run a for loop?  and if it is stopped it shall start from where i t stopped.

    Your VI has some very fundamental flaws.
    The start/stop button is outside the FOR loop, thus it will NOT get read during execution of the FOR loop, but only before the FOR loop starts. Think dataflow!
    Thus the terminal of the start/stop button belongs inside the FOR loop.
    Your FOR loop iterates 20x, which probably takes about a nanosecond. You will NOT be fast enough to reliably press the start/stop button during a specific iteration of the FOR loop.
    Your code does not "stop and run" a FOR loop (sic). The loop always spins, but executes an empty case when "Stopped". I guess that's what you actually want?
    Once you solve (2), the x indicator will contain a random value whenever you "stop".
    As soon as the 20 iterations complete, the outer while loop spin an things start over, another nanosecond later.
    Place e.g. a 500ms wait inside the FOR loop to solve this.
    Don't place terminals of indicators on top of formula nodes.
    Your formula does not produce any output, so really has no purpose.
    Use a real "stop" button to terminate the while loop (mechanical action: latch when released). Right now you are using a plain switch, which does not reset to false before the next run. This means that you need to manually reset it before running the program again.
    It is oftern useful to operate the VI in execution highlighting mode. You will immediately see that your button does not get read during execution of the FOR loop. Try it!
    LabVIEW Champion . Do more with less code and in less time .

  • How to make a button to stop and run a while loop?

    Hi all,
    I am a beginner in the Labview. I did a program that contains a while loop, its stop condition is connected to button. I selected “switch when pressed” to be the operation of this button. Our teacher asked us to make this button stops the loop if it is pressed and its name is converted to run instead of stop. And if it is pressed then again it starts the loop from the point it stopped in.
    Can anybody help me, please?

    First, please use a smaller font when composing your messages.
    You will need two while loops.  An inner loop which has its stop terminal attached to the stop button.  Put that in the False case of a case structure.  Wire a local variable of that stop button to the case selector of the case structure.  Put the case selector inside another while loop which is the one that keeps the program running no matter what the state of the original Stop button.  You will need a master stop button to stop the outer loop when you are ready to end the whole program.  Don't forget to put small millisecond waits in each of the loops so that the loops don't eat up all the CPU resources.
    For that stop button, you could rename the True title to Run, so that when it is pressed to stop the inner loop, the button will show the word Run.  Pressing it again pops it back out, allows the false case to execute and the innermost while loop to run.
    You could also change the words on the buttons by using property nodes.

  • Acrobat stopped working in Creative Cloud Master collection. How can I get it working or reinstall i

    Acrobat stopped working in Creative Cloud Master collection. How can I get it working or reinstall it?
    Windows 7, 64 bit.

    Hi msickler,
    In order to help you better please provide me more information about the application you are using.
    Which version of Acrobat you are using and what is the exact error message that you are getting also let me know when that message poping up.
    Have you tried to uninstall and reinstall Acrobat. Is it creative could subscription that you have or you have Master collection suite Cs 6.0.
    Regards,
    Ajlan Huda.

  • How Many Parallel Slaves used in past for a module

    11.1.0.7 on RHEL 5.4
    Is there any way to check with how many parallel slaves a module ran in past (3 days prior) ? It was a MERGE statement.
    I am not sure ASH can be of any help or not ?

    Means, you want to get the history of parallel slaves used in last 3 days right ?
    If think you may get little information from this link.
    It will open page No. 471. Just read from page 471 to 473. It will provide some light on your question.
    Regards
    Girish Sharma

  • How to make slave drive

    I am going to take my original 250gb hard drive (Power G5, 2.7) and make it into a second data drive. A new drive will be my OS drive. Do I have to set the original 250gb drive as a slave. How do I do that?

    I answered this in your other post.
    I think you'll do better asking once

  • How do i stop my flash animation from constantly looping even though i added stop code?

    how do i stop my flash animation from constantly looping? I can't seem to find the answer. I put the stop(); code on it's own layer and at the end of the timeline. it still doesn't work when i test it or publish. I'm new to Flash.

    if you're publishing for html5, use:
    this.stop();
    to stop the timeline that contains the code.  if you want to stop other timelines, you must reference them.  eg,
    mc1.stop();
    mc2.stop();
    mc2.mc3.stop();

  • How to code a parallel 'for loop' and 'while loop' where the while loop cannot terminate until the for loop has finished?? (queues also present)

    I've attached a sample VI that I just cannot figure out how to get working the way that I want.  I've labeled the some sections with black-on-yellow text boxes for clarity during the description that follows in the next few sentences.  Here's what I want:
    1) overall -- i'm intend for this to be a subVI that will do data acquisition and write the data to a file.  I want it to use a producer/consumer approach.  The producer construct is the 'parallel for loop' that runs an exact number of times depending on user input (which will come from the mainVI that is not included).  For now I've wired a 1-D array w/ 2 elements as a test case.  During the producer loop, the data is acquired and put into a queue to be delt with in the consumer loop (for now, i just add a random number to the queue).
    2) the consumer construct is the 'parallel while loop'.  It will dequeue elements and write them to a file.  I want this to keep running continuously and parallel until two conditions are met.
          i. the for loop has finished execution
          ii. the queue is empty.
       when the conditions are met, the while loop will exit, close the queue, and the subVI will finish. (and return stuff to mainVI that i can deal with on my own)
    Here's the problems.
    1)  in the "parallel for loop" I have a flat sequence structure.. I haven't had time to incorporate some data dependency into these two sequential sections, but basically, I just care that the "inner while loop" condition is met before the data is collected and queued.  I think I can do this on my own, but if you have suggestions, I'm interested.
    2)  I can easily get the outer for and while loops to run sequentially, but I want them to run in parallel.  My reasoning for this is that that I anticipate the two tasks taking very different amounts of time. .. basically, I want the while loop to just keep polling the queue to get everything out of it (or I suppose I could somehow use notifiers - suggestions welcome)...  the thing is, this loop will probably run faster than the for loop, so just checking to see that the queue is empty will not work... I need to meet the additional condition that nothing else will be placed in the queue - and this condition is met when the for loop is complete. basically, I just can't figure out how to do this.
    3) for now, I've placed a simple stop button in the 'parallel while loop', but I must be missing something fundamental here, because the stop button is totally unresponsive.  i.e. - when I press it, it stays depressed, and nothing happens.
    suggestions are totally welcome!
    thanks,
    -Z
    Attachments:
    daq01v1.vi ‏59 KB

    I'd actually like to add a little more, since I thought about it a bit and I'm still not quite certain I understand the sequence of events...
    altenbach wrote:
    zskillz wrote:
    So i read a bit more about the 'dequeue element' function, and as I understand it, since there is no timeout wired to the dequeue element function, it will wait forever, thus the race condition I suggested above can never happen!
    Yes, you got it!
    As I've thought about it a bit more, there's a few things that surprise me... first, the reason the 'dequeue element while loop' errors is not because there's nothing in the queue, it's becaues the queue has been released and it's trying to access that released queue...   However the problem I have is this --- Even though there's no timeout wired to the dequeue element, I still would think that the while loop that contains it would continue to run at whatever pace it wanted -- and as i said before.. most of the time, it would find that there is nothing to dequeue, but once in a while, something is there.  however, it seems that this loop only runs when something has been enqueued.  the reason I say this is illustrated in the next code sample MODv2 that's attached below.  I've added a stop button to the "queue size while loop" so the program runs until that is pressed.  I've also added a simple conditional in the "dequeue while loop"  that generates a random number if it a button is pressed... but this button is totally non-responsive... which means to me that the "dequeue while loop" isn't actually continuously running, but only when an element is added to the queue.  this still seems almost like the 'dequeue while loop" waits for a notifier from the queue telling it to run.  can you explain this to me? because it is different from what I expect to be happening.
    rasputin wrote:
    I tried to open your VIs but it doesn't work. LV
    is launched, the dialog box (new, open, configure...) opens and then...
    nothing. Not even an error message. I guess it isn't a problem of LV
    version or a dialog box would appear saying this. Could you, please,
    send a image of the code?
    Thanks,
    Hi Rasputin, I'm using LV8.  I assume that was your problem, but who knows.  I've attached a pic of of altenbach's solution since it's what I needed.
    thanks
    -Z
    Message Edited by zskillz on 10-20-2006 11:49 AM
    Attachments:
    daq01v1MODv2.vi ‏63 KB
    daq01v1MODpic.JPG ‏116 KB

Maybe you are looking for