Timer (Initiate Timer)

The Timer instruction is used to initiate a timer in the datalogger program.

Syntax

variable = Timer ( TimerNo, TUnits, TOption )

Remarks

A typical use of the Timer is to set a variable equal to the Timer instruction (i.e., Variable=Timer(1, sec, 2). The Timer value is then stored in the defined variable. Multiple Timers can be defined in the program; each must have a unique TimerNo argument.

Parameters

TimerNo (Timer Number)

A number assigned to the timer (for example, 0, 1, 2, …). Memory is allocated for timers based on the value entered + 1 (for example, using a TimerNo of 100 will allocate memory for 101 timers even if there is only one Timer in the program). Use a low number to conserve memory.

If this value is a variable, memory for 17 (0 - 16) timers is allocated. If more than 17 timers are needed, and TimerNo also needs to be a variable, use a "dummy" Timer instruction, which does not execute at run-time, with a TimerNo of the maximum number of timers needed in the program.

Type: Integer or Variable

TUnits (Time Units)

The TUnits argument is the time unit in which to report the Timer. A numeric or alphabetical code can be entered.

Code Alphanumeric Code Description
0 usec microseconds
1 msec milliseconds
2 sec seconds
3 min minutes
4 hr hours

Note, when using microseconds:

Type: Constant

TimeOpt (Timer Action)

The action on the Timer. The timer instruction returns the value of the timer after the action is performed. A numeric code is entered. Right-click the parameter to display a list.

Code Description
0 Start
1 Stop
2 Reset and start
3 Stop and reset
4 Read only

Type: Constant