Rockwell-automation Logix5000 Controllers Structured Text Programming Manuale Utente Pagina 19

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 40
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 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
Vedere la pagina 18
1 2 ... 14 15 16 17 18 19 20 21 22 23 24 ... 39 40

Commenti su questo manuale

Nessun commento