Rockwell Automation 57C610 Enhanced Basic Language, AutoMax User Manual

Page 23

Advertising
background image

4Ć3

4.1.1.2

Double Integer Variables (Long Integers)
A double integer variable is a named location in which an integer

value can be stored. It is called a double" integer because it

requires two 16Ćbit words, or 32 bits, to represent its value in the

range +2147483647 to -2147483648 (a 32Ćbit signed number). It is

named using the rules listed in section 4.1.1 and terminated with an

exclamation point (!). If you include an integer variable in a program,

its value can be an integer (no fractional part) or a real (decimal)

number. If you assign a decimal number to a double integer

variable, the fractional part will be truncated or ignored. For

example, if the statement attempts A! = 3.6574, the value 3 will be

assigned to A!.
If an attempt is made to assign a value larger than the range

-214783648 to +214783647 to a double integer variable, BASIC will

log this condition into the error log and will load the largest possible

double integer value into the variable. For example, if the statement

attempts A! = +2157483647, BASIC will log this as an error and set

a A! = +2147483647; if the statement attempts A! = -214783649,

Basic will log an error and A! will be set to = -214783648.
The following are valid double integer variables:

RESOLVER_ADDRESS!

LARGE_COUNTER!

FOREIGN_CARD_ADR!

All internal integer calculations are in double precision, or 32 bits.

4.1.1.3

Real Variables
A real variable is a named location in which a decimal value can be

stored. It is named using the rules listed in section 4.1.1. Unlike the

other variable data types, a real variable has no terminating

character, such as % or !.
A real variable can have the following values:
9.2233717 x 10

18

> positive value > 5.4210107 x 10

-20

-9.2233717 x 10

18

> negative value > -2.7105054 x 10

-20

Note: When entering real variable values in your program, use

scientific notation. See section 4.2.3 for more information on real

constant formats.
The following are examples of valid real variables:

ROLL_RATIO

GAIN_ADJUST

WINDUP_FRACTION

Only eight digits of significance are used when entering a real

number, thus 9.4481365 and 9.4481365200178 would be treated the

same way. The 200178 at the end of the second number would be

ignored. Real or decimal numbers require more time to process

while BASIC is running due to the increased accuracy and additional

internal calculations required.
It is legal to assign an integer to a real variable (REAL=45).

However, if the integer is greater than 2

24

(16777216), the real

value into which it is converted will be imprecise because of the

format in which the real numbers are manipulated (24Ćbit mantissa).

Advertising
This manual is related to the following products: