
102
D320 PLC User's Manual
Arithmetic Instruction Details
Instruction
Mnemonic
Addition
Range
Bit
■
Word
ADD
DADD
ADDB
DADDB
Decimal addition (ADD, DADD)
BCD addition (ADDB, DADDB)
■
Double words
Ladder
D = S1 + S2
Decimal:
S1 = 21, and S2 = 22
Hexadecimal: S1 = $15 and S2 = $16
ADD Example:
Decimal: 21 + 22 = 43
ADDB Example:
BCD:
$15 + $16 = $31
Description
1. Add the data in the S1 and S2 addresses, then store the result in the D register.
2. When using ADD and ADDB, the calculation ranges are as follows:
S1: 0 to 65,535 ($0000 to $FFFF)
S2: 0 to 65,535 ($0000 to $FFFF)
D: 0 to 65,535 ($0000 to $FFFF)
3. When using DADD and DADDB, the calculation ranges are as follows:
S1: 0 to 4,294,976,295 (0 to $FFFFFFFF)
S2: 0 to 4,294,976,295 (0 to $FFFFFFFF)
D: 0 to 4,294,976,295 (0 to $FFFFFFFF)
4. If the result exceeds the range of calculation, a carry occurs. The carry flag (F1.8) is changed
to On.
5. This operation will occur on every scan for which the input condition is true (On). To perform
the operation only on a change of input condition, use the rising/falling edge contact.
ADD
D =
S1 =
S2 =
R
R
ADDB
D =
S1 =
S2 =
Содержание D320 PLC
Страница 1: ...D320 PLC User s Manual...
Страница 18: ...6 D320 PLC User s Manual...
Страница 28: ...16 D320 PLC User s Manual...
Страница 34: ...22 D320 PLC User s Manual...
Страница 78: ...66 D320 PLC User s Manual...
Страница 176: ...164 D320 PLC User s Manual...
Страница 210: ...198 D320 PLC User s Manual...
Страница 258: ...246 D320 PLC User s Manual...