Software Overview  |  Sitemap  |  Downloads  |  Developers  |  Forums

Accumulation Timer

The Accumulation Timer Device acts like a stopwatch. When turned on, it accumulates time, and when turned off, it stops timing. Like a stopwatch, it can be reset, and like fancier stopwatches, the reset can be done if the timer is running or not. The timer's output format can be in pure seconds or in Hours:Minutes:Seconds. The Accumulation Timer is a Virtual Device, so one can create as many Accumulation Timers as one needs.

Accumulation Timer Terminals

Accumulation Timer Devices have a single output terminal for outputting time, and 3 input terminals for control. The 3 inputs turn the timer on and off, reset the timer, and update the timer's output terminal. The output terminal is called "out" and the on/off, reset, and update terminals are called (in the same order) "run", "reset", and "update".

The "out" terminal outputs elapsed time in one of 2 formats: seconds or Hours:Minutes:Seconds (H:M:S). Its mode is determined by a parameter in its start up Script. When outputting in seconds, it outputs a raw number; when outputting in H:M:S, its output is a quoted string. Seconds are useful if you are wiring to another device which needs to know the elapsed time. H:M:S are useful for humans.

The "run" terminal turns the timer on and off. When the terminal sees an on, the timer runs. When it sees and off, the timer stops.

The "reset" terminal sets the timer back to 0. When it sees an "on" event, it resets. The timer can be reset when it is running or stopped. Note that this terminal is event driven - it resets when it sees an "on" event. If it's running, it continues to run from 0 (even if the reset terminal stays "on").

The "update" terminal updates the "out" output. When it sees an "on" event, it updates the "out" terminal with the current accumulated time. If the update terminal doesn't see an "on" event, the "out" output holds the value from the last update.

Creating an Accumulation Timer

Accumulation Timers are created by running the TimerAccumulation Script. The TimerAccumulation Script takes one optional parameter: "output_mode".

  • output_mode : a double quoted string with the desired output mode of the "out" terminal. If the value is "HMS", the "out" terminal will output in Hours:Minutes:Seconds format. If the mode is not specified (either by the empty string "" or nil), the "out" terminal will output the accumulated time in seconds.

Running the TimerAccumulation Script with the parameters listed below will create an Accumulation Timer whose "out" terminal outputs in Hours:Minutes:Seconds format:

id: "hms_timer"
output_mode: "HMS"

Running the TimerAccumulation Script with the parameters listed below will create an Accumulation Timer whose "out" terminal outputs in seconds:

id: "seconds_timer"
output_mode: ""

Catalina Computing, LLC.

Copyright © Catalina Computing, LLC. (2013-2018)

Page last updated: Wed Jan 7 16:07:02 2015 (UTC)