Emergency stop during Wait

Hi.
I have a process that runs through several stages in sequence. Each stage needs to wait for ~ 5 minutes before starting the next stage. There isn't really any "logic" involved; it just moves from one to the next until the end. However, I want to implement an Emergency Stop that will exit the current stage and perform some shutdown procesures. I am using a state machine inside a while loop to handle each step but I can't figure out how to exit immediately. When I press the "Stop" button, it continues through the current step, then next step and finally exits two steps later.
Here is a dummy example of my structure:
Any suggestions?
thanks,
jason
Attachments:
state_machine_interupt_example.vi ‏22 KB

If you are frequently adding features to your program, you definitely need to investigate the various flavors of state machines and producer/consumer architectures.  The two are not mutually exclusive.  In fact they work well together.  Key advantages are robust performance and ease of modification.  There are examples which ship with LV and many, many postings on the Forums about these topics.
For multiple independent timing I like to use a Timeout value for each task which needs timing.  When the task starts, read the current tick count and add the timeout delay (or wait) value in milliseconds, and put the resulting Task[i] Timeout value (= tick count when task should stop) into a shift register.  Each time through the loop the current tick count is compared to all of the Task[i] Timeout values.  For any task where the tick count equals or exceeds the Timeout value, stop the task.
Any process which takes longer than the minimum resolution of the timing for ANY task needs to be put into a parallel loop or decomposed into small enough pieces to allow the interruption if a timeout occurs.
Lynn

