EasyManua.ls Logo

Delta DVP-ES2 - Page 173

Delta DVP-ES2
1006 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...
DVP-ES2/EX2/EC5/SS2/SA2/SX2/SE&TP Operation Manual - Programming
3-52
API
Mnemonic Operands Function
Controllers
ES2/EX2/
EC5
SS2
SA2
SE
SX2
10 D CMP P
Compare
Type
OP
Bit Devices Word devices Program Steps
X Y M S K H KnX
KnY
KnM
KnS
T C D E F
CMP, CMPP: 7 steps
DCMP, DCMPP: 13 steps
S
1
*
*
*
*
*
*
*
*
*
*
*
S
2
*
*
*
*
*
*
*
*
*
*
*
D
*
*
*
PULSE
16-bit
32-bit
ES2/EX2
/EC5
SS2
SA2
SE
SX2
ES2/EX2
/EC5
SS2
SA2
SE
SX2
ES2/EX2
/EC5
SS2
SA2
SE
SX2
Operands:
S
1
: Comparison Value 1 S
2
: Comparison Value 2 D: Comparison result
Explanations:
1. The contents of S
1
and S
2
are compared and D stores the comparison result.
2. The comparison values are signed binary values. If b15=1 in 16-bit instruction or b31=1 in
32-bit instruction, the comparison will regard the value as a negative binary value.
3. Operand D occupies 3 continuous devices. D, D +1, D +2 hold the comparison results,
D = ON if S
1
> S
2
, D +1 = ON if S
1
= S
2
, D +2 = ON if S
1
< S
2
4. If operand S
1
, S
2
use index register F, only 16-bit instruction is available.
Program example:
1. If D is set as Y0, then Y0, Y1, Y2 will display the comparison results as shown below.
2. When X20 = ON, CMP instruction is executed and one of Y0, Y1, Y2 will be ON. When X20 =
OFF, CMP instruction is not executed and Y0, Y1, Y2 remain in their previous condition.
X20
Y0
Y1
Y2
CMP
K10 D10 Y0
If K10>D10, Y0 = On
If K10=D10, Y1 = On
If K10<D10, Y2= On
3. Use RST or ZRST instruction to reset the comparison result.
X10
RST
M0
RST
RST
M1
M2
X10
ZRST
M0
M2

Table of Contents

Other manuals for Delta DVP-ES2

Related product manuals