6-60
6.2 Arithmetic Operation Instructions
6.2.15 16-bit BIN data increment and decrement
INC, DEC
O
p
erat
i
on
E
rror
No operation error occurs in the execution of the INC(P) and DEC(P) instructions.
Program
E
xam
pl
e
(1) In the following program, the current values from the counter C0 to C20 are output to Y30 to
Y3F in BCD data each time X8 turns ON. (When current value is less than 9999)
[Structured ladder]
[ST]
BCDP(X8,C0Z1,K4Y30);
INCP(X8,Z1);
IF Z1=21 OR X7 THEN
RST(TRUE,Z1);
END_IF;
Outputs the current value
of C (0+21) to Y30 to Y3F
in BCD data.
Increments the value in Z1.
When the value in Z1
reaches 21, or by
resetting X7, 0 is set
to Z1.
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......