0 - variables and constants, 1 variables, 0 variables and constants – Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual
Page 21

4Ć1
4.0 VARIABLES AND
CONSTANTS
All operations performed in BASIC use constants or variables.
Constants are quantities with fixed value represented in numeric
format. Variables are names that represent stored values or physical
I/O. These values may change during program execution. BASIC
always uses the current value of a common (i.e., systemĆwide)
variable in performing calculations.
Note that Control Block and PC/Ladder Logic tasks capture (latch)
the values of all common simple double integer, integer, and
boolean variables at the beginning of the task scan. Strings, reals,
and array variables of any type are not latched. This means that
Control Block and PC/Ladder Logic tasks do not see the most
current state of common simple double integer, integer, and boolean
variables; instead, they see the state of these variables at the
beginning of the scan. Any changes made to these variable values
by Control Block or PC/Ladder Logic tasks are written to the variable
locations at the end of the scan of the particular task. See section
4.1.3 for more information about common variables.
4.1
Variables
The following sections describe the use of variables in AutoMax
Enhanced BASIC.
4.1.1
Simple Variables
Variable names in AutoMax tasks must meet the following
conditions:
1. They must ALWAYS start with a letter or an underscore.
2. Following the letter/underscore can be letters, digits, or an
underscore.
3. They must not include spaces.
4. The maximum length for any variable in BASIC or Control Block
tasks is 16 characters (letters, underscore, or digits), not
including the type character attached at the end (%,!,@,$). Note
that PC/Ladder Logic tasks variables are limited to 14 characters
(16 in V4.0 and later). This is important if variables that are used
in BASIC or Control Block tasks must also be used in Ladder
Logic tasks, i.e., if the variables are common.
This variable length (16) permits meaningful and understandable
names. Avoid cryptic variable names.
Meaningful
Unintelligible
Variable Names
Variable Names
MOTOR_SPEED%
MSPD%
GAIN%
G%
CURRENT_GAIN%
CGN%
DROP_1_REFERENCE%
D1RF%