E L C P r o g r a m m i n g M a n u a l
F o r m o r e i nf o r m a t i o n v i sit :
w w w. e a t o n . c o m
MN05003003E
3-52
API Mnemonic
Operands
Function
10
D CMP P
S
1
, S
2
, D
Compare
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
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32 16
P
32 16
P
32 16
P
32 16 P 32 16 P
Operands:
S
1
: First comparison value
S
2
: Second comparison value
D
: Comparison result (starting bit
address – uses 3 consecutive bit addresses)
Description:
1. The
contents
of
S
1
and
S
2
are compared and
D
denotes the compare result.
2. Operand
D
occupies 3 continuous bits (Y, M or S).
3.
The values are binary values. If bit 15=1 in 16-bit instruction or bit 31=1 in 32-bit instruction,
the comparison will regard the value as a negative binary value.
4.
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
5. If
operand
S
1
,
S
2
use index register F, only a 16 bit compare is available.
Program Example:
1. If
D
is set to Y0, then Y0, Y1, Y2 will display the results of the compare as shown below.
2.
When X20=ON, the CMP instruction is executed and one of Y0, Y1, Y2 will be ON. When
X20=OFF, the CMP instruction is not executed and Y0, Y1, Y2 remain in their previous states.
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 instructions to reset the comparison result.
Содержание ELC-PB
Страница 1: ......
Страница 5: ...For more information visit www eaton com MN05003003E iv...
Страница 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Страница 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Страница 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Страница 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...