![background image](http://html1.mh-extra.com/html/eaton/elc-pb/elc-pb_programming-manual_4017452235.webp)
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-66
API Mnemonic
Operands
Function
20
D ADD P
S
1
, S
2
, D
Addition
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
*
*
*
*
*
*
*
*
ADD, ADDP: 7 steps
DADD, DADDP: 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
: Augend
S
2
: Addend
D
: Addition result
Description:
1.
The data contained within the source devices (
S
1
,
S
2
) are added together and the result is
stored at the specified destination device (
D
).
2.
The most significant bit is the sign bit. 0 indicates positive and 1 indicates negative. All
calculation are algebraically processed, i.e. 3
+
(-9)
=
-6.
3. If
operands
S
1
,
S
2
,
D
use index register F, then only 16-bit instruction is available.
4.
Flags: M1020 (Zero flag), M1021 (Borrow flag), M1022 (Carry flag)
Program Example 1:
16-bit instruction:
When X0 = ON, the data in D0 and data in D10 are added together and the result stored in D20.
D0 and D10 are unchanged.
X0
ADD
D0
D10
D20
(D0)
+
(D10)
=
(D20)
Program Example 2:
32-bit instruction:
When X0 = ON, the data in (D31, D30) and data in (D41, D40) are added together and the result
stored in (D51, D50). (D31, D30) and (D41, D40) are unchanged. (D30, D40, D50 is the lower
16-bit data, while D31, D41, D51 is the higher 16-bit data)
X0
DADD
D30
D40
D50
(D31, D30)
+
(D41, D40)
=
(D51, D50)
Содержание 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...