EasyManua.ls Logo

Automationdirect.com DL06 - Page 245

Automationdirect.com DL06
533 pages
Print Icon
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...
DL06 Micro PLC User Manual, 3rd Edition, Rev. E
5-84
Chapter 5: Standard RLL Instructions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
A
B
C
D
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.
CMPS
X1
Acc.
6500 3544
V1400
354 4
SP60
C30
OU
T
V1401
6500
Acc.
5500 3544
V1410
354 4
V1411
5500
DirectSOFT32
Handheld Programmer Keystrokes
STR
$
SHFT
ANDST
L
3
D
SHFT
2
C
ORST
M
CV
P
STR
$
PREV ENT
6
G
0
A
OUT
GX
SHFT
2
C
3
D
0
A
ENT
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
NEXT NEXT NEXT
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
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
DirectSOFT
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 data format for
this instruction is BCD/Hex, Decimal and Binary.