beautypg.com

Rockwell Automation GMLC Reference Manual User Manual

Page 506

background image

Publication GMLC-5.2 - November 1999

Expression Operators

469

Specifically, if inputs 2 - 5 are currently in the following states, the
expression above is evaluated as 11 (1001

2

| 0010

2

= 1011

2

= 11

10

).

Input 2 =

ON

Input 3 =

OFF

Input 4 =

OFF

Input 5 =

ON

Boolean NOT

!

Use the exclamation point to complement a single-bit (Boolean) logic
element. This is especially useful for forming logical expressions
involving status bits, discrete I/O, timers, etc. For example, the following
expression has a value of 1(true) if currently there is not a hardware
overtravel fault condition on Axis 0 (neither of the overtravel limit switch
inputs for Axis 0 is active).

!Hardware_overtravel_fault_AXIS0

Boolean AND

&&

Use the double ampersand to logically

AND

together two Boolean (single-

bit) logic elements. This is especially useful for forming logical
expressions involving status bits, discrete I/O, timers, etc. For example,
the following expression has a value of 1(true) only when both input 8
and input 9 are

ON

.

Input_8 && Input_9

Boolean OR

||

Use the double pipe (vertical bar) to logically

OR

together two Boolean

(single-bit) logic elements. This is especially useful for forming logical
expressions involving status bits, discrete I/O, timers, etc. For example,
the following expression has a value of 1(true) when there is currently a
drive fault condition (drive fault input active) on Axis 0 or Axis 1.

Drive_fault_AXIS0 || Drive_fault_AXIS1