0 - structure of an automax enhanced basic program, 1 line format, 0 structure of an automax enhanced basic program – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 17

Advertising
background image

3Ć1

3.0 STRUCTURE OF AN

AutoMax ENHANCED BASIC

PROGRAM

BASIC programs, or tasks, are created using a text editor.
Note the following naming convention. Application task names in

AutoMax are limited to 8 characters. The initial character must

always be a letter. Following the initial character can be letters (AĆZ),

underscores (ă), and numbers (0Ć9). Spaces and other characters

are not permitted. The file extension is used to identify the task.

Extension .CNF identifies configuration tasks. Extension .BAS is

used for BASIC tasks. AutoMax Control Block tasks use extension

.BLK. UDC Control Block tasks also use extension .BLK. PC/Ladder

Logic tasks have a .PC extension.
An AutoMax Enhanced BASIC program consists of a set of

statements using certain language elements and syntax (rules for

the form of each statement). Each line begins with a number that

identifies the line as a statement and indicates the order of

statement execution. Each statement starts with a word specifying

the type of operation to be performed, such as PRINT, GOTO, and

READ. For a BASIC program to compile correctly, all text except

print list items delimited by quotation marks must be in upper case.
The following symbols have special meaning for the duration of this

manual:
<CR> =

Carriage return, sometimes marked RETURN" or

ENTER" on keyboards. You should assume that

all BASIC statements end with a <CR> unless

otherwise noted. Some statements used in

examples may explicitly use the <CR> notation at

the end of a statement to make the example easier

to understand.

_

=

Underscore character used to make variable

names more readable (for example,

MOTOR_SPEED, LINE_REFERENCE).

Note that the underscore is not a dash or minus character, which

appears on the same key as the underscore on most standard

keyboards.

3.1

Line Format

The format of a statement in a BASIC program is as follows:
line statement statement line

number keyword body terminator
10 LET SPEED%=(GAIN%+3) <CR>
The line number is a label that distinguishes one line from another

within a program. Consequently, each line number must be unique.

The line number must be a positive integer within the range of 1 to

32767 inclusive.
Line numbers are required for the following reasons:
1. To determine the order in which to execute the program.

Advertising
This manual is related to the following products: