Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 24

Advertising
background image

4Ć4

4.1.1.4

Boolean Variables
A boolean variable is a named location which represents a

TRUE/FALSE or ON/OFF value. It is named using the rules listed in

section 4.1.1 and terminated with an at" symbol (@).
The following are valid boolean variable names:

REEL_EMPTY@

OVER_TEMP@

TURRET_ENGAGED@

The following are invalid boolean variable names and the reasons

that they are invalid:

SYSTEM_READY (Variable not terminated with @)

WEB_FULL@@ (Two @s backĆtoĆback are illegal)

4TH_READY@ (Variable starts with a digit rather than

Ăa letter or an underscore)

As with integer and real variables, boolean variables form

expressions. With boolean variables you use the boolean operators

NOT, AND, OR, and XOR and boolean constants TRUE, FALSE, ON,

and OFF in forming these expressions:

LINE_DOWN@ = NOT(POWER@ AND RUN@)

RUN _REQUEST@ = TRUE

SECTION_ POWER@ = FALSE

CRT _REFRESH@ = OFF

IF RUN@ OR (STOPPED@ AND FAULT@) THEN 1350

Refer to section 5.3 for more information about boolean

expressions.

4.1.1.5

String Variables
String variables are used to store any alphanumeric sequence of

printable characters, including spaces, tabs, and special characters.

The terminating character is $.
The sequence in a string variable cannot include a line terminator

(<CR>). When defined, the sequence must be enclosed either in

single or double quotes. If one type of quotes is used in the

sequence itself, the other type must be used to enclose the

sequence.
Version 1.0 Executive software allowed a fixed maximum length of

31 characters for string variables. Version 2.0 and later allows string

variables of variable length, from 1 to 255 characters. To specify the

maximum size of a string variable, add a colon and a number

(1Ć255) immediately after the $ character. For example, defining

A$:50 as a local variable in an application task will reserve space for

50 characters. Note that if no length is specified, the default length

is 31.

4.1.2

Subscripted Variables (Arrays)

Array variables are used to store a collection of data all of the same

data type. Arrays are permitted for all data types. Arrays are limited

to four dimensions, or subscripts. The number of elements in each

dimension is limited to 65535. This size is further limited by available

memory. The term array is used to denote the entire collection of

data. Each item in the array is known as an element.

Advertising
This manual is related to the following products: