omron — Logic and arithmetic operators

Appendix: Built-in Scripting Language Logic and arithmetic operators The built-in scripting language supports the following logic and arithmetic operators. Logic operators Tip: For more complex logic, try the Logical and Loop functions.

Arithmetic operators InduSoft Web Studio Page 441 Operator Usage Description AND A AND B TRUE if A and B are both TRUE OR A OR B TRUE if A is TRUE, or B is TRUE, or both XOR A XOR B TRUE if A is TRUE, or B is TRUE, but not both NOT NOT A TRUE if A is FALSE = X = Y TRUE if X is equal to Y > X > Y TRUE if X is greater than Y >= X >= Y TRUE if X is greater than or equal to Y X TRUE if X is less than Y X TRUE if X is less than or equal to Y X Y TRUE if X is not equal to Y & X & Y Bitwise AND: 0101 (decimal 5) AND 0011 (decimal 3) = 0001 (decimal 1) | X | Y Bitwise OR: 0101 (decimal 5) OR 0011 (decimal 3) = 0111 (decimal 7) ^ X ^ Y Bitwise XOR:

0101 (decimal 5) XOR 0011 (decimal 3) = 0110 (decimal 6) ~ ~ X Bitwise NOT: NOT 0101 (decimal 5) = 1010 (decimal 10) >> n X >> Y Rotate n bits to right: 0110 (decimal 6) ROTATE RIGHT = 0011 (decimal 3) X Rotate n bits to left: 0110 (decimal 6) ROTATE LEFT = 1100 (decimal 12) Operator Usage Description + X + Y Add (plus)