Structured Text Programming
516 Rockwell Automation Publication 1756-RM006K-EN-P - November 2018
Bitwise operators manipulate the bits within a value based on two values.
The following provides an overview of the bitwise operators.
For Use this operator Optimal data type
bitwise AND &, AND DINT
bitwise OR OR DINT
bitwise exclusive OR XOR DINT
bitwise complement NOT DINT
This is an example.
Use this format Example
For this situation Use
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;
See also
Structured Text Components: Expressions on page 513
Use logical operators to verify if multiple conditions are true or false. The result of
a logical operation is a BOOL value.
If the comparison is The result is
true 1
false 0
Use these logical operators.
For this comparison Use this operator Optimal data type
logical AND &, AND BOOL
logical OR OR BOOL
logical exclusive OR XOR BOOL
logical complement NOT BOOL