beautypg.com

Basic programming guide – Remote Processing BASIC for the CX-10 Modbus User Manual

Page 79

background image

BASIC PROGRAMMING GUIDE

2-70

TICK

Syntax:

TICK(timer)
Where: timer = 0 to 3. It specifies the timer number.

Function:

Returns a time from one of 4 process clocks in 5 ms increments.

Mode:

Command,Run

Use:

A = TICK(2)

DESCRIPTION

There are four tick timers updated 200 times per second. Each timer is independent of each other in that they
may be read and cleared separately (see CLEAR TICK). All timers are updated at the same time.

This function is separate from the real time clock and is not battery backed. All timers reset to 0 on power up
or reset. Timers continue to run in command mode and cannot be turned off.

TICK(n) returns time in thousandths of a second (in 5 ms intervals) up to 65535.995 seconds, or
approximately 18.2 hours. The timer then starts at 0 again.

Tick timers are not affected by to the ONTICK instruction.

RELATED

CLEAR TICK, ON TICK

ERRORS

BAD SYNTAX

If any parameters left out

BAD ARGUMENT When timer > 3 or negative or left out

EXAMPLE

The following example clears tick timer number 3, delays for a time, then prints tick timers 0 and 3.

10 CLEAR TICK(3)
20 FOR X = 0 TO 1000
30 NEXT
40 PRINT TICK(0),TICK(3)

124.6

.425