Chapter 6: Instructions
107
Instruction
Command
Addition with Carry
Range
Bit
■
Word
ADC
DADC
ADCB
DADCB
Decimal addition with carry (ADC,
DADC)
BCD addition with carry (ADCB,
DADCB)
■
Double words
Ladder
D = S1 + S2 + carry
Decimal:
S1 = 21, and S2 = 22
Hexadecimal: S1 = $15 and S2 = $16
Carry Flag:
F1.8 = On
ADC Example:
Decimal:
21 + 22 + 1 = 44
ADCB Example:
BCD:
$15 + $16 + $1 = $32
Description
1. Add the data in the S1 and S2 addresses. If the carry flag F1.8 is On, add 1, otherwise add 0.
Then store the result in the D register.
2. When using ADC and ADCB, 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.
ADC
D =
S1 =
S2 =
R
R
ADCB
D =
S1 =
S2 =
Summary of Contents for D320 PLC
Page 1: ...D320 PLC User s Manual...
Page 18: ...6 D320 PLC User s Manual...
Page 28: ...16 D320 PLC User s Manual...
Page 34: ...22 D320 PLC User s Manual...
Page 78: ...66 D320 PLC User s Manual...
Page 176: ...164 D320 PLC User s Manual...
Page 210: ...198 D320 PLC User s Manual...
Page 258: ...246 D320 PLC User s Manual...