Control functions, Clock1, Chapter 7 – Rockwell Automation 1746-BAS BASIC LANGUAGE User Manual

Page 85: Clock1 -1, Chapter, Purpose, Syntax

Advertising
background image

1

Publication 1746-RM001A-US-P

Chapter

7

Control Functions

This chapter describes and illustrates commands executed within the BASIC
program or from the command line to control the internal clock or the flow of the
BASIC program. Table 7.1 lists the corresponding mnemonics.

CLOCK1

Purpose

Use the CLOCK1 statement to enable the free running clock resident on the
BASIC or BASIC-T module. The special function operator TIME is incremented
once every 5 milliseconds after the CLOCK1 statement is executed. The CLOCK1
statement uses an internal TIMER to generate an interrupt once every 5
milliseconds. Because of this, the special function operator TIME has a resolution
of 5 milliseconds. The special function operator TIME counts from 0 to
65535.995 seconds. After reaching a count of 65535.995 seconds TIME overflows
back to a count of zero. The interrupts associated with the CLOCK1 statement
cause the module programs to run at about 99.6% of normal speed. This means
that the interrupt handling for the free running clock uses about 0.4% of the total
CPU time

.

Syntax

CLOCK1

Table 7.1 Chapter Reference Guide

If you need (to)

Use this mnemonic

Page

Disable the real time clock.

CLOCK0

7-2

Enable the real time clock.

CLOCK1

7-1

Set up a conditional do-loop.

DO-UNTIL

7-4

Set up a conditional do-loop.

DO-WHILE

7-3

Terminate a program execution.

END

7-5

Set up a for-next loop.

FOR-TO-(STEP)-NEXT

7-6

Go to the program line number.

GOTO

7-7

Conditional test

IF-THEN-ELSE

7-8

Test a for-next loop condition.

NEXT

7-9

Conditional GOTO

ON-GOTO

7-11

IMPORTANT

This does not include additional overhead for ON-TIME user
interrupt handling execution.

Advertising