V+ 12.4 Release Notes

Displays the Table of Contents for the current document
Displays the previous topic in the current document
Displays the next topic in the current document
Displays the Index for the current document

TIMER timer_number = time_value

 
Function

Set the specified system timer to the given time value.

Usage Considerations

Times measured by V+ are precise only to within 1 millisecond (0.001 seconds); shorter times cannot be measured.

System timer number 0 is the system clock and cannot be set with this instruction.

Parameter s

timer_number Real-valued expression interpreted as the (integer) number of the timer to be set. The value must range from 1 to 15.

time_value Real-valued expression interpreted as the time, in seconds, to which the timer is set. This parameter may specify fractions of a second and may be negative.

Details

When used as described in the examples below, the timers can measure an interval of 596 hours with 1 millisecond resolution.

Use the TIMER real-valued function to read the instantaneous value of a system timer.

Example

The following examples show two ways to wait for a certain amount of time, using the TIMER instruction and real-valued function. Each example first sets the timer, and then waits until the timer value has changed by the delay period:

TIMER 1 = 0 												;Set timer to zero 	 
WAIT TIMER(1) > delay 					;Wait until timer > delay 
TIMER 1 = -delay 												;Set timer to -delay 	 
WAIT TIMER(1) > 0 												;Wait until timer > zero 
Related Keyword

TIMER (timer_number) (real-valued function)

Syntax
TIMER-R

Please submit comments to: techpubs@adept.com

Last modified on: 07/08/2004
Copyright © 2004 by Adept Technology, Inc.
All rights reserved.