STOP button for program waiting in a state machine

Hello

I am trying to create a state machine in order to control a conveyor, mixer pump and linear actuator. Each component runs in sequential order all the time, so I thought that using a state machine would probably be the best architecture program.

The problem that I am facing, it's that there are States that require more time before the start of the next State. For example, I need to be able to run the pump or mixer for an another period of time. I understand that simply using the VI of waiting is not a good idea because it removes the option to stop the program on the chance that something goes wrong (at least until the end waiting for execution function). I tried to use clock calendar in order to force the program to wait for a term between States, but I found myself with all nested in loops for each State that require stop buttons separate who ends up doing the complicated program (this is what we see in the attached VI).

I looked at other threads mentioned using notifiers or the structures of the event, but since I use a state machine, I don't know how to use them with several States.

If there is a way to force synchronization between States while maintaining control of stop button and, eventually, the ability to run any code while you wait, please let me know. I have attached the VI I train, and the emphasis is on the 'wait to hatch open' State.

Thank you.

That your state machine shift register is a cluster.  First point is an enum for say the next State to go to.  Second element is a digital that defines how long to wait if the next State is a wait.  Third point is an another enum as first to tell what State to go after the wait ends.

Start of the loop of State machine, ungroup the first point to know what State to go to.  In your state of waiting, when you have determined the wait is made, ungroup the 3rd point.  Set the first element of the cluster machine of the State to be this enum even if he goes on the next State.  Basically leave wire to move the machine of State wear with it another State of the State, not only the next State, but also what would be the next state when the next State is completed (in case there are several choice.)

Tags: NI Software

Similar Questions

  • My stop button for Windows 7 has always a shield orange with one! indicating that an upgrade is required, but it is never done. Why?

    My stop button for Windows 7 has always a shield orange with one! indicating that an upgrade is required, but it is never done.  Why?

    Check for an update that fails in Windows Update-> View Update History - maybe tring to install and fail to each start cycle. If so, please post the details of the update (including KB only, & error codes). Error codes can be found in law clciking on the update failed and select details.

    All the answers and suggestions are provided by an enthusiastic amateur and are therefore no explicit or implicit guarantee. Basically, you use my suggestions at your own risk.

  • Impossible to click on the buttons for the timed loop.

    Hello!

    I have a loop that is timed with a pace set by the user. And when the loop is running, I can't push any button of my GUI to stop it...

    I have to wait until a mistake or I stop the race.

    I can't put the diagram is too big and I think I don't have the right, but you have ideas?

    Ask me for more details.

    Thank you

    bejard wrote: timed loop is just in a structure of the event and I put 10 ms or 100ms.

    The program runs correctly (with this loop delay of 10ms/100 ms) like in the beginning, but I can't push any button or even change the tabs during the loop.

    You shouldn't have long extensions inside the event.  Which is supposed to stop your timed loop?

    I think that you have the option "Lock the front until the end of the occurrence" lit.  It will not press anything, until the end of everything for this case (including the timed loop).

    According to my experience, using a loop timed in a Windows system is a complete waste and often adds more overhead and questions.  Instead, I really think you need to use a State Machine.  When the button is pressed, you tell your state machine to move to the State the code inside your timed loop tracks.  You can use the State with the structure of the event to time your loop.  If you can go behind your state of event to your processing loop structure.  Just set the timeout on the structure of the event at any rate of loop you really want to.

  • Closure of a state machine in queue event with several parallel loops

    I am trying to find the best way to stop a program that consists of an architecture of State machine in line waiting for event with several parallel loops. Can anyone recommend the best way to achieve this in my attached VI? (To browse the forum, this seems to be a frequently asked question, but I have not found a solution that works for me.)

    I look forward to any comments on my as well code, if someone is willing to offer it.

    My program needs:

    If the user press the 'Stop' button, the program should prompt the user with "are you sure you want to stop the program?" and then return to a State of rest or move forward to stop the program. In addition if there is an error, the program should prompt the user to ' clear the error and continue, or stop the program. Then back to the idle state or move forward to stop the program.

    Architectural details:

    The program consists of 3 parallel loops: (1) a loop of event management that places different States of a queue of the State, (2) a State Machine that enters the State that is removed from the queue of the State and (3) a loop error/Shutdown, which deals with errors in the error queue management.

    During normal shutdown, where running handling loop in the case of event 'Program.Shutdown' and 'Shutdown' and the 'Idle' States are added to the queue of the State. In the state machine, the State of 'Stop' is invoked. Special "5000" error code is added to the queue of the error. In the loop of error handling and stopping, "5000" error triggered a prompt that asks the user if they want to stop the program. If the user chooses not to stop, a notifier StopNotif is sent to the State of 'Stop' and 'Program.Shutdown' event case with notification 'Go '. If the user decides to stop, the Notifier sends the notification "Stop". Loop and event management State Machine ends when they receive the notification "Stop".

    In case of error, the program behaves in the same way: If the user chooses to clear the error and continue, the program returns to the status "pending".

    HOWEVER - if the user chooses to stop the program, the program crashes. The author of the notification that is sent to stop the loop of events and State Machine management cannot be read because event Program.Shutdown and the stop State (which contain the function "Waiting to notify") are not active.

    I was able to activate the stop State by Queuing in the loop of error/Shutdown management. But I don't know how to activate the "Program.Shutdown" event by program and thus access the function "Waiting to notify" inside.

    I tried to put the function "Waiting to notify" outside the structure of the event, so the event-handling loop never ends. Placing timeouts on the "wait for declaring" and the structure of the event makes the programme of work, but I want to avoid using timeouts because I don't want to turn my event program into a program of polling stations. I would also avoid using variables or nodes property to stop loops, because that requires the creation of a control/indicator for something that the user does not need to interact with.

    Thank you!

    First of all, close the notifier outside loops with your queues.  Second, you must use a user event to send the message to the event structure loop so that it stop in the case of the stop on an error.

  • While loop, wait for the function and the stop button!

    Hello

    I have a while loop and a stop button. Inside my While loop - I have a 'Wait (x ms)' function. If I press the stop button, it does not block the program immediately, he expects ms x then stops the program. How can I get rid of this?

    Thanks in advance for the help!


  • Programming of a conditional FOR the timing of the STOP button on the loops

    I have a conditional FOR loop with a STOP button, however, the nature of LabVIEW data flow, the stop button is now being questioned at some point before the end of the loop. A control not having no entry, I can't connect to the last operation of a single iteration of the loop to trigger the vote on the STOP command, and I prefer not to use a flat sequence just for the power button if I can avoid it. I've considered using a structure of the event, but I don't want to force the loop to wait that the stop button to be pressed, I want just the loop to EXIT, * IF * the stop button is pressed... but I want the stop button to be questioned at the end of the loop, so if the user presses the button stop at any time in the loop , at the end of the iteration, the loop will end... that makes sense? At present, given that the stop button is called once at some arbitrary during the iteration of the loop time, if the user presses the stop button after he is questioned, the loop must run an extra iteration, and I don't want that to happen.

    ... in any case, I guess I'm looking for a more elegant way to implement that having to use a flat sequence just for the stop button.

    Sorry, but you'll have to use a sequence structure.  This is why they are there.  Sometimes they have their purposes.  Here is how I would handle it.

  • Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Hi, actually I want the program stops when you press the stop button. but the problem is the program is runing in loop only he doesn't return tile view deleted complete execution of any body can help me for this.

    Here

  • Need help to stop stop button on my machine of the State system

    Hello

    Can someone help me understand please why my STOP can't stop the state machine, I want to stop the program, that the program is running... and it's sad to say, on my side, that, when I pressed the stop button it won't stop until the loop ends. and what I really want to stop it even the loop runs. I have attached here for your reference my vi...

    Thank you and best regards,

    syrpimp


  • stop a loop without waiting for its next iteration

    I wonder if there is a good way, or still anyway to stop a while loop without waiting for its next iteration. Lets say you have a timer in the loop so he iterates once evey 10 seconds, and then you have to wait 10 seconds for him to stop after you press a stop button that could be a problem.

    Thank you!


  • Stop button does not reset after each program start

    Newbie here, so when I start the program with the arrow of departure or, my Start button is always in the right position, but the stop button is not. How do reset you the default user as the stop button control.

    Lol it doesn't have the same effect.  They are completely different actions.  If they were the same, then NEITHER would never have created the other.  I've never seen a practical use for 'Up to this that freed'.  Read the help files on the mechanical actions to see the difference.  There is a real difference, delicate and subtle.  But there is a difference.

    If you clean the Boolean logic and put the start in case structure button.  It works very well.  See attachment.

  • State machine - waiting for user input before going to the next State

    Hello

    I based on the example of standard state machine and would like some advice on how I can prevent labview in the next state until a user clicks a button.

    for example, the current state is 1, it runs through its code and its about to happen at the end, therefore, enter the following State, based on the defined constant "then of States." There are only two choices on how the machine should proceed, rto status to State 5 or 4 bedroom.  However, if I used a "select" function where other State is determined by the Boolean value of a switch, how to set up my code that labview is not just assumne the current switch (probably a 'low' is the value of boolena to use.

    IM is probably not very clear, but hope that you understand my problem.

    Thanks in advance

    Hi, rivers,

    Simply add a case to handle the 2 buttons until the case of the action is over. You can use a ' wait on the UI"function if you do not want to interrogate the buttons. You may experience problems if you use the event structure to implement this. If you use more structure and then 1 event in your code, you can get a problem with UI suspended indefinitely. This happens if a key is managed by a structure of the event in another part of the loop. Locks user interface until he is executed, but it cannot be run because it is in another case. You must use only 1 structure of the event to handle all of your entries, but if you do that, then, you will have the problem to allow only certain buttons at certain points. For example, you want to only 2 & 3 active after action 1 action buttons and the buttons that are used to go to other disabled at this stage steps. It will be messy. Better just to add an extra case after every case of action that deals with the interaction of the user for the next case. In the example that I joined, I placed action buttons in a cluster that is passed to all cases allowing you to get the keys you need when you need it. You could of course just to put the buttons in cases where necessary, but I prefer the first method.

    RGS,

    Lucither.

  • Error: "Waiting for programs fill" while trying to add or remove programs

    Original title: cannot complete programs

    When I open Add / Remove programs in the Control Panel, the statement "waiting for programs fill" came and I waited and waited, nothing else has happened then - this hanging window. I tried the DIFFICULTY inside of MS DIFFICULTY, it did not help. Help, please.

    Hi magjoseki,
     
    Follow the steps in the section "Let fix me it myself" article and check if it helps.
     

    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base: 

    How to back up and restore the registry in Windows

  • Why the uninstalller in programs continues to show "wait for program to uninstall?

    My youger grandson has been download game apps & material on 'programmes', I went to uninstall some of the unnecessary programs, but... after uninstall & going to uninstall another - can't remember the name of program exact-it has not "Uninstall" apparently. I get it - when I go in uninstall another program: "Please wait for the program being uninstalled or changed."

    How do you stop/prevent the program "current" freeze WARNING/finish to uninstall others?

    thanx

    Hi Edward,.

    There seems to be a problem with the installation of programs.

    Run the Fixit and see if it helps.

    http://support.Microsoft.com/mats/program_install_and_uninstall/

    Good day!

  • Lost the STOP button with upgrade for FF9

    I can not get the STOP button on the Navigation toolbar since I upgraded to FF9. Where at - it go?

    He was a combined button by default at the end of the bar of address for awhile now.

    Loading a page it's a stop button, because that's when you can stop it, and once it is loaded it becomes a button reload, because you can then reload the page.

    It can be customized by dragging the end of the address bar and to reverse the order buttons, you then get to see two separate buttons:

  • the stop button does not respond when I needed to stop a program

    I want my labview program to stop when I press the stop button, but this isn't the case... stop button does not work... I have used a loop in which there is event structure n structures case... I have attached my file... so please help me...

    Hello

    In your code, this can be done by using the new event on "Stop" button when press it it will give a true

    Like this

Maybe you are looking for