Similar Messages

  • Wait step stops during PI BPM workflow

    Hello Guys,
    I'm testing the one BPM scenario in my test system, during runtime the workflow stops before wait step (only 1 min) but after 1 min the message not process and it is stucked in  'in process' state.
    Earlier the scenario works good with wait step, but now it's not working in Dev & test systems but only working in Production system,
    Note: Recently we migrated from Service pack upgraded from PI 7.31 SP06 to SP11 in all three systems.
    Do you have any idea on this error?  could you please suggest me
    Thank you.
    Sateesh

    Hello Udo,
    You are absolutely right, I reschedule my background jobs in t.code SXMB_ADM_BPE then it resolved my issue.
    And I have one more question currently my PI systems are in 7.31 SP11 and getting error ' Cache content Obsolete' (SXI_CACHE-->deltaMonitoring)
    Could you please provide me any suggestions on this .
    Thank you.
    Sateesh

  • Need to stop a Wait(mS) instruction in the middle of execution

    I have an application that needs to be able to stop a process in case of emergency. Currently, this is implemented with a Wait(ms) instruction, with a front panel variable wired to it, to give it the number of milliseconds to wait. This time can be up to 600 seconds (60000 milliseconds). I need to be able to stop the Wait(ms) instruction in the middle of execution, then execute a bit of code to shut down the process safely.

    Kristin, attached is an example that shows how to abort the the OpenG Toolkit "Wait (ms).vi" by setting an abort occurence.
    Cheers,
    -Jim
    Attachments:
    Abort_Wait_on_Occurence.vi ‏26 KB

  • HT4623 My Iphone 4s just stopped during the latest update and now the screen show the Apple icon and an white bar beneath.  I can no longer get anything to work on the phone!!  Where to from here??

    My Iphone 4s just stopped during the latest update and now the screen show the Apple icon and an white bar beneath.  I can no longer get anything to work on the phone!!  Where to from here??

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • ITunes stops during playback and won't start until I restart the computer

    I'm hoping someone can help me with this. I just reformated my computer and placed all the updates and programs back onto my computer. I had iTunes on my computer before and I reinstalled it then upgraded it to version 7.3.2.6. Now I've been reintroducing music back into the library on a folder by folder method (drag and drop). Anyway, during review of the songs I will get a random issue where the iTunes just stops during playback. I have shut down the program and restarted it. I've also shut down the following programs at different times to see if it would help:
    iPodService, ITunes.exe (the program), iTunesHelper, and even taskmgr.exe. Nothing seems to help. When I restart the program I click on play (any song or playlist) and nothing happens. The only thing that I have found to help is rebooting my computer. Does anyone have any ideas?
    I've check the event logs and nothing is showing in there and other programs are working without an issues.
    Please help!

    Any suggestions on what this can be?
    A dead battery.  Buy a new one.

  • What is causing, and how do you fix, a song stopping during playback? I have latest iTunes 12.0.1 and Yosemite 10.10.1

    What is causing and how do you fix a song stopping during playback? I have latest iTunes 12.0.1 and Yosemite 10.10.1.
    It stops then after several seconds (like 25 secs) then it starts again ... and then several seconds later it stops again!
    I have the latest software so I don't know what to do?
        David V.

    When you have the problem, note the exact time: hour, minute, second.  
    These instructions must be carried out as an administrator. If you have only one user account, you are the administrator.
    Launch the Console application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    The title of the Console window should be All Messages. If it isn't, select
              SYSTEM LOG QUERIES ▹ All Messages
    from the log list on the left. If you don't see that list, select
              View ▹ Show Log List
    from the menu bar at the top of the screen.
    Each message in the log begins with the date and time when it was entered. Scroll back to the time you noted above.
    Select the messages entered from then until the end of the episode, or until they start to repeat, whichever comes first.
    Copy the messages to the Clipboard by pressing the key combination command-C. Paste into a reply to this message by pressing command-V.
    The log contains a vast amount of information, almost all of it useless for solving any particular problem. When posting a log extract, be selective. A few dozen lines are almost always more than enough.
    Please don't indiscriminately dump thousands of lines from the log into this discussion.
    Please don't post screenshots of log messages—post the text.
    Some private information, such as your name, may appear in the log. Anonymize before posting.

  • The emergency stop

    Hello,
    I'm using a PCI-7354 motion control board and a UMI-7774  motion interface. I'm trying to implement an emergency stop button. I think i'm not the first one trying to do this, but i'm a little bit confused about how this is implemented in the NI hardware.
    First let me explain how i think an emergency stop should work. It should be a normally closed switch, so if the button is pressed the contact is released (no more electrical connection). If the button is pressed the drive should be disbaled and there should be no more movement. Using a normally closed contact means that the system doesn't work or stops working when the emergency stop button is disconnected or if there is a break in the cable leading to the button. In this way you  make sure that the emergency button is functional before you start moving. I should think this is the standard and most safe way to implement an emergency stop and i know most motor drives have it implemented in this way.
    But now back to the NI motion hardware. I know about the shutdown input and this document :
    http://digital.ni.com/public.nsf/websearch/622529A109BAD05E862569EA0060304F?OpenDocument
    Here it says that the shutdown circuit requires a rising edge to be activated. A rising edge looks like a normally open switch which is closed when pressed. This system doesn't work when the button is not connected or the cable is broken. What am I missing here?
    Thanks in advance,
    Youri

    Thank you both for your replies.
    Jochen: I agree with you that there is discussion about what action is taken after the emergency stop button is pressed. This depends largely on the application. But I still think that the way the button is connected to and handled by the motion controller should be in the way i descriped. I've read the threads you mentioned, but they both seem like a lot of work-arounds to me.  In my opinion (and by the knowledge i have on this moment) the shutdown input doesn't respond the way i would like it to do. So i'm wondering how this shutdown input is intended to be used and why there isn't a proper e-stop input on the NI motion controller. These motion controllers are widely used and easy to set up by inexperienced people.  There should be a easy, simple and most of all safe input for an e-stop button. But again, i might be missing something.
     Giridhar: Thanks for the tip. I'm going to look into it.
    Kind regards,
    Youri

  • Sound stops during games

    Randomly my sounds stops during most of my games.  Clash of clans my sound will fade in and out like its trying to work properly, but other apps are just muted completely.  If im listening to music while playing a game, it seems to happen more often.  ALL sound is stopped, i have to exit my app to turn the music back on.  This happened after i synced some music.  It was TERRIBLE, but i managed to sync it 3 or 4 more times to try and correct the problem, it helped but didnt fix it.  One day my sound wouldnt even adjust.  Something is seriously wrong with this OS.  This has been a problem since iOS7.  And i was syncing my wifes new Justin Timberlake, apparently the iPod hates him as much as i do.

    NoSound problem with headphones? With speaker?
    If only with headphones have you tried another pair of headphones?
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • Sound stops during automation recording.

    Alright here's a video example of what I'm talking about.
    When I'm doing a "Touch" Automation on one midi track, while recording a touch track the midi sound stops as soon as I move the slider.
    The automation still records, it's just that the sound stops during automation.
    In the video notice that as soon as i move the Volume Automation slider the midi playing
    stops. Why? I need to be able to monitor this while I'm adjusting the automation.
    Appreciate anyone's suggestions.
    It's Logic Express 8.0.2 by the way.
    http://s177.photobucket.com/albums/w238/perrycomo/?action=view&current=Example1. mp4

    NoSound problem with headphones? With speaker?
    If only with headphones have you tried another pair of headphones?
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Reset all settings      
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                 
    iOS: How to back up                                                                
    - Restore to factory settings/new iOS device.             
    If still problem, make an appointment at the Genius Bar of an Apple store since it appears you have a hardware problem.
    Apple Retail Store - Genius Bar                                      

  • Everytime i try to sync my music to my ipod, it always completely stops during the last stage. What can I do to get it to sync properly?

    Everytime i try to sync my music to my ipod touch, it always completely stops during the last stage. What can I do to get it to sync properly?

    Have you looked here:
    iTunes for Windows Vista or Windows 7: Troubleshooting unexpected quits, freezes, or launch issues
    The link provides links for other Win OSs.  If you are still having problems please tell us what OS and version you are running and what version of iTunes you have installed.

  • ICR Process 003 - Should postings be stopped during activation of database

    In our first go-live of ICR we only use process 003 and have no additional special ledger in scope for this phase. We have seen a recommendation that all postings should be stopped during activation of database. Is that really also valid if we only consider our scope above.
    Thanks for your comments!

    Hello Istvan,
    Even though you do not create a Special Purpose Ledger the ICR program still require the general SL posting framework to be generated. This can lead to issues if data is posted when the generation is performed.
    Best regards,
    Ralph

  • Stop and wait

    I am a new student in Java programming, and we haven't studied java networking yet, but I'm taking another couse called Data and Computer Communications which require us to write two programs in Java that will communicate with each other, it's meant to make me experience networking and it's not a java test, but in order to do that I have to have those programs. I appreciate the help:
    Stop-And-Wait
    I need to write two programs, a Sender and a Receiver, communicate with UDP. The Sender gets a text string from the keyboard (user input). The communication canal can only handle a packet of 10 bytes (we simulate this by not sending a packet of more than 10 bytes). In other words, the Sender must break down the messages into small chunks and sends them one at a time. Each packet will also have 3 bytes of control information, which means that the data size in each packet can not exceed 7.
    The message format of each packet is:
    | seq | cntrl | data | check |
    where seq(1 byte) is a sequence number, data (<=7 bytes), check (1 byte),
    cntrl includes
    | type | flag | len |
    where type(1 bit) =0 for data packet, 1 for ACK/NAK;
    flag(1 bit) = 1 for the last packet in the message, 0 if the packet is not the last one.
    flag(1 bit) = 0 for ACK, 1 for NAK (for a receipt packet).
    len(6 bits) = data length (number of bytes) for data packet; 0 for a receipt packet.
    In each message, the sequence number (seq) for the first packet = 0.
    When a packet is created, all the fields will be filled except for check.
    The checksum is created by adding the remaining bytes (<=9) modulo-256, and this is filled in the check field.
    We simulate the transfer error by creating an instance of the class Error (I will e-mail it, if you send me your e-mail address).
    A suitable number for the error frequency, is 5 to 10 (i.e. 0.5 to 1 % error chance per bit). Each bit is to filtered by Error ( buf = error.error(buf); ).
    When the Receiver gets a packet, it checks the checksum and if it is correct, it sends an ACK, otherwise it sends a NAK. Notice that even those need to be filtered through Error, which means that they are also open for transfer error.
    When the Sender gets an ACK or a NAK, it checks the checksum. If the checksum is correct for an ACK, it sends the next packet if there are more packets to send. If the checksum is correct for a NAK or it is incorrect (for both), the Sender sends the last sent packet again. Note that even then a sequence number is required.
    A number of error situations must be dealt with: when a data packet is corrupted, when an ACK is corrupted, or when a NAK is corrupted. Men we know that the packet always is delivered.
    When the last packet is received, the Receiver write a message on the screen, resets itself, and waits again.
    You can reply directly to my e-mail at: [email protected]
    Thanx

    Start by reading the "Custom Networking" tutorial found on this page:
    http://java.sun.com/docs/books/tutorial/

  • While watching rented movie it stops during playback, how do i fix it?

    I rented a long movie and it continues to stop during playback, how do I fix that?

    Hi dedesgirl,
    Welcome to Apple Support Communities.
    It sounds like there is an issue playing songs in iTunes. Does the playback issue only occur with specific tracks and were they purchased from the iTunes Store? Take a look at the article linked below and try the suggestions which will resolve most iTunes and QuickTime Player playback issues.
    iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
    http://support.apple.com/kb/TS1362
    I hope this helps.
    -Jason

  • Can't activate iPad. Restoration stops during firmware update. Any ideas?

    Can't activate iPad. Restoration stops during firmware update. Any ideas?

    Oh yeah i checked the firewall issue, and itunes is enabled.

  • My Flash Player stops during all types play. Can anyone Offer some help?

    Adobe Flash Player stops during any type of play. YouTube, Live Feed, Videos etc,. All of these will stop after a few seconds. This has nothing to do with buffering it just stops.
    I have tried updates to the program (Adobe) no help. I have run this in Chrome and Internet Explorer.
    Thanks for any suggestions.

    Delet any unwanted or useless files. I also suggest upgrading the RAM to 8GB or a 6GB it if you can't get 8GB. You shouldn't need 16GB of RAM either. If you want a really fast and responsive system, get an SSD as well. Go to www.crucialmemory.com and download their system scanner. All it does is check your system's make, model, year, and hardware configuration and it will bring you to available SSDs and RAM modules for your machine. The RAM is very easy to upgrade and the hard drive is a little more tricky. But there's plenty of videos on youtube to upgrade RAM and hard drive in MacBooks.

Maybe you are looking for