1 Reply Latest reply on Aug 12, 2013 7:27 AM by philmodjunk

    Timer

    jackmac

      Title

      Timer

      Post

           Hi all,

           I'm building a system and I want to have a timer in it. I want to push a button which starts the timer and it displays as it counts then be able to push a button and it stops. There's no need to record or store the times, it's purely to monitor the time passing until it reaches a chosen value.

           I've found a few scripts that will count down from a point.. say 15 minutes then it counts to zero. My need is reverse, I need to be able to start the timer and I can see as it approaches 10 mins. I'm counting how long things take, not how many times they happen in a period if that makes sense.

           Anyone any suggestions?

           TIA

           Jackmac

        • 1. Re: Timer
          philmodjunk

               The same method that counts down can be modified to count up instead. It likely is just a matter of changing a - to a +.

               Install OnTimerScript can be set up to run a script on a regular interval as frequent as 1 second. The two scripts might look like this:

               Set Variable [ $$Start ; value: Get ( CurrentTime ) ]
               Set Variable [$$Timer ; value: 0 ]
               Install OnTimer Script [ UpdateTimer ; 1 ]

               Update Timer script:

               Set Variable [$$Timer ; value: Get ( CurrentTime ) - $$Start ]
               Refresh Window[] --> this step may or may not be needed, experiment and see

               You then put $$Timer on your layout as a merge variable (See Insert menu) and use data formatting to format it as time with desired time format.