16-Bit Bin Data Increment; 16-Bit Bin Data Decrement - Mitsubishi MELSEC-Q/L Programming Manual

Table of Contents

Advertisement

INC, INCP, DEC, DECP
6.2.16
INC, INCP

16-bit BIN data increment

6.2.16
DEC, DECP

16-bit BIN data decrement

INC, INCP, DEC, DECP
INC, DEC
INCP, DECP
: Head number of devices for INC (+1)/DEC (-1) operation (BIN 16 bits)
D
Setting
Internal Devices
Data
Bit
Word
D
Function
INC
(1) Adds 1 to the device designated by
(2) When INC/INCP operation is executed for the device designated by
stored at the device designated by
DEC
(1) Subtracts 1 from the device designated by
(2) When DEC/DECP operation is executed for the device designated by
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]
228
Command
Command
J
\
R, ZR
Bit
Word
(16-bit data).
D
D
b15
b0
5678 (BIN)
.
D
(16-bit data).
D
D
b15
b0
5678 (BIN)
1
.
D
Outputs the present value of (0+Z1) to
Y30 to Y3F in BCD.
Executes Z1 + 1.
Sets Z1 at "0" when Z1=21 or X7
(reset input) is ON.
High
Basic
Process
performance
indicates an instruction symbol of
P
Zn
U
\G
D
b15
b0
5679 (BIN)
, whose content is 32767, the value -32768 is
D
D
b15
b0
5677 (BIN)
, whose content is -32768, the value 32767 is
D
Redundant Universal
LCPU
INC/DEC.
D
D
Constants
Other
––

Advertisement

Table of Contents
loading

Table of Contents