Clock0, Clock0 -2, Example – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 86: Purpose, Syntax

Advertising
background image

Publication 1746-RM001A-US-P

7-2 Control Functions

Example

>NEW

>1

REM EXAMPLE PROGRAM

>10

TIME = 0

>15

DBY(71) = 0

>20

CLOCK1

>30

ONTIME 2,100

>40

DO

>50

WHILE TIME < 10

>60

END

>100 PRINT “TIMER INTERRUPT AT - ”,TIME,“ SECONDS”

>110 ONTIME TIME+2,100

>120 RETI

READY

>RUN

TIMER INTERRUPT AT - 2.01 SECONDS

TIMER INTERRUPT AT - 4.015 SECONDS

TIMER INTERRUPT AT - 6.01 SECONDS

TIMER INTERRUPT AT - 8.01 SECONDS

TIMER INTERRUPT AT - 10.01 SECONDS

CLOCK0

Purpose

Use the CLOCK0 (zero) statement to disable or turn off the free running clock
resident on the BASIC module. After CLOCK0 is executed, the special function
operator TIME no longer increments. CLOCK0 is the only module statement that
can disable the free running clock. CLEAR and CLEARI do not disable the free
running clock, only its associated ONTIME interrupt.

Syntax

CLOCK0

Example

READY

>CLOCK0

IMPORTANT

CLOCK1 and CLOCK0 are independent of the clock/calendar.

Advertising