How to pause and restart a timed loop in Labview

I am trying to pause and then restart a timed process (series of stepd that happen at precise times), which is implemented using a timed loop.
I was wondering if anybody out there can give me a hint.
Thanks

Roxanne,
Well, it's not exactly a "pause", but here's a way to stop and re-start your Timed Loop.
See the attached example in LV2010.
A While Loop and a Queue are used to allow you to start and re-start the Timed Loop.
The "Stop Timed Structure" vi is used to stop the Timed Loop.
Releasing the Queue stops the While Loop when you end the program.
Note that the example is very similar to the NI template "Producer/Consumer Design Pattern (Events)". (File>>New)
steve
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
Attachments:
timed loop.vi ‏39 KB

Similar Messages

  • How to pause and stop two "for loops" in an event

    Hi
    The main menu runs first and then goes to reading menu. After "Start Reading" button is pressed, the reading process will take readings.
    1) During reading process, if the "Pause Reading" button is pressed, I want that the two "for loops" are stopped and the two "for loop" counters do not reset. After the "Start Reading" button is pressed, the two "for loops" will continue to run.
    2) During reading process, if the "Stop Reading" button is pressed, I want that the two "for loops" are stopped and the two "for loop" counters are reset. After the "Start Reading" button is pressed, the two "for loops" will run again.
    The attached two VIs are simplified my real application. Any help will be appreciated.
    Thanks
    Steve
    Attachments:
    Main Menu Test.vi ‏9 KB
    Reading Menu Test.vi ‏23 KB

    You can't have those loops inside of the event structure.  Currently, when you press the start button, the reading has to finish before the event case finishes.  This will prevent the stop can cancel buttons from being processed by the event structure.
    You need another loop that can recieve commands from the event loop.  Look up the Queued Message Handler.  That should get you a good start on the command process.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Pause and restart while loop after defined time

    Hello,
    What I need is to find a way to run a while loop that is acquiring and analysing a movie, to pause this while loop for a time I specify, and re-run it after that time has passed.
    I'm attaching a picture of the relevant parts of my VI. In the case structure of the "true" or "false", the program is checking, online, if the eye (my camera is focusing on the eye) is open above some threshold and for a certain duration of time. When "condition to start" is met, two things happen: one, the case structure changes to "false" and waits for some time; second, the loop of my state machine is triggered. Problem is, because I'm not really pausing my while loop (it's still running even when it's the "false" case), my state machine runs really slowly - for example, I have a part of video acquisition in my state machine, and saving the frames to avi takes forever. 
    Does anyone have any idea of how I could stop the while loop for x time?
    Thanks in advance!
    Attachments:
    help_pauseWhileLoop.png ‏112 KB

    Hi,
    I'm attaching (hopefully) better pics, if you still can't see let me know and I'll attach the code. About the frame saving and acquistion, I'm already doing that in a separate loop - you can't see my entire code in the pics, but what I have is a state machine that works as a producer loop and then a consumer loop, where video acquisition is happening. Now I'm working on a third loop (the one in the picture), that starts before the others and where I don't even want to save the movies - I just want it to check, online, if the condition is met (e g, the eye is open for a specified time) and if so, start the state machine and stop running, until the state machine has finished running. Then do the same, after waiting a specified time. I know that the problem is that the while loop keeps running after triggering the state machine, because if I remove that part and trigger it manually, the VI runs just fine and really fast. So how can I run, stop and restart the while loop?
    Attachments:
    help_pauseWhileLoop1.png ‏56 KB
    help_pauseWhileLoop2.png ‏32 KB

  • How to get slideshow to Pause and restart with auto play enabled? all slideshow do not restart!

    How to get slideshow to Pause and restart with auto play enabled? Happening in all slideshow do not restart once one photo is selected

    I agree cwclark, I was going to ask the exact same thing, and yes, the only way to 'restart' the auto play is to reload the page which is frustrating to say the least. Every other site I've seen with this kind of 'auto-play' slide show still auto-plays even after clicking the 'next' or 'previous' buttons. Adobe, you need to get a fix for this ASAP

  • Background image vertically distorted -appears ok when paused and restarted

    using 768 x 576 .jpg images as background for a PAL standard idvd:
    - when burned with "PAL"Standard (4:3)" / "professional quality" (movie length is 55 min,)
    - & watching on a laptop/a mac g5 / a windows pc
    the images appeared vertically distorted
    but:
    when pausing and restarting the dvd again the image
    changes to the desired size
    even when i used a quicktime as background movie
    the same problem occurs
    whereas:
    the display on a TV* was fine
    (given that a 4:3 ratio was set for a widescreen tv or using a 4:3 ratio TV)
    when i did not use any image (burning just the movie)
    nothing appeared to be distorted (the movie is not distorted
    neither are the no-images-no-backgrounds-at-all menu screens)
    Is there any specific colour depth or other technical information
    i need to consider to solve this problem?
    ... I noticed that the colour of the image looks significantly different
    on a TV compared to laptop/mac/windows pc
    whereas the movie's colour appears to be quite similar
    on TV/laptop/mac/windows pc ....

    Thank you for trying to help, I really appreciate it.
    It does not matter which option you use. As you know, one would want the background image on each page of a site to be the same size and location to provide a seamless transition from page to page. When using the blank template, the page can have an image put in (using fit, fill, stretch, orig) and be contiguous from page to page. However, when using the Photo template, after clicking on an album image to view larger, the background image unexplicably shifts/distorts downward on the page, and stays that way even upon returning to the album.

  • How to Stop and restart the midtier?

    Hello All,
    I have installed Oracle AS (Infraturcture & middle tier , BI & Forms) on same Linux box.i.e: Oracle As 10.1.2.0.2 (Rel 2, x86 for Linux), SLES 9
    Here is my question:
    How to Stop and restart the midtier?
    Regards,
    DN

    biforms.sh
    export ORACLE_HOME=/opt/oracle/biforms
    export OH=$ORACLE_HOME
    export PATH=$OH/bin:$OH/opmn/bin:/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
    export ORACLE_SID=ORCL
    export LD_LIBRARY_PATH=$OH/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib:/tools/lib
    infra.sh
    export ORACLE_HOME=/opt/oracle/infra  <-- or correct one!
    export OH=$ORACLE_HOME
    export PATH=$OH/bin:$OH/opmn/bin:/bin:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/java/bin
    export ORACLE_SID=ORCL
    export LD_LIBRARY_PATH=$OH/lib:/usr/openwin/lib:/usr/dt/lib:/usr/lib:/tools/libAs you see, only the first row differs from these two scrips. Because I'm lazy, I usualy set export OH. Under certain circumstances you might want to add DISPLAY to biforms.sh. Set it to localhost:0 or whatever is correct.
    Martin

  • How to Stop and restart the OC4J_BI_FORMS?

    I have Oracle AS 10.1.2.0.2 (Rel 2) installed. (Infratsructure & BI & Forms) on same computer.
    my question is :
    How to Stop and restart the OC4J_BI_FORMS?
    Regards,
    DN

    Just as any other OC4J:
    opmnctl stopproc -process-type=OC4J_BI_FORMS
    opmnctl startproc -process-type=OC4J_BI_FORMS
    or
    opmnctl restartproc -process-type=OC4J_BI_FORMS
    cu
    Andreas

  • Itunes contstantly pausing and restarting

    My iPhone 3g is constantly pausing and restarting when used in my car connected to an auxiliary input. I am running a simple wire 3.5mm (headphone port) wire from the iphone to another 3.5mm (headphone port) I have built into my car. For whatever reason when using this setup the itunes app in iphone will constantly freeze not allowing me to listen to music. I've tried replacing the cable which allowed it to work briefly but the problem has started again, any thoughts? Does apple offer a standard cable for something like this?

    Hello j0dy77, limeylove88,
    If the issue is present with multiple systems, then it is likely that there is something going on with the iPhone iteslf. The iPod starting up automatically should not happen unless you quit the iPod function by disconnecting the audio cable previously.
    You may want to try restoring the iPhone and setting it up as a new phone per this article:
    http://support.apple.com/kb/HT1414
    Before you restore the iPhone, you will want to follow these steps to preserve the data on your iPhone:
    Open Preferences from the Edit Menu.
    Select the Devices tab.
    Put a check in the "Disable automatic syncing for iPhones and iPods" box.
    Connect your iPhone and sync (this will create a fresh backup file in iTunes for later).
    Once the sync is complete, follow the restore section of the article.
    At the end of the restore process, you are presented with two options - restore from backup or setup as a new phone - choose the new phone option.
    One of the setup screens gives you a list of options regarding what content you want to sync to the "new" iPhone - sync you contacts, calendars and music (leave Applications out for now to eliminate possible issues caused by third party applications).
    Once the sync is complete, test the iPhone with the stereo(s) and headphones.
    If the issue persist, you will want to arrange for service either by calling tech support 1-800-my-iphone, or by making a reservation at your local Apple Retail Store via this link:
    http://www.apple.com/retail/
    Charles H.

  • Timed loop in LabVIEW DLL does not exit nicely

    Hello!  I have what I think is a simple timed loop in LabVIEW that exits after 100 iterations by throwing an error, and letting the loop "stop on error".  This works fine when run in the regular LabVIEW environment, however, when compiled as a Dynamic Linked Library (DLL) and called from LabWindows it forces me to terminate execution, rather than exiting nicely.  What's more, it seems to quit the actual Virtual Instrument call just fine and proceed to the next line of code, but when my main() function in LabWindows completes there must still be something not cleaned up that is causing it to not exit nicely.  Any ideas?   I've tried adding a call to QuitLabVIEW and that doesn't seem to do it.
    Thanks in advance - hoping you'll point out some really easy mistake. )
    Attached is a picture of the timed loop.
    Below is an excerpt of code from LabWindows:
     int main ()
     CallMyLabVIEWDLL();  //This line successfully launches and closes the window for my LabVIEW virtual instrument
    MessagePopup ("My Title:", "This happens after the call to your LabVIEW DLL");    //This popup shows up - indicating the call to the DLL has completed
    //But after the code has completed LabWindows still says "Running", rather than shutting down.
        return 0;
    Solved!
    Go to Solution.
    Attachments:
    LabVIEWTimedLoopDoesntExit.png ‏103 KB

    Update:  I tried the simplest possible "While" loop and it works.  If I replace it with the simplest possible Timed Loop, it doesn't.  (See attachments.) 
    The only thing I could find in a search for why a time loop would break a dll is a patch for lvalarms from LabVIEW 8.5.1 .... I'm running LV 2010 so I don't believe that's an issue.  Correct me if I'm wrong?
    Thank you!
    Attachments:
    Doesnotwork.png ‏43 KB
    DoesWork.png ‏9 KB

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

  • Pause and restarting a waveform.

    Hi all,
                 Im new to labview and ive only version 6.1 licensed and i cant shift from it for some reasons.
    Yesterday i wrote my first simple  program reading from a tutorial , i created a random waveform plotter.But what i want now is that i need to add a pause and continue or restart button to it.
    Can some addition to the while loop can do the trick??..i tired a lot but cudnt achieve it...Can some body help??
    Im atttaching the VI..
    (Note please:-if somebody puts back a vi saved in LV8 or >6 i cant open it here)
    Thanking You.
    Steve.
    Solved!
    Go to Solution.
    Attachments:
    Random waveform plotter.vi ‏23 KB

    Hello,
    As far as I understood from your post, you need to stop sending data to the chart and then restart doing that.
    You can do it in several ways.
    The first obvious option is to add a case structure to the random generation and the conection to the chart. Conect a button to the case that will define if new values are added to the chart or not.
    This way your while loop will not stop iterating, you just control if you send values to the chart or not.
    If you really want to stop the loop from iterating, you can for example add another while loop in a case structure inside that one, so when you press the button you enter the second while loop and only continue iterating the main loop when you stop the second loop. 
    I don't have LV6.1 installed, so I attached 2 jpg to show you what I mean.
    Keep playing with these stuff, things will become clear with time...
    Hope it helps,
    Paulo 
    Attachments:
    1stOption.JPG ‏18 KB
    2ndOption.JPG ‏21 KB

  • How to pause and start a self playing slideshow

    Hello
    is there a way to pause and then restart a self plaing slide show in keynote 10. when I hit the space bar it moves to the next slide instead of pausing as I need to create a slide show which basically plays in the background but which needs to be stopped occasinally and then manualy advance to the picture before and then start up again
    regards

    You're right, thanks for correcting me.
    Fixing my implementation:
    public class CountingThread extends Thread {
        private JLabel label;
        private int i = 0;
        private volatile boolean stopped = false;
        private volatile boolean resume;
        public CountingThread(JLabel label) {
            this.label = label;
        public void run() {
            while(!stopped) {
                SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        updateLabel();
                try {
                    sleep(1000L);
                } catch (InterruptedException expected) {
                    if( !stopped ) {
                        synchronized(this) {
                            try {
                                while( !resume )
                                    this.wait();
                            } catch( InterruptedException stopping ) {}
        //special methods
        private void updateLabel() {
            label.setText("Number count : " + i++ + " ");
        public void startThread() {
          this.start();
        public void stopThread() {
            stopped = true;
            this.interrupt();
        public void pauseThread() {
            resume = false;
            this.interrupt();
        public void resumeThread() {
            resume = true;
            synchronized(this) {
                this.notify();
    }You should disable buttons accordantly to prevent the user from doing wrong actions.
    Thanks again BigDaddyLoveHandles, if this was my thread I'd give you the duke stars.
    Regards,
    Henrique Abreu

  • Imports seem to be hanging how to stop and restart

    Hi,
    I am workin on transports using transaction code STMS. I submitted the imports many hours ago and it seems that they are hanging or stopped. The Trucks are still in the column status. I do see some objects got imported but some did not.
    How can I fix this and restart the import because the Trucks are tere and I can't restart? Or how do I stop the imports or should I just let it continue? It has been hours now.
    Thanks

    hi Will,
    To change the status of the transport, you can goto STMS -> Import Overview -> select the system -> select your request and after that press Ctrl-F8 (Import Monitor). Under the 'scheduling monitor' you'll see your transport request is in running mode, delete this request.
    After you delete go back to previous screen the list of transport request, click on Refresh, you'll see your request will be in 'green' status again. ready for re-import again.
    Also check the note Note 71353 - Transports hang during background steps which may apply to your condition. Hope this help you.
    Regards,
    Mark
    PS. appreciate your point:)

  • How to skip and restart a failed worker using ADCTRL command line?

    To skip and restart a failed worker, we can start adctrl, use hidden option (7 or 8 depending on the version).
    Is it possible to do the same from command line?
    Thanks in advance.
    S. Sundar

    I am asking about the option to run in non-interactive modeIt cannot be done. Check "Oracle® Applications Maintenance Utilities Release 11i (11.5.10.2)" manual for more details.

  • How to destroy and restart Web Dynpro application by triggering an action?

    I try to implement a screen flow that when user click on "Reset" button, it will restart the application (screen flow) again.
    Said, when the user processed till Screen 3, he/she decide to "Reset" and restart again, all the context in all controllers (view, custom and component) will be destroy (bind() to new element , or clean up), then start from the first screen again.
    I figure out that the best way to do this is to destroy the current application session, and restart a new one . In this case, you don't have to worry about clean up the context , then navigate to the first screen when you click "Reset button".
    I am thinking is it a good idea by trigger the exitPlug() then navigate to the URL of the same WD application again?
    Please advise.
    Thanks a lot.
    Kent

    Hi Kent,
    I have tried the method of creating the exit plug from the interface view of the controller, and then returning to the same URL of the application.
    It works fine and all the contexts, their values and controller contexts are cleared.
    For my application it is working great....
    Regards,
    Alka

Maybe you are looking for

  • Issue with multiple crypto isakmp policies

    Hey folks, I'm having an issue setting up multiple crypto isakmp policies on my 1921 router. Whenever I have only one crypto isakmp policy set up like so: crypto isakmp policy 1  encr aes 256  group 5 It works perfectly fine with my certificate tunne

  • Anybody connecting older firewire scanners to the newer iMac

    I have a Nikon Coolscan 4000 that uses a firewire A output. Since my iMac (late 2012) only has Thundebolt and usb connections, I can't hook up directly. Nikon doesn't support adapter, A firewire to thunderbolt adaptor does not work as the scanner is

  • ESS portal: Hide additional info field in release working time screen

    Hi, I need to know how can i hide 'additional info' field in the release working time screen? I know i would use personalization but don't know the way to do that.

  • Mail Signature Issue

    I seem to have a bit of problem with my email signature. I have a IMAP account setup for my job and a signature created. When I send emails out to all my colleagues who sadly use windows my signature can only be viewed as an attachment and not at the

  • One more score question

    Ok this makes absolutely no sense... In a 6/8 measure, with the score's quantize to 16.. If I draw a note with the length of two sixteenths, it shows up as ONE sixteenth............ Then if I change the score's quantize to 32, then suddenly it shows