TimerTimer & Timer Compare

This covers both the Timer Block (lower highlighted tool) and Timer Compare Decision Block.

Timers keep track of time elapsed while Timer Compares check to see if desired time has elapsed.

Timer

Timers are background functions. Once you start a Timer, it will continue to run, until you Pause it. Timers cannot be passed into or out of Subroutines, but their values can be.

timer-start-dialog

 

To Start a Timer, select Start/Continue.  Provide an I32 Tag in the ‘Timer slot.  This is where the time is kept.  The time elapsed is stored as number of milliseconds since timer was started.  (10 millisecond increments in Firmware versions prior to 1.07)

 

 

timer-pause-dialog

 

 

 Pause stops the timer, but retains it’s value.  –>

timer-reset-dialog

 

 

 

 

 

<– Reset puts a 0 in the Timer’s Tag.  It doesn’t stop the Timer.

 

 

Timer Compare

Once you’ve created a Timer, you probability want to test if an amount of time has elapsed.  For this we use Timer Compare.  It’s found on the toolbar just below the other Decision Blocks (It’s the top tool highlighted on this page).  It works just like other decision blocks.  Check out the Decision Blocks Page to learn the basics of Decision Blocks.

timer-compare-dialog

In Timer Compare you must select your Timer Tag in the leftmost slot.  The right slot can have a number or Tag.  The right tag uses the drop-down to specify the time you’d like to use in the comparison.