Specifications

Section 9. Program Control Instructions
9-20
Timer (TimNo, TUnits, TOption)
Used to return the value of a timer.
Remarks
Timer is a function that returns the value of a timer. TOption is used to start,
stop, reset and start, stop and reset, or read without altering the state (running
or stopped). Multiple timers, each identified by a different number (TimNo),
may be active at the same time.
Syntax
variable = Timer(TimNo, TUnits, TOption)
Parameter
& Data Type
Enter
TimNo
Constant,
Variable, or
Expression
An integer number for the timer (e.g., 0, 1, 2, . . .) Use low numbers to
conserve memory; using TimNo 100 will allocate space for 100 timers even
if it is the only timer in the program.
TUnits
The units in which to return the timer value.
Constant
Numeric
Code
Alpha
Code
Units
0 usec microseconds
1 msec milliseconds
2 sec seconds
3
4
min
days
minutes
days
TOption
Constant
The action on the timer. The timer function returns the value of the timer
after the action is performed
Code Result
0 start
1 stop
2 reset and start
3 stop and reset
4 read only
Timer Example
This example uses Timer to measure the time required to execute the
measurement instructions. The Timer is reset at the top of each scan. The time
in microseconds is stored in the variable Elapse.
SequentialMode
Public PTemp, TCTemp, Elapsed
DataTable (Test,True,-1)
DataInterval (0,1,Min,10)
Sample (1,TCTemp,FP2)
Sample (1,Elapsed,IEEE4)
EndTable