4

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 Passes power flow to the right in the rung if the number in the

Equal 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

O17

[R1 = 5]

O18

[R1 > R2]

O19

[R3 < R4]

O20

[R4 > R6]

O21

[R7 < R8]

O22

[R9 0 R10]

46142

Equal

Output O17 is activated when

 

contents of R1 = 5.

 

Output O18 activated when con-

Greater

tent of R1 is greater than content

 

of R2.

 

Output O19 activated when con-

Less

tent of R3 is less than content of

 

R4.

 

Output O20 activated when con-

Greater or

tent of R4 is greater than or equal

Equal

to content of R6.

Less or

Output O21 activated when con-

Equal

tent of R7 is less than or equal to

 

content of R8.

Not Equal

Output O22 activated when con-

 

tent of R9 is not equal to content

 

of R10.

4-36

Micro PLC Programmer's Guide ± April 1994

GFK-0804B

Page 77
Image 77
GE GFK-0804B manual Compare Functions, Examples, Equal, Greater, Less