9 Applied Instructions (Arithmetic and Logical Operation)
9.5 INC / Increment
182
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
Cautions
1) Instructions of pulse operation type are not provided in the FX0S, FX0 or FX0N PLC.
To execute pulse operation, make the instruction execution condition pulse type.
2) Note that data is incremented in every operation cycle in a continuous operation type instruction.
3) In a 16-bit operation, when "+32,767" is incremented by "1", the result is "-32,768". Flags (zero, borrow
and carry) are not activated at this time.
4) In a 32-bit operation, when "+2,147,483,647" is incremented by "1", the result is "-2,147,483,648". Flags
(zero, borrow and carry) are not activated at this time.
5) Some restrictions to applicable devices
S1:The FX
3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S2:The FX
3U and FX3UC PLCs only are applicable.
Program examples
0 (Z)
(C 0Z) (K4Y000)
BIN BCD
(Z)+1 (Z)
When (Z) is 10
M 1=ON
The current values of counter C0 to C9 are BCD
converted, and the result is outputted into
K4Y000.
Z is cleared by reset input X010.
Every time X011 turns ON, the current values
are outputted one at a time in the order of
C0, C1, ... and C9.
X010
MOVP
EN
s
ENO
d
K0
Z
M1
Z
INCP
EN ENO
d
BCDP
EN
s
ENO
d
CN0Z
K4Y000
X011
CMPP
EN
s1
s2
ENO
d
K10
Z
M0
[Structured ladder/FBD]
[ ST ]
MOVP(X010 OR M1, K0, Z);
BCDP(X011, CN0Z, K4Y000);
INCP(X011, Z);
CMPP(X011, K10, Z, M0);