Rockwell-automation 57C610 Enhanced Basic Language, AutoMax Manual de usuario Pagina 38

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 146
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 37
5Ć6
D When a boolean value is combined with an integer value, the
boolean is always treated as the value zero (0) if it is FALSE and
one (1) if it is TRUE
.
The following statement illustrates these rules:
A% = SYSTEM
DOWN@*(SPEED_REFERENCE - 2.3376)
The value of this statement will be 0 if SYSTEM_DOWN@ is FALSE
or (SPEED_REFERENCE - 2.3376) if SYSTEM_DOWN@ is TRUE.
When a boolean operator is used to combine the two different data
types, it performs a bitĆwise or bitĆforĆbit operation on the two values,
treating the boolean as either an integer one (1) or zero (0):
LOWER_BYTE% = ANALOG_IN% AND OFFH
This operation will mask" off the upper 8 bits of the value
ANALOG_IN%, which can be useful when manipulating integers as
binary data.
5.4 Relational Expressions
It is often necessary in BASIC to compare different values and,
based on the result of that comparison, perform one of several
actions. These comparisons are done with relational operators and
are usually used in conjunction with the IF
ĆTHEN statement to create
conditional transfers or conditional executions of different parts of a
program. Table 5.4 lists the valid relational or comparison operators
and their meanings.
In forming relational expressions, similar data types must be
compared, i.e., numeric types must be compared to other numeric
types. It would be illegal to compare a boolean or integer
expression to a string expression using a relational operator.
Table 5.4 Ć Relational or Comparison Operators
Operator Example Meaning
=
A = B
A is equal to B
<
A < B
A is less than B
>
A > B
A is greater than B
< =
A < = B
A is less than or equal to B
> =
A > = B
A is greater than or equal to B
< >
A < > B
A is not equal to B
> <
A > < B
A is not equal to B
Vista de pagina 37
1 2 ... 33 34 35 36 37 38 39 40 41 42 43 ... 145 146

Comentarios a estos manuales

Sin comentarios