Rockwell-automation 9301 Series RSView32 Users Guide Manuel d'utilisateur Page 525

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 769
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 524
14–12 RSView32 User’s Guide
Logical operators
Logical operators determine the validity of one or more statements.
There are three logical operators: AND, OR, and NOT. The operators
return a non–zero value if the expression is true, or a zero if the
expression is false.
The logical operators are:
Bitwise operators
Bitwise operators examine and manipulate individual bits within a
value.
Symbols Operator Action Example
(For these examples, tag1 = 5 and
tag2 = 7)
AND,
&&
and Returns a 1 if the
statements to the right
and to the left of the
operator are both true.
(tag1 < tag 2) AND (tag1 == 5)
both statements are true; returns a 1
OR, || or Returns a 1 if either
the statement to the
left or to the right of
the operator is true.
(tag1 > tag2) OR (tag1 == 5)
tag1 == 5 is true; returns a 1
NOT negation Reverses the logical
value of the statement
it operates on.
NOT(tag1 < tag2)
although tag1 < tag2 is true, NOT reverses
the logical value; returns a 0
The parentheses are essential in the above expressions. See
“Evaluation order of operators” on page 14-22.
IMPORTANT
These operators are for integers only, not floating point numbers.
IMPORTANT
Vue de la page 524
1 2 ... 520 521 522 523 524 525 526 527 528 529 530 ... 768 769

Commentaires sur ces manuels

Pas de commentaire