4
4-36 Micro PLC Programmer’s Guide – April 1994
GFK-0804B
Compare Functions
The Compare functions are used to compare the contents of two registers. They can be
used to activate an output, or as conditional logic to other program functions.
The Micro PLC Instruction Set includes these Compare functions:
Equal Passes power flow to the right in the rung if the contents of
the two registers are equal.
Greater Passes power flow to the right in the rung if the number in the
first register is greater than the number in the second.
Less Passes power flow to the right in the rung if the number in the
first register is less than the number in the second.
Greater or
Equal
Passes power flow to the right in the rung if the number in the
first register is greater than or equal to the number in the se-
cond.
Less or Equal Passes power flow to the right in the rung if the number in the
first register is less than or equal to the number in the second.
Not Equal Passes power flow to the right in the rung if the number in the
first register is not the same as the number in the second.
An output in the same rung will be set to 1 when the condition being tested for is met.
Examples
Ladder Diagram
[R1 = 5]
O17
[R1 > R2]
O18
[R3 < R4]
O19
[R4 > R6]
O20
[R7 < R8]
O21
[R9 0 R10]
O22
Equal
Greater
Less
Greater or
Equal
Less or
Equal
Not Equal
Output O17 is activated when
contents of R1 = 5.
Output O18 activated when con-
tent of R1 is greater than content
of R2.
Output O19 activated when con-
tent of R3 is less than content of
R4.
Output O20 activated when con-
tent of R4 is greater than or equal
to content of R6.
Output O21 activated when con-
tent of R7 is less than or equal to
content of R8.
Output O22 activated when con-
tent of R9 is not equal to content
of R10.
46142