Use Bitwise Operators; Determine The Order Of Execution - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Appendix C
Structured Text Programming
Use this format
value1 operator value2
678
Use Bitwise
Bitwise operators manipulate the bits within a value based on two values.
For
Bitwise AND
Bitwise OR
Bitwise exclusive OR
Bitwise complement
This is an example.
Example
For this situation
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.'

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.
Order
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Operators
Use this operator
&, AND
OR
XOR
NOT
Operation
( )
function (...)
**
− (negate)
NOT
*, /, MOD
+, - (subtract)
<, <=, >, >=
=, <>
&, AND
XOR
OR
Optimal data type
DINT
DINT
DINT
DINT
Write
result1 := input1 AND input2;

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents