Rockwell-automation 57C610 Enhanced Basic Language, AutoMax Uživatelský manuál Strana 22

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 146
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 21
4Ć2
AutoMax Enhanced BASIC has variable types" just as standard
BASIC does. The variable type indicates the kind of information the
variable is representing (numeric data, characters, etc.). The
variable type is specified by a terminator or ending character.
BASIC uses five types of variables:
1.
Single integer variables (values -32768 to +32767)
2. Double integer variables (values -2147483648 to
+2147483647)
3.
Real variables (values 9.2233717E+18 to -9.2233717E+18).
Note that the E+(n)" is read as an exponent in BASIC.
4. Boolean variables [values TRUE (ON) or F
ALSE (OFF)]
5. String variables.



A single integer variable is a named location in which an integer
value can be stored. It is called a single" integer because it requires
a single 16Ćbit word to represent its current value in the range
+32767 to -32768 (a 16Ćbit signed number). It is named using the
rules listed in section 4.1.1 are terminated with a percent sign (%).
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 an 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
+32767 to -32768 to a single integer variable, BASIC will log this
condition into the error log and will load the largest possible single
integer value into the variable. For example, if the statement
attempts A% = 43987, BASIC will log this as an error and set a A%
= 32767; if the statement attempts A% = -53667, Basic will log an
error and A% will be set to = -32768.
The following are valid single integer variables:
MOTOR_SPEED%
FREQUENCY%
ROLL_WIDTH%
VOLTAGE_REF%
The following are invalid single integer variables and the reasons
that they are invalid:
GAIN


GAIN%2 
55SPEED% 

All internal integer calculations are in double precision, or 32 bits.
Zobrazit stránku 21
1 2 ... 17 18 19 20 21 22 23 24 25 26 27 ... 145 146

Komentáře k této Příručce

Žádné komentáře