Timers


Timers in Helm have two distinct functions. They can be used to display count-down and count-up timers on operator panels, and they can run scripts when the timer reaches a predetermined time. Timers can be used as interval timers for performing regular tasks, and can also be used to display the current PC time. (Wall clock time)

Note that Timers are stopped by default. If you want a timer to be running as soon as the panel starts, you should use the Timer’s Start action in the panel’s OnStartup event.

timer

Commands

Add (Value to add) Add a number to the label

  • Value to add : 1

Example: TIMER_1:Add( 0 )

AddCurrency (Value to add) Add a currency value to the label

  • Value to add :

Example: TIMER_1:AddCurrency( “1” )

MultiplyCurrency (Multiplier) Multiply a currency amount by a number

  • Multiplier :

Example: TIMER_1:MultiplyCurrency( 1.175 )

Reset () Reset the timer
Example: TIMER_1:Reset( )
Set (Property, Value) Set property to value

  • Property : Property
  • Value :

Example: TIMER_1:Set( , )

SetAlignment (Text Alignment) Sets the text alignment (left, centre or right)for the label

  • Text Alignment :
    • Left
    • Centre
    • Right

Example: TIMER_1:SetAlignment( )

SetColor (Label Color) Sets the text color for the label

  • Label Color : New color for label

Example: TIMER_1:SetColor( clBlack )

SetCurrency (Value) Set the label to a currency value

  • Value :

Example: TIMER_1:SetCurrency( 100 )

SetOpacity (Label Opacity) Sets the text opacity for the label

  • Label Opacity : New opacity for label

Example: TIMER_1:SetOpacity( 0.85 )

SetPointsize (Label Text PointSize) Sets the text pointsize

  • Label Text PointSize : New text point size for label

Example: TIMER_1:SetPointsize( 20 )

SetStart (Seconds) Set the start time for a timer

  • Seconds : Timer start time in seconds

Example: TIMER_1:SetStart( 30 )

SetText (Label Text) Sets the text for the label

  • Label Text : New text for label

Example: TIMER_1:SetText( “Message” )

Start () Start the timer
Example: TIMER_1:Start( )
Stop () Stop the timer
Example: TIMER_1:Stop( )
Subtract (Value to subtract) Subtract a number from the label

  • Value to subtract : 1

Example: TIMER_1:Subtract( 0 )

SubtractCurrency (Value to label) Subtract a currency amount from the label

  • Value to label :

Example: TIMER_1:SubtractCurrency( “1” )

Properties

Timers support many of the common properties for visual controls, and have the following special properties.

Event Scripts
OnClick Occurs when you click on the timer.
OnTimer Occurs when the timer reaches the specified trigger time.
OnTimerTick Occurs 25 times a second while the timer is running. Because this happens so frequently,
only simple scripts should be inserted here.
Miscellaneous
Continuous False = the timer stops when it reaches the trigger time.
True = the timer jumps to the StartSeconds value, and continues counting.
CountDown True = count down from initial setting to zero.
False = count up from initial setting
CustomFormat This allows full control of the format of the dis­played time. You can insert any combination of field specifiers here. The field specifiers are shown after the list of Properties.
FramesPerSec Controls how fractions of a second are dis­played. Typically, use 25 for PAL systems, 30 for NTSC systems. If FramesPerSec = zero, then frames are not displayed.
StartSeconds For count-down timers, this is the number of seconds that the counter starts counting from. Ignored if CountDown is set to False.
TriggerTime For count-Up timers: the time (in seconds) when the OnTimer event occurs. If CountDown is set to True, this value is ignored and the OnTimer event always occurs when the timer reaches zero.
WallClock True = shows current PC time, and does not generate OnTimer events.
False = operates as a normal count-up or count-down timer.

Field specifiers for CustomFormat

Specifier Displays
c Displays the date and time using the system’s usual format
d Displays the day as a number without a leading zero (1−31)
dd Displays the day as a number with a leading zero (01−31)
ddd Displays the day as an abbreviation (Sunday−Saturday)
dddd Displays the day as a full name (Sunday−Saturday)
ddddd Displays the date using the system’s short format
dddddd Displays the date using the system’s long format
m Displays the month as a number without a leading zero (1−12). If the m specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mm Displays the month as a number with a leading zero (01−12). If the mm specifier immediately follows an h or hh specifier, the minute rather than the month is displayed.
mmm Displays the month as an abbreviation (January-December)
mmmm Displays the month as a full name (January-December)
yy Displays the year as a two-digit number (00-99)
yyyy Displays the year as a four-digit number (0000-9999)
h Displays the hour without a leading zero (0-23)
hh Displays the hour with a leading zero (00-23)
Displays the minute without a leading zero (0−59)
nn Displays the minute with a leading zero (00−59)
s Displays the second without a leading zero (0−59)
ss Displays the second with a leading zero (00−59)
t Displays the time using the system short format
tt >Displays the time using the system long format
am/pm Uses the 12-hour clock for the preceding h or hh specifier, and displays ‘am’ for any hour before noon, ‘pm’ for any hour after noon. The am/pm specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
a/p Uses the 12-hour clock for the preceding h or hh specifier, and displays ‘a’ for any hour before noon, and ‘p’ for any hour after noon. The a/p specifier can use lower, upper, or mixed case, and the result is displayed accordingly.
ampm Uses the 12-hour clock for the preceding h or hh specifier, and displays the systems’ usual am/pm format.
/ Displays the system date separator character
: Displays the system time separator character
‘xx’/”xx” Characters enclosed in single or double quotes are displayed as is, and do not affect formatting.
Tagged with: , , , ,
Posted in HELM, Timer, Visual Controls

Leave a Reply