How to stop while loop from looping

Hi, need a little help in the respect to while loops. Basically i have a while loop within an while loop within another while. So what i want to do is run the program within the outer while loop. The problem is that when i start the program it runs once, which is ok, but its the runs again and again and again. I need it to only run once untill i press the inner while loop bolean to set it going and to stop and to restart, but i can not manage to keep the inner loop from initerating. I just wonder if its a problem with the field point? because i know it works, but using a different example. Any help greatly appreciated.
Thanks Stuart
Attachments:
examplealib.llb ‏199 KB

Use case structures around your middle and inner loops tied to the booleans you want to control the loops. Inside each loop, use a local variable of the boolean tied to the continue terminal of the loop.
You need to use local variables because an input to a loop (wired from outside the loop) is read only on the first loop iteration. Any subsequent change to a control terminal outside of the loop is not seen by the loop.
To create a local variable, on the diagram, right click on the terminal of interest, then select Create >> Local Variable. Then right click on the local variable and select Change to Read.
P.S. You know your stop button is wired to an empty case and doesn't do anything.

Similar Messages

  • How to stop while loop when a specified function is terminated?

    I want to make a program which has 2 thread, one of which is to control some devices, and the other is to measure outputs of the devices.
    To do that, I should make a 2 independent loops, but there comes a problem here.
    I want to terminate 2 loops at the same time, but it's difficult for me to do that, because when I try to notify upper sequence's termination to lower loop by some value change, they have some dependency.
    That's why I need your help. I want to know how to stop lower loop when the upper sequence's termination keeping their independency.
    Please let me know. Thank you.
    Attachments:
    help.JPG ‏200 KB

    Is the upper loop commanding the lower loop at all?  I would think you would have some type of communication between the loops.  Just use that communication to send a stop command.  Or the next best way is to just simply use a notifier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to stop while loop for particular time

                    public void test()
                   new Thread(new Runnable()
                        public void run()
                             //Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                             System.out.println("test");
                             //System.out.println("test ..."+i);
                             try
                                  Thread.sleep(3000);
                             catch (InterruptedException e)
                   }).start();
            public void startTest()
                    while(i < marquee_Str1.length)
                   marLbl1.setValue(marquee_Str1); //set value to textbox for perticular id
                   marLbl2.setValue(marquee_Str2[i]);
                   marLbl3.setValue(marquee_Str3[i]);
                   test(); // call thread function
                   i++;
    in this code while loop don't stop
    plz help me to stop while loop for certain period by using thread or other technique                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Yes.. the original problem would be your test() method put the sleep in an entirely separate thread of execution. So the thread is created then the method just keeps waiting. The while loop should directly call Thread.sleep... which you have apparently figured out!

  • How to stop while loop

    I can't figure out how to stop a while loop in my labview program. 
    When the user presses the Run arrow in the toolbar I want my program to begin reading the serial port for GPS messages.  These messages should be displayed on the front panel.  Currently I have this read/display in a while loop.  The program is also waiting for an extrenal trigger.  When that trigger arrives, I want to grab the current string from the serial port and save it and continue reading and displaying the serial/gps string.  This trigger starts the other parts of the program- signal generation, recording, and saving data which need to run concurrently with the serial/gps reading/displaying.  Once the AO and AI have finished and the data have been written to disk, I want the program to stop.  The serial/gps messages should be updating this whole time.  Only when the data are written to disk should the whole program end.  This whole sequence of events should only be done once when the user preses the Run arrow. 
    So far I'm unable to pluck the serial string when the trigger comes in if I'm watching the serial port all the time.  The program also doesn't stop when it finishes writing to disk because the read serial while loop is still running.  I don't want to use a front panel stop button.  The program should stop itself when the data havebeen written. 
    I'm really stumped on this one but I'm new to LabVIEW so I'm sure there's an easy solution to this. 
    Thanks for any and all help. 
    Attachments:
    SPoleLakeChirp.vi ‏199 KB

    Dennis and altenbach-  Thank you both for your patience. 
    I was trying to do just what Dennis suggested-"As I said, setting a local variable is one way." even before posting to this forum, but I couldn't get my local variables to reflect changes made elsewhere in the program and I wasn't able to wire from them because they were writes.  The critical part I was missing was how to change a local variable from a write to a read.  It was staring me in the face the whole time- just right click.  When I finally found it, my problems were solved. 
    altenbach- thank's for putting the figures together.  I do understand the logic and wiring there, but I was really trying to avoid stop buttons.  The program should be smart enough to figure out when to stop.  And using local variables turns out to be one way of solving this.  I still have some clean up to do, but I've included my current working version just so you can see how I implimented your suggestions.  There's still a lot of clean up to be done, but I'm delighted to be able to watch the serial/gps messages until I'm done reading in data.  At first I had this stop variable set in the final sequence frame.  That didn't work because I wasn't getting to the final frame because the loop wasn't finishing.  Once I placed the stop variable in the same frame as the while loop it began stopping when it should. 
    If you have other comments/critiques about the wiring diagram I'm earger to hear them.  I'm considering the structure finished, however.  It still needs cleaning up and commenting, but I'm satisfied with the functionality. 
    Thanks,
    Peter
    Attachments:
    SPoleLakeChirp.vi ‏210 KB

  • How to stop While Loop in Event Structure with same button?

    Hello,
    I have a problem. I want to use one control to activate an event in a event structure, and the same control to terminate a while loop in that event.
    It is possible to use 2 controls to do this, but I need it to be only one.
    Thank you  
    Message Edited by Heinen on 02-19-2009 06:16 AM
    Message Edited by Heinen on 02-19-2009 06:20 AM
    The Enrichment Center is required to remind you that you will be baked, and then there will be cake.
    Solved!
    Go to Solution.

    Hello,
    I have a bit different problem.
    I have a tab control, with several buttons on different pages.
    In the current situation, we can talk about two pages, where one page ("Settings") in the Image, has a START and EXIT button, while second page ("Wait") has an EXIT button.
    In a while loop, I have event structure, which handles events of the START and EXIT buttons of the Settings page. This is fine. But I also want to control the Exit button of the Wait page.
    The control works like this:
    When I click on Start in the Settings page, the front panel shows Wait page and attempts to connect to a datasocket server on the remote computer. If the user wants to stop this process, he can click on Exit on Wait page too. But, this doesn't give any immediate effect. On the even of Start button, the front panel is not locked, so the user can actually click the Exit button on the next page when it's visible. But it's of no immediate effect. Means, what the LabVIEW does is, finishes the execution of event in Start button's click, and while this executes, it doesn't consider the Exit button's refreshed value (shown in Red circle in the block diagram).
    Simple question: Is there any way to check the updated (latest/live) value of a control during some event's execution? Or if I write an Event "Value Changed" for the Exit button and pass it to some variable. Is it the only solution?
    Thanks ahead.
    Vaibhav
    Attachments:
    terminate event_diagram.jpg ‏200 KB
    terminate event_front_1.jpg ‏63 KB
    terminate event_front_2.jpg ‏63 KB

  • How to stop the Dialog from being dragged

    I was hoping that someone could tell me when calling a Dialog from Jframe, a how to stop the Dialog from being dragged
    while a dialog is showing.
    When it is visible I can still click and drag the Dialog
    I want to set it so you can not drag it until the dialog has be closed.

    If you don't have access to the parent frame, a "hack" that usually works:
    Frame frame = Frame.getFrames()[0];
    if (null != frame && frame instanceof JFrame){
    JFrame jf = (JFrame)frame;
    JDialog jd = new JDialog(jf, "title");
    ... code here ...
    As each JFrame (or Frame) is opened, its stored in the array of Frames that you can get. Same thing with Dialog.getDialogs(). Almost always, at least so far for me I've never had this problem, the [0] index is the main window opened, or the parent/top frame. I'd put the check in there to be safe and make sure its a JFrame and usually you'll only have the one JFrame.

  • How to stop the dock from showing all hidden images when hiding then showing applications

    How to stop the dock from showing all hidden images when hiding then showing applications

    It's not really something to snap a screen shot of. I believe it would need to be a video clip. For instance, when I am working on multiple images in Photoshop, I often need many images open at the same time, but I only have one image viewable and active. The hero image is active on screen while I hide the other images in the dock by hitting the yellow - button on the images. Then I "Hide" Photoshop to do something in the Finder. When I go back to Photoshop, every image that is hidden in the dock will pop open again in the active window, not just the image I was currently working on. I want these images to stay in the dock until I need them, no matter how many times I Hide the Show Photoshop.

  • How to stop PR creation from PM work order for a particular vendor?

    Hello Experts,
    We have following scenario for breakdown maintenance activities.
    When a machine breaks down, a breakdown order is created in SAP. The external manintenance services are planned in the order. When the order is released, a single PR (with multiple item numbers corresponding to number of services) is created by SAP. The PR has a release strategy. When PR is released, PO is created followed by the SES.
    The practice followed AS -IS for breakdown outside business hours:- If the breakdown happens outside business working hours, the person releasing the PRs is not available & hence PR can not be released resulting in no PO & no subsequent SES.
    In this case, the maintenance is completed by the external agency & the work order is TECO. The next day, TECO is reveresed, new PR is created, released, converted into PO, & then SES.
    TO-BE process:- Client expects that, for certain vendors identified, PR should not get created at all from the breakdown order. (The list of  vendors will be maintained seperately). For these vendors, a framework order will be created at the start of fiscal year & SES will be created as & when required agaainst the framework order.
    My concern is :- How to stop PR creation from PM work order for a particular vendor? OR delete the created PR?
    Highly appreciate your quick response.
    Thank you.
    Amit
    Note:- My ABAP consultant has checked following BADI's, but could not find it useful.
    IWO1_ORDER_BADI
    ORDER_COSTING_CK
    DATA_EXTENSION_CK
    VALUATION_CK
    ME_REQ_OI_EXT
    IWO1_PREQ_BADI
    ME_CHECK_SOURCES
    ME_REQ_POSTED
    IWO1_ORDER_BADI

    Dear Amit
    I am giving a different dimension to your question check if it fulfills your requirement -
    As we know Vendor selection comes at a later stage only after your PR creation, approval & RFQ etc. & PR generation from maintaine. order is controllled through control key PM03.  While triggering PR from order you have to specify Material group, Purchase group and vendor. Try to control it through authorisation as all these are authorisation objects. The persons executing breakdown order shall no t be given this authoriations
    shakti

  • How to stop Time Machine from backing up Temp Files?

    Hi folks!
    I am trying to find out how to stop Time Machine from constantly backing up 'useless' temporary files accumulated from web browsing? Although I don't change or add large files to my HD, Time Machine backs up hundreds of MBs every hour. Those file amounts make sense when I consider that I browse a lot to YouTube, SoundCloud, etc to watch videos or listen to music - I just don't want them to be backed up.
    Under Time Machine Options I already excluded the following items from backups:
    ~/Library/Caches
    /Library/Caches
    ~/Downloads
    But even though I did this weeks ago, Time Machine stills finds large files to be backed up every hour and my only guess is that I am still missing a location where either Safari or Firefox - the two web browsers I use - store temporary files.
    Can you help?
    Thanks a lot in advance!

    oas2103 wrote:
    they come from my anti-virus software
    Are you sure you need that? There are no viruses that run on OSX. None. Zip. Zero.
    If you're running Windoze on your Mac, that's the same as running it on a PC, so it needs all the same anti-everything stuff you'd use on a PC.
    There is some "malware," such as Trojans, for Macs, though. But (unlike viruses that can get onto your system without your knowledge), you must approve their installation (via your Admin password) and/or operation (via the "This application was downloaded from the internet ..." prompt).
    Appropriately enough, some of these Trojans are included in pirated versions of Apple software, such as iWork!
    For the gory details, see Thomas Reed's [Mac Virus Guide|http://www.reedcorner.net/thomas/guides/macvirus].
    Thanks a lot again!
    You're quite welcome, and thanks for posting back.

  • How to stop the Browser from caching my web pages

    Hi There
    Can anyone tell how to stop the browser from caching my jsp pages
    I am using
    <%response.setHeader("Cache-Control","no-cache");
    response.setHeader("Pragma","no-cache");
    response.setDateHeader ("Expires", 0);
    %>
    but this does not work anduser is able to go back to the previous page
    which i dont want and i want the browser to display the message the page has expired
    Help appreciated
    Thanks
    Mumtaz

    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    I have cut paste the code from my jsp which is working. There is one additional line. I do not know if that is the cause but there is no harm in trying that out.
    Srinivasan Ranganathan

  • How to stop  the users from changing the Decimal in SAP

    How  to stop  the users from changing User Profile

    Hai,
    It is not possible to restrict SU3 to display, because it has only S_TCODE has the authorization object.
    If you really want to restrict users from changing their profile you have to remove the SU3 access and give SU1 or SU2 which gives access only to Personnel details and Parameters.
    Hope this helps.
    Regards,
    Yoganand.V

  • How to stop the Calendar from editing your input?

    How to stop the Calendar from editing your input?

    I am constantly finding that Calendar Version 8.0 thinks it knows what I want to type but it incorrectly takes numbers and days and times out of my input and changes my appointments. I hate this new supposedly "smart" feature. Even when I edit my event correctly a second or third time it rewrites my input incorrectly again. I have to use my iPhone to override the annoying editing on my mac. I am ready to find a new calendar program unless Apple allows users to input what they want without their information being incorrectly edited.

  • Can anyone please tell me how to stop email previews from appearing on my screen. I have turned off the preview option in settings on both my ipad and iphone, but they still keep appearing.  Thanks

    Can anyone please tell me how to stop email previews from appearing on my screen. I have turned off the preview option in settings on both my ipad and iphone, but they still keep appearing.  Thanks

    works ok on mine - (5, 7.1.1).  Try again.  with previews set to none, mine shows the sender and the subject line only.  (you cannot get rid of the subject)    with the other settings, you get the sender, subject line and however many lines you selected.

  • HT2188 How to stop the battery from draining

    How to stop the battery from draining

    I tried everything to stop my battery from draining on my iPad 2 since I have downloaded IOS 7.... Without success. Very disappointed with IOS 7 so far. Apple please release a patch to stop the battery from draining. It is urgent. My iPad is now useless, it is always drained to 0% everytime I open my iPad!?!?!

  • How to stop volume icon from being displayed randomly

    How to stop volume icon from being displayed randomly

    Thanks for the quick response.
    I have a number of slides which act as a training module. The quiz follows this. All the answers to the quiz are in the module slides. I'd like the user to be able to see which questions they're failing on, but not be shown the answers, as, if they are failing the quiz, the whole module needs to be reviewed and the test retaken.
    If this isn't possible, I'll probably just remove the review option, thereby meaning my retake button can stay, and the user can just go back and re-read the module slides to learn the answers.
    Thanks

Maybe you are looking for

  • Tcode to view the list of orders with reason for rejection

    Hi friends, Can any one tell the T.code or report to view the  list of sales orders or Scheduling agreements with Reason for Rejection updated. Kindly help. Regards, K.Vivek

  • Query in other schema take long time????

    Hi All, I am working on two different schemas in the same database say A and B. In schema A, I have a table tbl which is having approximately 70,000 rows. The table tbl is having an index. When I query on this table tbl in schema A the query out put

  • Quick List of Quick Fixes???

    Does anyone have a resource for quick hardware fixes? My G5 is having problems starting and waking (go figure). It's getting a little worse, and I'm looking for options. Not necessairily the right options, but just things to try. Such as cracking her

  • Rate limit: Police bandwidth

    Hi friends I have some questions: equipment: 7609 IOS: s72033-pk9sv-mz.122-18.SXD7.bin i need create one police with 4200000000, but the police only support 4000000000. Router(config-pmap-c)# police ? <32000-4000000000> Bits per second aggregate Choo

  • Change how paramters are chosen when running crystal on web i

    Hi there.. i have the following problem. when i double click on a crystal report, in our QAS server, i get the following screen to chose parameters. https://fbcdn-sphotos-a.akamaihd.net/hphotos-ak-ash4/385923_10150579230068428_516188427_10979481_1660