Special operators, Special function operators – Rockwell Automation 1771-DB Basic Module User Manual - Series A User Manual

Page 87

Advertising
background image

Operating Functions

Chapter 5

5–50

Special operators include special function operators and system control
values.

Special function operators directly manipulate the I/O hardware and the
memory addresses on the processor.

5.6.1.1
GET

Use the GET operator in the RUN mode. It returns a result of zero in the
command mode. The GET operator reads the console input device. If a
character is available from the console device, the value of the character is
assigned to GET. After GET is read in the program, it is assigned the value
of zero until another character is sent from the console device. The
following example prints the decimal representation of any character sent
from the console:

Example:

u10 A=GET

u20 IF A tu 0 THEN PRINT A :REM ZERO MEANS NO ENTRY

u30 GOTO 10

uRUN

65

(TYPE “A” ON CONSOLE)

49

(TYPE “1” ON CONSOLE)

24

(TYPE “CONTROL–X” ON CONSOLE)

50

(TYPE “2” ON CONSOLE)

The GET operator is read only once before it is assigned a value of zero.
This guarantees that the first character entered is always read, independent
of where the GET operator is placed in the program. There is no buffering
of characters on the program port.

5.6.1.2
TIME

Use the TIME operator to retrieve and/or assign a value to the real time
clock resident in the BASIC Module. After reset, time is equal to 0. The
CLOCK1 statement enables the real time clock. When the real time clock
is enabled, the special function operator, TIME, increments once every 5
milliseconds. The units of time are in seconds.

5.6
Special Operators

5.6.1
Special Function Operators

Advertising