Automationdirect.com DirectLOGIC DL205 Series User Manual page 300

Table of Contents

Advertisement

Compare (CMP)
The compare instruction is a 16-bit instruction that
230
compares the value in the lower 16 bits of the
240
accumulator with the value in a specified V-memory
location (Aaaa). The corresponding status flag will be
250-1
turned on indicating the result of the comparison.
260
Operand Data Type
DS
Used
HPP Used
V-memory
Pointer
Discrete Bit Flags
SP60
SP61
SP62
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 contact C30.
DirectSOFT
Handheld Programmer Keystrokes
$
STR
SHFT
SHFT
$
STR
GX
OUT
DL230 Range DL240 Range DL250-1 Range DL260 Range
A
aaa
All
V
See memory map
P
-
On when the value in the accumulator is less than the instruction value.
On when the value in the accumulator is equal to the instruction value.
On when the value in the accumulator is greater than the instruction value.
X1
LD
K4526
Load the constant value
4526 into the lower 16 bits of
the accumulator
CMP
V2000
Compare the value in the
accumulator with the value
in V2000
SP60
C30
OUT
B
ENT
1
L
D
K
SHFT
ANDST
3
JMP
C
M
P
SHFT
ORST
CV
2
SP
G
A
SHFT
STRN
6
C
D
A
SHFT
2
3
Chapter 5: Standard RLL Instructions - Logical
aaa
All
See memory map
All V-memory.
See memory map
Description
The unused accumulator
bits are set to zero
0
0
0
Acc.
E
F
C
G
4
5
2
6
C
A
A
A
2
0
0
0
ENT
0
ENT
0
DL205 User Manual, 4th Edition, Rev. B
CMP
A aaa
aaa
aaa
All
All
See memory map
See memory map
All V-memory.
All V-memory.
See memory map
See memory map
CONSTANT
4
5
2
?
6
0
4
4
5
5
2
?
2
6
6
Compared
with
8
9
4
5
V2000
ENT
ENT
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
5–83

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DirectLOGIC DL205 Series and is the answer not in the manual?

Table of Contents

Save PDF