Rockwell-automation 1771-DB BASIC MODULE Manuel d'utilisateur Page 119

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 394
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 118
Chapter
Expressions, Variables and Operators
9
9 -9
Relational expressions involve the operators =, < >, >, >=, <, and <=.
In the BASIC module, you typically use relational operations to test a
condition.
The BASIC module relational operators return a result of 65535 (0FFFFH)
if the relational expression is true, and a result of 0 if the relation
expression is false. The result returns to the argument stack. Because of
this, it is possible to display the result of a relational expression.
>PRINT
1=0
0
>
PRINT 1>0
65535
>
PRINT A<>A
0
>
PRINT A=A
65535
You can chain relational expressions with the logical operators .AND.,
.OR., and .XOR. (page 9 -8). This makes it possible to test a complex
condition with one statement.
>10
IF (A>E).AND.(A>C).OR.(A>D)THEN...
Additionally, you can use the NOT operator (page 9 -11).
>10
IF NOT(A>E).AND.(A>C)THEN...
Important: When using logical operators to link relational expressions,
you must be sure operations are performed in the proper sequence.
When in doubt, use parentheses.
Relational Operators
Vue de la page 118
1 2 ... 114 115 116 117 118 119 120 121 122 123 124 ... 393 394

Commentaires sur ces manuels

Pas de commentaire