228
INC, INCP, DEC, DECP
: Head number of devices for INC (+1)/DEC (-1) operation (BIN 16 bits)
Function
INC
(1) Adds 1 to the device designated by (16-bit data).
(2) When INC/INCP operation is executed for the device designated by , whose content is 32767, the value -32768 is
stored at the device designated by .
DEC
(1) Subtracts 1 from the device designated by (16-bit data).
(2) When DEC/DECP operation is executed for the device designated by , whose content is -32768, the value 32767 is
stored at the device designated by .
Operation Error
(1) There is no operation error in the INC(P) or DEC(P) instruction.
Program Example
(1) The following program outputs the present value at the counter C0 to C20 to the area Y30 to Y3F in BCD, every time X8
is turned ON. (When present value is less than 9999)
[Ladder Mode]
INC, INCP
16-bit BIN data increment
DEC, DECP
16-bit BIN data decrement
6.2.16
INC, INCP, DEC, DECP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
Other
Bit
Word
Bit
Word
––
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
P
D
D
INC, DEC
INCP, DECP
indicates an instruction s
y
mbol of
INC/DEC.
D
D
D
5679
(
BIN
)
b0
5678
(
BIN
)
b15
D
b0
b15
D
D
D
D
1
5677
(
BIN
)
b0
5678
(
BIN
)
b15
D
b0
b15
D
D
D
Outputs the present value of
(
0+
Z
1
)
to
Y30 to Y3F in BCD.
Executes
Z
1 + 1.
Sets
Z
1 at "0" when
Z
1=21 or X7
(
reset input
)
is ON.