Delay loop before stopping the while loop

Hi all

I modified this code to the example in the forum. I forgot what thread. The file name is "control.vi of loop speed.

I want to measure pressure and compare with the pressure of the target. Once the pressure reading is higher than the pressure of the target, I want the output high for 5 seconds and turn it down.

When he goes back to the bass, I want the to exit the loop, or when I pressed the stop button. I don't know how to do it. Help, please.

Thank you

I can't view your VI (I use LV 2014). Please see my attachment for an example. See what happens when you make the numerical value > = 1. Enable execution of mark if she makes no sense.

Tags: NI Software

Similar Questions

  • How to stop the While loop in the Structure of the event with the same button?

    Hello

    I have a problem. I want to use a single control to activate an event in a structure of the event and the same control to end a while loop in this case.

    It is possible to use 2 controls to do this, but I need to be alone.

    Thank you

    You should NEVER place while loops inside the case of the event, and it is never necessary to do. Think about it: all you have to do is spin the code. You can easily use the outside while loop for everything. Simply place the code of the loop internal (without the inner loop) inside the case of delay and manipulate the time-out period between a pending finished and the infinite (-1), depending on the State of the Boolean value.

    A very simple example (LV 8.0)

  • Force the While loop to exit when the delay is running

    Hello guys,.

    I have a While loop containing some jobs. One of them is delay for 10 seconds. When I push the stop button, the loop does not stop immediately. Instead, it stops after a few seconds (can be, pending other jobs is done).

    What can I do if I want to stop the loop immediately after I press the stop button?

    Thank you for sharing...

    Hello Yoppy,

    I don't know if I understand your problem completely, but here's the method I use to stop the while loop immediately (some ms delay will be there for you).

    I would like to know if the attachment helps.

    There are several ways to do it and you can get better solutions than this one on this community.

  • Stop a while loop in a sub - VI in a message in queue manager

    Hi all

    I am trying to program a control for certain manufacturing equipment. For this I use a message in queue manager. Within the QMH, I have a VI that controls a particle size probe (called a PPC, at the bottom of the first image. When I start the main-vi, the PPC.vi is on the case "Parsum measurement", in which measurement data are repeatedly called in a while loop (screw for call data provided by the manufacturer of the probe. Also, I am aware that I don't connect the data again. That will come later.). When I want to stop the measure, I have send the message "Exit" to the PPC.vi (last photo). However, the vi is stuck in the while loop in the case of the measure and is unresponsive. I tried to send a notifier with a constant value true, but that did not work as well.

    You have any suggestions, how can I stop the while loop before you send the message "Exit"? Or is the completely different way to approach this problem?

    Thank you!

    I just threw together a framework very fast to help you get started.  The thing I noticed is that the library of the queue doesn't have a time-out of the waiting message entry.  Since it is your own local copy (to the project), add a timeout and connect to the element Dequeue function.  I by default set to-1 and make it "recommended".

  • stop the database

    Hello

    on 8.1.7
    during shutdown of the database for maintenance, stop scheduled tasks?

    I don't think this because when the DB stopped he wouldn't have jobs and after DB restart, it will resume jobs.

    Thanks for your advice.
    If we should stop before stopping the DB, what is the best way to stop and restart the jobs?


    Thank you.

    Salvation;

    on 8.1.7
    during shutdown of the database for maintenance, stop scheduled tasks?

    Don't need

    I don't think this because when the DB stopped he wouldn't have jobs and after DB restart, it will resume jobs.

    Fix

    If we should stop before stopping the DB, what is the best way to stop and restart the jobs?

    Just start db and jobs will restart

    Respect of
    HELIOS

  • Control of the event: how to stop the race while loop within a structure of the event

    Hello

    I have some problems with control of a while loop inside a structure of the event (see annex VI).

    I have 3 buttons (the "Start measurement, stop, exit the program"). When a measure is running, it should be possible to stop the measure by clicking on "Stop the measure", but it does not work.

    Someone at - it an idea?

    Thank you very much and best regards,

    Michael

    Hi Michael,

    create a process parallel to your measurement. You can use the design model "producer/consumer with vents. You'll find it with «File-> new...» ».

    Another possibility would be to remove the "lock frontpanel" sign, in the case of event start measurement.

    Mike

  • How to make a loop stop the other in parallel

    I have therefore two loops running in parallel.  When the loop at the bottom is made and stops, I want to stop the upper loop as well.  However, the loop at the top of the page runs in loops of 2 minutes.  I need to run in loops because there is a temperature feedback control, and I need a break to let the temperature change before reading again.

    Now, is it possible that I can interrupt the "expectation" his expectation and finish the while loop?  I tried to look into the structures of the event, but all tutorials just confused me more.

    Also, since we're on the subject, what is the best way to connect the error 'en', 'error' of parallel loops?  I said to use the queues, but I am at a loss as well.  Thanks in advance

    Never mind.  Found a solution:

    http://forums.NI.com/T5/LabVIEW/stop-a-loop-with-wait-timer/m-p/810781

  • How to create a control of time for the while loop?

    Hi all

    I want to control my time running of the loop. In other words, I want to stop everything in the execution of the loop after a time (in ms) that is defined by the user. For example user defines Control Panel for 5 seconds before a while loop runs and stops after 5 seconds.

    I don't know is it possible with the while loop. I managed with the timed loop, but this must be wrong with my application. Y at - it of the other loops for timed control if it is not possible with while loop? There is also a simple loop with .vi random number (0-1) as an attachment.

    Best regards

    Jick

    Hi again,

    I managed to solve my problem right after I posted my first message. I did it with the passage of time and the register shift (for the elapsed time of reset).

    Thanks for your replies anyway!

    Best R

    Jick

  • Stop the loops with a button

    I have an infinite loop is and display of data. How can I end the loop with a button or a keypress?

    Periodically perform a ProcessSystemEvents() call inside the loop. In a reminder of the STOP button, set a flag to indicate your loop to stop.

    stop unsigned int = 0;

    While (! stop) {}

    data getmeasured

    display the data

    ProcessSytemEvents()

    Sleep (250);   to be polite: it is impolite to spinlock, since you will monopolize the CPU and other threads can get hungry

    }

    then, in the reminder for a STOP button

    STOP the button callback routine

    stop = 1;

  • stop a while loop in slot - VI

    Hello

    I have a Subvi, which has a while loop and it is in my main vi in a sequence structure, I want to stop the loop inside the Subvi using a Boolean value in primary vi.

    I tried global variable, but it has not worked since the stop in my main vi botton is not updated when the program is running...

    could you please help me?

    I appreciate any ideas

    Thank you

    Darya

    As a general rule, avoid using Structures of the sequence.  The reason being that they are violating data streams.  If you can control the flow of data with threads, it is the most effective way to make your program work.  The idea to get rid of your sequence structures is therefore to make an another Subvi to your expectation that also has an error and output error.  Then, you can use the cluster of error to force execution.

    And while loops inside the subVIs is a common beginner problem.  If you do not order when the loop ends based on a front panel of the mainVI control, then the loop must be in the main VI.

    I hope it's a good summary of what was said.

  • Code Golf: stop two while loops with guaranteed ratio iteration

    Proposal

    In the vein of the tradition of Perl, I would like to see if there is any interest to solve a few puzzles programming in LabVIEW. Can someone post a problem and define the rules to solve.

    Here's a question for beginning/intermediate to sharpen your "palette".

    Description

    With a user action, how you would stop two while loops such as the relationship between iterations is the still the same? Concrete to view this situation is to take action: both instruments use the same source of synchronization to take measures, but second divides the clock down so that it is a little slower than the first whole factor. For example, if the slower instrument is four times slower, then at the end of the VI, the slower instrument takes 100 measures the fastest instrument took 400.

    Rules

    • You can use vi.lib
    • You cannot include any other subVIs
    • Your solution should pass for loop1 interval as low as 25 ms

    Model (joint in LabVIEW 2009)

     

    If people are interested in this, then we will find a way to improve future problems. Please post your suggestions and criticisms, but only if you also post a presentation ;-)

    MacNorth wrote:

    [..]

    If we choose the first suggestions, the VI has yet to recover the data at different speeds. You can dedicate a loop for each instrument to disassociate a jitter and latency introduced by their connectivity or the inner workings. This adds a margin of safety when there is a conflict of thread and the pilot. You can also implement a simple counting as altenbach loop and renounce the multiloop complexity.
    [..]

    It is a very good point. But I wanted to make sure, you should / need to discuss the benefits, but also the disadvantages of the design. Implementation of an application is most often a process of 'special cases '. If a framework/design for a single application model does not necessarily correspond to another application.

    Designs are always strongly according to the requirements and constraints. What gives here designs will result in educational services, of course, but not necessarily as reference models for specific applications.

    Advantage of simple loop:

    • No synchronization between several loops required
    • Can easily implement any whole factor between services (quotent & function remains for a case structure

    Disadvantage of simple loop:

    • Take advantage of the multi core systems (at least not much)
    • Can easily run out of the time constraints (material not "not responding" enough, fast manipulation of data takes too long,...)
    • Code will accumulate within the structures of the case, where the readability could suff

    The advantage of multiple loops:

    • See essentially the disadvantages of single loop (several loops solve those)

    Disadvantage of multiple loops:

    • More complex, especially for the sync switch (not beginner friendly, requires a more/better design)
    • May contain easily questions source such as race conditions and locks

    A little side note:

    Even if the equipment works different acquisition rate, this does not necessarily that the software must use different rates for data extraction. You can use the same model of an hour, but get X times more values for the task faster than the slower running. The 'only' thing to care of are the sizes of buffers and bottlenecks in the data transfer.

    MacNorth wrote:

    [..] The best advice published OR shutter multiple while loops (https://www.google.com/search?q=labview+stop+multiple+while+loops) are laughable (and the 'solution' in my model). [..]

    No, it's not laughable. For many applications, this approach to shutter at the same time several loops running is OK. The constraint: only for simple parallel running loops.

    More complex loops (producer/consumer and similar) with the more complex data relationship ships require more valiant approaches such as queues, declaring events or user.

    My 5 cents only,

    Norbert

  • Stop the execution of a loop in a structure of the event

    I tried searching the forums to avoid posting a duplicate, but more I couldn't open most of the vi as they were higher.

    I put in a dummy while loop in an event structire I intend to use. Once I have begin to execute the while loop, I am not able to stop using a control for some reason any the fornt panel control.

    I am not able to change the vale of the shutdown command at all. I tried to create a separate event for the STOP, and I still couldn't stop the program when the While loop was running.

    I guess I'm missing something really small. I would appreciate your comments on this.

    Thank you

    Nevil

    Right-click on the structure of the event and choose 'edit events' in the case that gives you bad.

    Make sure that the check box lock the front panel is not checked.

    I suspect that yours is checked, so your front is locked until the end of the event, so you can never stop your loop.

  • Stop a while loop with outdoor table

    Hello

    I have a problem to stop the execution of a vi that uses a while loop and outside a table with two values of time intervals. I would like to stop the VI when the different values of the array are passed. I have attached here the code if you want to help me please, thank you in advance.


  • Stop the timeline, but show a loop of symbol that the timeline is restarted

    Is it possible to stop a schedule but still have a symbol, more precisely a spritesheet symbol, continue to play?

    I'm working on a project that requires the end user to read a narrative text while the described process is illustrated by the graphic animation. The public is multicultural/lingual, if we want to leave as much time reading the text as it is necessary. Our solution for this so far has been to stop the scene with a trigger then have restarted the timeline with a mouse of the user, click. That has worked so far, but now I need to have the illustration animated in the background, while the timeline is stopped waiting for the user to restart the chronology. Is this possible? If this is not the case, how should this problem approaching, as the click of the mouse is part of a symbol used in other animations in a series?

    Thank you

    Ron

    I managed to do work by looping the symbol Sprite sheet on his internal calendar.

    R-

  • goes into infinity "tabs" loop when I type any email 'Contact us' button how can I stop the loop?

    goes into infinity "tabs" loop when I type any email 'Contact us' button how can I stop the loop?

    You use a Mac, or you're on another platform?

    Any other use of platforms:

    • Mac: Firefox > Preferences
    • Linux: Edit > Preferences
    • Windows: Firefox > Options

    Press F10, if the menu bar is hidden under Windows and Linux, or use "> Firefox Options/preferences.

Maybe you are looking for

  • Report all existing browser cookies

    I would like the list/report (in readable format), all witnesses residing on my PC Win XP, including the browser (s) applicable for each. Ideally, I would like to start such an application to report since the CMD Win line and save the results in a fi

  • How to configure a button with alignment fixed points on a logorithmic scale?

    My question is quite simple, but after rooting in the button/gauge proteries, I can't find a way to do what I would like to: I would like a simple button with 4 possible values control: 0.0125,0.125,1.25,12.5 I would like that they also spaced and I

  • When using OE6, I'm not able to open links in an email

    Original title: forum xp - Internet Explorer version: IE7-----When using OE6, I am was able to open links in an email, even if the cliks of mouse on the link and the link address is displayed at the bottom of page. I am able to open attachments.

  • What is compatible 3d d3vice and where I can find

    I bought the games and downloaded from games.com, i get a message "cannot find compatible 3d device.

  • Problem adding iis to XP that's been upgraded to SP3

    Hello I have an old Win XP Pro sp3 machine.  I would like to install IIS on it.  I tried to do this in Control Panel, but I asked myself to provide the cd of Win XP SP3 for the staxmem.dll. However, I do not have a CD of XP SP3, the OS was initially