How to stop and start a for loop

I've got code and a for loop running in a while loop.  What I need to do is simply pause the operation of the for loop until an requirement is met, and but maintain its iteration position throughout each pause interval (not necessarily timed, just paused until the next requirement is met).  I've tried wiring a boolean to the "continue if true" terminal of the for loop, but the iteration count restarts to 0 when the loop is started again.  Is there a way to stop the for loop, and continue at the particular iteration it is at?
Solved!
Go to Solution.

Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
 Yes, both the inner and outer loops would have shift registers.
Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

Similar Messages

  • 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 stop and start process SAPOSCOL

    Hi, i have a problem with write access for saposcol program. I see that the file saposcol is read the file but its unable to wirte the same.
    Collector           : running
    Start time coll.    : Mon May 21 17:49:49 2007
    Current Time        : Mon Jun 11 13:27:51 2007
    Last write access   : Tue May 29 06:23:46 2007
    Last Read  Access   : Mon Jun 11 13:26:24 2007
    When i try to stop the saposcol i get the following error:
    igzadm> saposcol -k
    Setting Stop Flag :
    13:24:44 11.06.2007   LOG: ==== Stop Flag was set by saposcol (kill_collector()).
    13:24:44 11.06.2007   LOG: ====  The collection process will stop as soon as possible
    can't kill process 409656.
    kill: No such process
    ERROR:No reaction from collecting process 409656.
          Please kill collecting process.exes.
    Am doing this command through SID<ADM> from change directory /run.
    Please help me how to check the permission of the SIDADM to stop the services.
    I also try the same from root user but now use..
    Please guide me how to stop and start the SAPOSCOL in AIX 5.3.
    Advance Thanks.
    Suri Tyson

    Hi, i have the following permission for saposcol
    imserv:/ # ps -ef | grep saposcol | more
        root  118842  528422   0 14:02:17  pts/2  0:00 grep saposcol
    I have changed the ownership as you mentioned....
    imserv:/usr/sap/IGZ/SYS/exe/run # ./saproot.sh igz
    Preparing /usr/sap/IGZ/SYS/exe/run/brbackup ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brarchive ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brconnect ...
    Preparing /usr/sap/IGZ/SYS/exe/run/brtools ...
    Preparing saposcol ...
    Preparing icmbnd ...
    done
    However, i still get the error as:
    igzadm> saposcol -k
    Setting Stop Flag :
    14:12:13 11.06.2007   LOG: ==== Stop Flag was set by saposcol (kill_collector()).
    14:12:13 11.06.2007   LOG: ====  The collection process will stop as soon as possible
    can't kill process 409656.
    kill: No such process
    ERROR:No reaction from collecting process 409656.
          Please kill collecting process.
    Now the permission are set in my system as:
    igzadm> ps -ef |grep saposcol|more
      igzadm  729196  983058   0 14:13:25  pts/2  0:00 grep saposcol

  • How to stop and start RAC Database

    Hi,
    Can anybody tell me How to stop and start RAC Database.
    Pls give me the exact procedure for OS - IBM Aix 5.3.
    Rajkumar

    Burleson,
    It so appears, as from the numerous times you have been published incorrect, untested information, and non-working scripts, you are not an Oracle guru,
    but only a self-proclaimed one.
    It also appears nothing on your 'CV' can be easily verified.
    You state you are an 'adjunct professor emeritus', however anyone who was kicked out after a few months can call himself a 'professor emeritus'.
    Looking at the enormous amount insults and slander you have posted directed to me and others on this forum, showing a highly unprofessional attitude toward your peers,violating this forums rules of conduct, don't you think you deserved to be banned completely?
    After all, you are always promoting your own publications here, which is also in violation of the rules for this forum.
    What makes you think that "Sybrand" is a man's name? How many male Sybrand's do you know? I don't know any, not one.
    That's your problem. I'm as much as male, as you are a fat, ugly, self-proclaimed Oracle-guru, which you are clearly not, you are only a fraud, and this glares from all of your publications.,
    Sybrand Bakker
    Senior Oracle DBA

  • How to Stop and Start Scheduler Service

    Does anyone know how to stop and start the Scheduler service for Hyperion Financial Reporting in release 9.3.1?

    please see the metalink note
    How to Start/Stop MWA Services Using Control Scripts adstrtal.sh/adstpall.sh? [ID 731320.1]
    This is how i startup and shutdown WMA
    for stopping :
    1) login to Applications tier
    2) To see if the MWA (telnet) server is running use:
    ps -ef|grep DPID
    3) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx stop_force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa
    for starting
    1) login to Applications tier
    2) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx start _force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa

  • How to stop and start WMA in 11i system

    how to stop and start MWA in 11i system, its Linux server.

    please see the metalink note
    How to Start/Stop MWA Services Using Control Scripts adstrtal.sh/adstpall.sh? [ID 731320.1]
    This is how i startup and shutdown WMA
    for stopping :
    1) login to Applications tier
    2) To see if the MWA (telnet) server is running use:
    ps -ef|grep DPID
    3) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx stop_force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa
    for starting
    1) login to Applications tier
    2) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx start _force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa

  • How to stop and Start ASM in 11gR2

    Hi,
    Any one please let me know the complete process of how to stop and start the ASM instance in
    11.2.0.1 oracle.
    Thanks.
    Ali

    Hi;
    If you need to close ASM than you need to also close database
    You need to close db:
    srvctl stop database -d instance_name
    or
    set ORACLE_HOME and ORACLE_SID
    sqlplus "/as sysdba"
    shutdown immediate;
    srvctl stop LISTENER
    srvctl stop ASM -f
    or see:
    Stop asm instance in standalone database
    Re: Stop asm instance in standalone database
    Regard
    Helios

  • How to STOP and START the BO EXPLORER/POLESTAR - LINUX

    Dear friends,
    Could you please let me know on How to STOP and START the BO EXPLORER/POLESTAR on LINUX platform?
    Thank you,
    Nikee

    Oracle Apex is an API, if that helps you understand / visualize. You do not start Apex process nor stop it.
    When an Apex session starts it starts calling the API.
    You can however start / stop the listener. It may be OHS, ApexListener and the J2EE container running it, OC4J or any other "server" that you are using.
    The built-in EPG is something like an API again, you cannot start / stop it but you can disable/enable it with DBMS_XDB.SETHTTPPORT API.
    Regards,

  • How to stop and start IGS(internet graphic server)

    Hi Techies
    How to stop and start IGS(internet graphic server) in Solaries
    IGS is 7.0 1patch
    Is this the command to stop and start IGS
    stopigs and startigs
    If this correct will there be any issues if i stop the IGS from the above command
    Thank You
    Haroon

    Hoi Haroon
    On base 6.40 there were stopigs/startigs scripts, yes. When we upgraded our systems to 7.0 I encountered the same problem, the igs could be stopped, but not started anymore (externally). Can you check, if the startigs/stopigs-scripts are 7.0 or 6.40.
    I then opened an oss and got as answer:
    "To start and to stop the igs there's only the offical way by stopping and starting the sap system".
    However I found a solution to start and stop:
    start:
    nohup /sapmnt/<SID>/exe/igswd_mt -mode=profile pf=/usr/sap/<SID>/SYS/profile/<Instaneprofile> &
    e.g.:
    nohup /sapmnt/P72/exe/igswd_mt -mode=profile pf=/usr/sap/P72/SYS/profile/P72_DVEBMGS01_migzmc10 &
    stop:
    --> stopigs, therefore the 6.40-stopigs script has to remain in the exe directory.
    Hope this helps.
    Regards Patrick

  • How to stop and start MDBs to listen for JMS messages

    Hello! This might be more of an architecture question rather than a technical questing, but I post it here, in the lack of a better place...
    For several years I have been using Webster and Webster MQ to send messages back and forth to clients. The architecture for the middleware platform has been designed around the functionality of ListenerPorts. Listenerports is a Webster functionality that let you "stop" and start to listen to JMS messages for a given MDB either by admin console, or by JMX.
    The arhitecture we used was something like this :
    1.Client sends a persistent message to a queue. (order)
    2. An MDB pics up the order message, calls a SessionBean that "fronts" the IIOP back end system.
    This is quite "out of the box" architecture, but we used the Listenerports to solve a stability problem for our back end system.
    The backEnd system was quite unstable, so the EJB threw an exception (typically because of timeout or connection refused) back to the MDB.
    The Listenerport was "defined" to handle 3 errors before stopping, so the MDB resent the message twice before the listenerport automatically stopped. The nice thing about this feature was that the client could continue to send orders, and was not bothered when the back end system was down.
    When the backEnd system was up and running, we could start the listenerport and it was all back to normal state. We even had a start script that checked the state of the listenerport every 30 minute, and started it automatically if it was stopped, making the admin task of starting the MDB unnecessary..
    Now.. Why am I telling this story..
    I would like to know how this could be done using "clean" J2EE technologies..That is..Not using any technology that is not portable..
    I`m playing with glassfish at home, and it struck me that there is nothing in the J2EE spec that defines the functionality described above ? Am i missing something ?
    I Do not want to stop My application because the back end system is down? That is the only way (i know of) that i can "stop" to listen for messages..
    I can put all the messages on an error queue when the backbend system is down, but that would lead to more code just to handle the error messages. Maybe the easiest way to solve this is to "move" (programmatically) all messages from the error queue over to the "standard" queue every XX minute, but somehow that sounds "wrong"
    Can anyone give me some advice to how this problem situation should be solved ? I`m interested in the solution both from an architectural perspective and from a more technical perspective..
    Best regards
    Hans-Jacob Melby

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • How to stop and start (restart) portal services programmatically?

    Hi experts,
    I develop a portal service IMaintenanceService extending IService.
    The new service has some profile properties (start date, end end, etc.).
    I wrote another portal application MaintenanceManager which can change these profile properties.
    However, to activate the changes I have to restart the portal service.
    Does anyone know how I can restart the portal service IMaintenanceService from my portal application MaintenanceManager?
    Thanks for help.
    Edited by: Daniel Fötsch on Nov 21, 2011 8:24 AM

    please see the metalink note
    How to Start/Stop MWA Services Using Control Scripts adstrtal.sh/adstpall.sh? [ID 731320.1]
    This is how i startup and shutdown WMA
    for stopping :
    1) login to Applications tier
    2) To see if the MWA (telnet) server is running use:
    ps -ef|grep DPID
    3) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx stop_force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa
    for starting
    1) login to Applications tier
    2) cd $MWA_TOP/bin
    3) ./mwactl.sh -login sysadmin/xxxxx start _force 10200;
    4) check the wma process from OS level
    ps -ef|grep mwa

  • How to stop and start only the process of Oracle Application Express?

    I'd like to know how to stop the process of Oracle Application Express on my server installed oracle express package.
    After installed Oracle Express edition, not only oracle database server processes but also Oracle Application Express, such as http server, is started automatically...
    I hope to stop and start Application Express on demand but is this feature enabled?

    Oracle Apex is an API, if that helps you understand / visualize. You do not start Apex process nor stop it.
    When an Apex session starts it starts calling the API.
    You can however start / stop the listener. It may be OHS, ApexListener and the J2EE container running it, OC4J or any other "server" that you are using.
    The built-in EPG is something like an API again, you cannot start / stop it but you can disable/enable it with DBMS_XDB.SETHTTPPORT API.
    Regards,

  • How to stop and start a wipe effect at a specific place?

    I assume I use the xFrom, yFrom, xTo, and yTo properties. But
    I'm not
    sure I understand how to use them to stop a wipe left effect
    at 20% the
    width of the container and start the subsequent wipe right
    effect at the
    same 20% position.

    Breakpoints, whether normal or conditional, are just meant for debugging of your code.  I had the sense from your question that the pausing you want to do is a part of normal operation of your code.  I would NOT recommend using a breakpoint for that situation.  It would bring up the block diagram showing the breakpoint when it occurs.  A user besides the programmer would not know what to do in that case.
     Yes, both the inner and outer loops would have shift registers.
    Putting a case structure with a small while loop inside the "Pausing Case" is doable.  It just depends on what you are doing or waiting for while the program operation is "paused".

  • Stopping and Continuing a For Loop

    I have a problem on looping. This is a game of Whack the Mole. First, there is a for loop that is in charge of generating different hole positions for my moles. I want it so that the loop will (1) Generate a number (2) Stop the generating (3) Based on the number that was just generated, run a function for it. Once done running the function, then (4)Start the second round of generating another number......and it goes on for 9 rounds. I have my code here.
    var molePosX:Array = [166.90, 494.8, 810.7];
    var molePosY:Array = [282.55, 512.45, 730.35];
    var moleInUse:Boolean = false;
    if (moleInUse == false){
    for(var i:uint = 1; i<10; i++){
              var randomHole:Number = Math.floor(Math.random()*10)+1; //Generate 10 number
              trace(randomHole);
              switch (randomHole){
              case 1: trace("1");
              moleRun(molePosX[0],molePosY[0]);
              break;
              case 2: trace("2");
              moleRun(molePosX[1],molePosY[0]);
              break;
              case 3: trace("3");
              moleRun(molePosX[2],molePosY[0]);
              break;
              case 4: trace("4");
              moleRun(molePosX[0],molePosY[1]);
              break;
              case 5: trace("5");
              moleRun(molePosX[1],molePosY[1]);
              break;
              case 6: trace("6");
              moleRun(molePosX[2],molePosY[1]);
              break;
              case 7: trace("7");
              moleRun(molePosX[0],molePosY[2]);
              break;
              case 8: trace("8");
              moleRun(molePosX[1],molePosY[2]);
              break;
              case 9: trace("9");
              moleRun(molePosX[2],molePosY[2]);
              break;
              case 10: trace("10");
              break;
              function moleRun(xPos:Number,yPos:Number){
                        moleInUse = true;
                        var mole2:Mole = new Mole();
                        mole2.x = xPos;
                        mole2.y = yPos;
                        addChild(mole2);
                        moleInUse = false;
    Thank you very much!

    i'm not sure you want to do that without staggering your mole creation but if you do, you can use:
    var molePosX:Array = [166.90, 494.8, 810.7];
    var molePosY:Array = [282.55, 512.45, 730.35];
    createMoleF(9);
    function createMoleF(n:int):void{
    for(var i:uint = 0; i<n; i++){
              moleRun(Math.floor(Math.random()*molePosX.length),Math.floor(Math.random()*molePosY));
              function moleRun(xPos:Number,yPos:Number){
                        var mole2:Mole = new Mole();
                        mole2.x = xPos;
                        mole2.y = yPos;
                        addChild(mole2);
    Thank you very much!

  • How to stop and start Managed Server using weblogicServer

    Hi
    We are new.
    We have 2 managed servers and an Admin Server.
    We're trying to use the command line to stop/start our Managed Server.
    Could someone share examples on how one could write the command line that's similar to the WLS console Server Start tab ?
    We have a couple of classpaths and a bunch a arguments;
    When we tried to start one of the managed server it defaults to use some other settings as opposed to the ones in Server Start tab.
    What did we do wrong ?
    Thanks

    Hi,
    Follow the below links,each n every links have various methods and example for starting and stopping of Weblogic services
    We have 2 managed servers and an Admin Server.
    We're trying to use the command line to stop/start our Managed Server.http://docs.oracle.com/cd/E15523_01/core.1111/e10105/start.htm#CIHBIGCD
    We have a couple of classpaths and a bunch a arguments;http://docs.oracle.com/cd/E13222_01/wls/docs90/admin_ref/weblogicServer.html#frequently_used_optional_arguments
    http://docs.oracle.com/cd/E13222_01/wls/docs90/admin_ref/weblogicServer.html#1008628
    Regards
    Fabian

Maybe you are looking for

  • Calling a report from form using web.show_document

    Hi, Used the method as below, But , error reprot not found, Could anybody tell me how to get the server name from ny local machine as in the example servername ' Repsrv ' /* WHEN-BUTTON-PRESSED */ DECLARE vc_url varchar2(100); BEGIN vc_url:='http://<

  • Problems with trial PS CS6 questions

    In the trial version of PS CS6 I am getting errors when I select some tools or some effects. The program wants to shut down. What's happening and can it be fixed?

  • Issues with importation

    Hello, When I import my photo from my Scan disk to bridge, all the settings I had done when I took my photo are gone. For instance, I took a picture in B/W with a blue filter. In Bridge, my photo is not in B/W but in color- That mean I have to post p

  • IMovie degrades quality

    I'm new to iMovie 9.0.4 and have a Olympus camera that shoots1080i video.  iMovie 9.0.4 seems to only allow me to import and export at 720p and the quality is much worse than the original.  So bad I would not ever consider making a movie and posting

  • In ovi software where the contacts file saved

    Recently i updated my xp to windows 7  un expectedly i forget to take a back up  as i sync msgs to ovi and deleting from my mobile now the problem is i have the old nokia ovi suit in xp but it is not working but all the installed files are still in o