LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Perform actions when timer is paused

Solved!
Go to solution

Hello,


So I have a double that is counting down from 200 seconds (my own timer, not any built-in timer). I can pause the time in the middle of running the program. I want to check to see if that double is still counting down (running) and if not (paused), do some additional stuff like turn on a light saying timer is paused, etc. How can I check to see of the timer is counting down or not?

 

Thanks for any help!

SM

0 Kudos
Message 1 of 7
(3,657 Views)

Sounds like you want an event structure with a value change on the timer beign false triggering your actions. 

0 Kudos
Message 2 of 7
(3,655 Views)

The problem with an Event Loop is that it only "fires" when there is an Event.  You can trigger a "Timer Changed" Event, but it is another thing to say "This did not happen".

 

A simpler way to do this is to store the Boolean value of "Is Timer Running?" somewhere.  Several ways suggest themselves (depending on the design of your code).  The simplest, useful particularly if you are using a State Machine or something with a single loop surrounding Case Statements that "do various things under various conditions" is to save the Boolean in a Shift Register.  On the other hand, if you have multiple loops, or use lots of sub-VIs, you might consider using a Set/Get VIG that "remembers" the status of the Timer.

 

Bob Schor

0 Kudos
Message 3 of 7
(3,645 Views)

Bob,

 

Thanks for the reply. That's just my issue, how do I "store the Boolean value of "Is Timer Running?" somewhere"? I can do the other stuff based off the boolean, but I'm not sure how to check the state of a double to see if it's counting down or not?


Thanks for the help,

SM

0 Kudos
Message 4 of 7
(3,643 Views)
Solution
Accepted by topic author Sman29

just re-writing this.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 7
(3,631 Views)

Thanks for the help guys!

SM

0 Kudos
Message 6 of 7
(3,625 Views)

@SteMob wrote:

Bob,

 

Thanks for the reply. That's just my issue, how do I "store the Boolean value of "Is Timer Running?" somewhere"? I can do the other stuff based off the boolean, but I'm not sure how to check the state of a double to see if it's counting down or not?


Thanks for the help,

SM


I don't understand.  You don't need to check the state of the double to determine whether or not your timer is running.  After all, it is *you* that is determining whether or not it's running in the first place!  (Just set the Boolean when you start the timer.)

 

Unless, of course, this is homework and the assignment is to check to see if the double is changing or not.  😉

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 7 of 7
(3,623 Views)