Jump to content

How to safely stop a long timer by user?


Recommended Posts

Because your timer is in a whiloe loop, I assume that it's looping on whether a target time has been reached? Put a button on the front panel and "OR" it with the timer. It'd be a lot easier to help if you post either your code or a screenshot...

Link to comment
Hi,

I have a fairly long timer running in a while loop. (10 minutes) At the end of the programs' use, how does one avoid having to wait as much as 10 minutes for the vi to stop? Nicely, of course. :-)

semi-newbie,

Fred

The Wait functions are not interruptible so when you put them in a while loop, the loop will take 10 min to execute. Instead of using a Wait function, create a notifier and use Wait Notification (with timeout) which can be interrupted by sending a notification or destroying the refnum. If the Wait Notification times out with no error, this indicates that the loop can run next iteration. If it doesn't time out (notification received) or output an error (refnum destroyed) the loop can exit.

Link to comment
Here is a VERY simple example of how I would handle the situation. I am in LV 8...

This solution does not fit his needs as he has described. If I understand the question correctly. What you are saying is that you want to use a while loop to process something then wait ten minutes and process again but you want to implement a sort of emergency stop were the user may not be able to wait the ten minutes. if this is the case i would suggest that you use JP's suggestion.

Link to comment
This solution does not fit his needs as he has described. If I understand the question correctly. What you are saying is that you want to use a while loop to process something then wait ten minutes and process again but you want to implement a sort of emergency stop were the user may not be able to wait the ten minutes. if this is the case i would suggest that you use JP's suggestion.

Thanks to ALL! :-) I have generated a LV8 version of my interpretation of JP's suggestion and attached it. It did not occur to me until later that I was given a requirement this does not fill easily. Perhaps someone can help me implement it. In my example I just put a flashing lamp for the function to be performed. It appears to work fine, but I am also supposed to perform the function(collecting data from several acquistion boxes via USB) as soon as the program starts, sort of a baseline. . . Right now the only way I can think of to do that is put a copy of the elaborate function outside the loops, so it runs once immediately. Perhaps someone can point me to a better way?

Thanks again,

Fred

:unsure:

Download File:post-4712-1154577090.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.