Allen-Bradley PLC-5 User Manual page 306

Enhanced and ethernet plc-5 programmable controllers
Hide thumbs Also See for PLC-5:
Table of Contents

Advertisement

D-6
Instruction Set Quick Reference
Instruction
CMP
COMPARE
Expression
N7:5 = N7:10
xxx
xxxxxxxxxxxxx
Source A
Source B
Publication 1785-UM012D-EN-P - July 2005
Compare
CMP
Source A
10
N7:5
5
3
N7:10
21
1
-30
-15
Equal to
EQU
Greater than or Equal
GEQ
Greater than
GRT
Less than or Equal
LEQ
Less than
LES
Not Equal
NEQ
Description
If the expression is true, this input instruction is true. The CMP
instruction can perform these operations: equal (=), less than
(<), less than or equal (<=), greater than (>), greater than or
equal (>=), not equal (<>), and complex expressions (up to 80
characters).
Source B
EQU
GEQ
10
T
T
6
F
F
20
F
T
-31
F
T
-14
F
F
If the value in Source A (N7:5) is = to the value in Source B
(N7:10), this instruction is true.
If the value in Source A (N7:5) is > or = the value in Source B
(N7:10), this instruction is true.
If the value in Source A (N7:5) is > the value in Source B
(N7:10), this instruction is true.
If the value in Source A (N7:5) is < or = the value in Source B
(N7:10), this instruction is true.
If the value in Source A (N7:5) is < the value in Source B
(N7:10), this instruction is true.
If the value in Source A (N7:5) is not equal to the value in
Source B (N7:10), this instruction is true.
GRT
LEQ
LES
NEQ
F
T
F
F
F
T
T
T
T
F
F
T
T
F
F
T
F
T
T
T

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents