Chapter 6: Instructions
101
Instruction
Mnemonic
Decrement
Range
Bit
■
Word
DEC
DDEC
DECB
DDECB
Decrement (DEC, DDEC)
BCD decrement (DECB, DDECB)
■
Double words
Ladder
D = D - 1: Decimal decrement
D = D - 1: BCD decrement
Description
1. DEC and DDEC decrease D by 1 down to 0 when the input is On.
2. DECB and DDECB decrease D by 1 in BCD to 0 when the input is On.
3. Word instructions (DEC, DECB) process 16 bit data, double word instructions(DDEC,
DDECB) process 32 bit data.
Example
Program Expression
Time Chart
DEC
D =
R
R
DECB
D =
LET
D = M10
S = $11
LET
D = M12
S = $11
R000.1
R
DEC
D = M10
DECB
D = M12
R000.2
R
R0.1 R0.2 M10 (decimal) M12 (BCD)
...... 0 0 0 0 0 0 0 0
...... 0 0 0 0 0 0 0 0
...... 0 0 0 1 0 0 0 1
...... 0 0 0 1 0 0 0 0
...... 0 0 0 0 1 1 1 1
...... 0 0 0 0 1 1 1 0
...... 0 0 0 1 0 0 0 1
...... 0 0 0 1 0 0 0 0
...... 0 0 0 0 1 0 0 1
...... 0 0 0 0 1 0 0 0
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...