Rockwell-automation Logix5000 Controllers Structured Text Programming Manuel d'utilisateur Page 19

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 40
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 18
Publication 1756-PM007D-EN-P - November 2012 19
Program Structured Text Chapter 1
Use Bitwise Operators
Bitwise operators manipulate the bits within a value based on two values.
For example:
Determine the Order of Execution
The operations you write into an expression are performed in a prescribed
order, not necessarily from left to right.
Operations of equal order are performed from left to right.
If an expression contains multiple operators or functions, group the
conditions in parenthesis “( )”. This ensures the correct order of
execution and makes it easier to read the expression.
For Use this operator Optimal Data Type
Bitwise AND &, AND DINT
Bitwise OR OR DINT
Bitwise exclusive OR XOR DINT
Bitwise complement NOT DINT
Use this format Example
For this situation You’d write
value1 operator value2 If input1, input2, and result1 are DINT tags and your
specification says: “Calculate the bitwise result of
input1 and input2. Store the result in result1.”
result1 := input1 AND input2;
Order Operation
1. ( )
2. function (…)
3. **
4. - (negate)
5. NOT
6. *, /, MOD
7. +, - (subtract)
8. <, <=, >, >=
9. =, <>
10. &, AND
11. XOR
12. OR
Vue de la page 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 39 40

Commentaires sur ces manuels

Pas de commentaire