Delta DVP-ES2 User Manual Page 176

  • Download
  • Add to my manuals
  • Print
  • Page
    / 702
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 175
DVP-ES2/SA2/SS2/SA2/SX2/SE Operation Manual - Programming
3-60
API Mnemonic Operands Function
10
D CMP P
Compare
Controllers
ES2/EX2 SS2
SA2
SE
SX2
Bit Devices Word devices Program Steps Type
OP
X Y M S K H KnX KnY KnM KnS T C D E F
S
1
* * * * * * * * ***
S
2
* * * * * * * * ***
D * * *
CMP, CMPP: 7 steps
DCMP, DCMPP: 13 steps
PULSE 16-bit 32-bit
ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 SS2
SA2
SE
SX2 ES2/EX2 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
Page view 175
1 2 ... 171 172 173 174 175 176 177 178 179 180 181 ... 701 702

Comments to this Manuals

No comments