2 program documentation – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 44

Advertising
background image

6Ć4

Recall that BASIC tasks always use the most current value of

common variables when performing calculations, while Control

Block and PC/Ladder Logic tasks latch the value of all simple

double integer, integer, and boolean variables. See section 4.0 for

more information.
Note that in the following examples, GLOBAL can be substituted for

COMMON.

COMMON Simple Variable Format

COMMON variable
where:
variable =

simple variable of double integer, integer, real,

string, or boolean type for common memory

locations; simple variable of double integer,

integer, or boolean type for common I/O

locations; more than one variable can be

defined with one statement by separating the

variables with commas

examples:

10 COMMON SPEED%

20 COMMON LIMIT%, START@, PROMPT$

COMMON Subscripted (Array) Variable Format

COMMON variable(size_list)
where:

variable =

simple variable of any type, i.e., double integer,

integer, real, string, or boolean

size_list =

up to five integer constants or integer variables

separated by commas, each value defining the

limit of the dimension of the array; expressions

that result in integer values are also permitted;

see section 4.1.2 for more information about

memory allocation for arrays; note that the first

item in every dimension is indicated in location

0, not 1

examples:

10 COMMON A%(10) [reserves space for 11 integer

ă ăelements]

20 COMMON B$:15(2,10) [reserves space for 33 string

ăăelements of 15 characters each maximum]

6.2

Program Documentation

BASIC allows you to insert notes and comments in a task. BASIC

provides two statements for this purpose, the REM and ! statements.

REM comment

OR

! comment

where:

comment = any text

Advertising
This manual is related to the following products: