EasyManuals Logo

Automationdirect.com DirectLOGIC DL205 Series User Manual

Automationdirect.com DirectLOGIC DL205 Series
587 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
Page #303 background imageLoading...
Page #303 background image
DL205 User Manual, 4th Edition, Rev. B
5–86
Chapter 5: Standard RLL Instructions - Logical
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
Compare with Stack (CMPS)
The Compare with Stack instruction is a 32-bit
instruction that compares the value in the
accumulator with the value in the first level of the
accumulator stack.
The corresponding status flag will be turned on
indicating the result of the comparison. This does
not affect the value in the accumulator.
NOTE: Status flags are valid only until another instruction uses the same flag.
In the following example when X1 is on, the value in V1400 and V1401 is loaded into the
accumulator using the Load Double instruction. The value in V1410 and V1411 is loaded
into the accumulator using the Load Double instruction. The value that was loaded into the
accumulator from V1400 and V1401 is placed on top of the stack when the second Load
instruction is executed. The value in the accumulator is compared with the value in the first
level of the accumulator stack using the CMPS 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 in the stack, SP60 will turn on, energizing C30.
C MP S
ý
ý
ý
þ
230
240
250-1
260
X1
Acc.
6500 3544
V1400
3544
SP60
C30
OUT
V1401
6500
Acc.
5500 3544
V1410
3544
V1411
5500
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
2
C
ORST
M
CV
P
STR
$
STRN
SP
OUT
GX
3
D
RST
S
1
B
ENT
ENTSHFT
1
B
4
E
0
A
0
A
ENT
SHFT
ANDST
L
3
D
3
D
1
B
4
E
1
B
0
A
ENT
SHFT
Compared with
Top of Stack
LDD
V1400
LDD
V1410
CMPS
Load the value in V1400 and
V1401 into the accumulator
Load the value in V1410 and
V1411 into the accumulator
Compare the value in the
accumulator with the value
in the first level of the
accumulator stack
DirectSOFT
ENT
0
A
SHFT
2
C
3
D
0
A
6
G
ENT
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.
DS Used
HPP Used

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Automationdirect.com DirectLOGIC DL205 Series Specifications

General IconGeneral
BrandAutomationdirect.com
ModelDirectLOGIC DL205 Series
CategoryController
LanguageEnglish

Related product manuals