Logical operators – Rockwell Automation GMLC Reference Manual User Manual
Page 503
Publication GMLC-5.2 - November 1999
466
The Expression Builder
100@60
The integer remainder is useful to calculate the fractional part when one
element is divided into another. For example, in a feeding application, the
integer remainder of the total material fed and the length of each piece is
the position within the current piece. Thus, the following expression
returns the position within the current piece at any time (assuming that the
actual position of Axis 0 was zero when the machine was started).
Actual_Position_AXIS0@Cut_Length
Specifically, if the current actual position of Axis 0 is 1285.39 position
units and the Cut_Length variable is 25, the expression above evaluates to
10.39 indicating that 10.39 position units of the current piece (piece 52)
have been fed.
Logical Operators
Use logical operators to combine logical (true/false) variables to make
decisions. Logical operators are divided into bitters operators and
Boolean operators. Bitwise operators are used with multiple-bit binary
values, such as the value of an input group. Boolean operators are used to
combine single-bit logical values and variables.
The logical operators you can use in an expression consist of those shown
in the table below.
~
(tilde) — Bitwise NOT (1’s Complement)
&
(ampersand) — Bitwise AND
|
(pipe) — Bitwise OR
!
(exclamation point) — Boolean NOT
&&
(double ampersands) — Boolean AND
| |
(double pipes) — Boolean OR