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;