EasyManua.ls Logo

Automationdirect.com DL05 - Compare (CMP)

Automationdirect.com DL05
480 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Standard
RLL Instructions
5–61
Standard RLL Instructions
Accumulator Logic Instructions
CMP
A aaa
The compare instruction is a 16 bit
instruction that compares the value in the
lower 16 bits of the accumulator with the
value in a specified V memory location
(Aaaa). The corresponding status flag
will be turned on indicating the result of
the comparison.
Operand Data Type DL05 Range
A aaa
V memory V All (See page 4–28)
Pointer P All (See page 4–28)
Discrete Bit Flags Description
SP60 On when the value in the accumulator is less than the instruction value.
SP61 On when the value in the accumulator is equal to the instruction value.
SP62 On when the value in the accumulator is greater than the instruction
value.
NOTE: The status flags are only valid until another instruction that uses the same
flags is executed.
In the following example when X1 is on, the constant 4526 will be loaded into the
lower 16 bits of the accumulator using the Load instruction. The value in the
accumulator is compared with the value in V2000 using the Compare instruction.
The corresponding discrete status flag will be turned on indicating the result of the
comparison. In this example, if the value in the accumulator is less than the value
specified in the Compare instruction, SP60 will turn on energizing C30.
Handheld Programmer Keystrokes
V2000
Acc.
Constant
4526
8945
0000 4526
LD
Compare the value in the
accumulator with the value
in V2000
Load the constant value
4526 into the lower 16 bits of
the accumulator
K4526
CMP
X1
V2000
Compared
with
SP60 C30
DirectSOFT
The unused accumulator
bits are set to zero
STR
$
SHFT
ANDST
L
3
D
SHFT
JMP
K
4
E
5
F
2
C
6
G
ENT
SHFT
2
C
ORST
M
CV
P
STR
$
SHFT ENT
STRN
SP
6
G
0
A
OUT
GX
SHFT
2
C
3
D
0
A
ENT
1
B
ENT
2
C
0
A
0
A
0
A
ENTSHFT
Compare
(CMP)

Table of Contents

Related product manuals