FC6A S
ERIES
MICROS
MART
L
ADDER
P
ROGRAMMING
M
ANUAL
FC9Y-B1726
7-13
7: B
INARY
A
RITHMETIC
I
NSTRUCTIONS
INC (Increment)
DEC (Decrement)
Valid Devices
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the INC and DEC instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Valid Data Types
Increment beyond Limits
When the S/D value is at its maximum and is incremented by one, the value returns to 0, turning on the carry (M8003).
Decrement beyond Limits
When the S/D value is at its minimum and is decremented by one, the value returns to its maximum value (word or double-word
data) or to –1 (integer or long data), turning on the internal relay M8003 (carry or borrow).
Example: INC
Example: DEC
Data type W or I:
S/D + 1
→
S/D
Data type D or L:
S/D·S/D+1 + 1
→
S/D·S/D+1
When input is on, one is added to the 16- or 32-bit data assigned by device S/D and the result is stored to
the same device.
INC(*)
S/D
*****
Data type W or I:
S/D – 1
→
S/D
Data type D or L:
S/D·S/D+1 – 1
→
S/D·S/D+1
When input is on, one is subtracted from the 16- or 32-bit data assigned by device S/D and the result is
stored to the same device.
DEC(*)
S/D
*****
Device
Function
I
Q
M
R
T
C
D
P
Constant
Repeat
S/D (Source/Destination)
Device to increment data
—
—
—
—
—
—
X
—
—
—
W (word)
X
When a word device such as D (data register) is assigned as the source/destination, 1 point (word or integer
data) or 2 points (double-word or long data) are used.
I (integer)
X
D (double word)
X
L (long)
X
F (float)
—
S/D
D10
When input I0 is turned on, the data of D10 is incremented by one.
If SOTU is not programmed, the data of D10 is incremented in each scan.
I0
INC(W)
SOTU
100
D10
+
101
D10
1
S/D
D20
I1
DEC(W)
SOTU
When input I1 is turned on, the data of D20 is decremented by one.
If SOTU is not programmed, the data of D20 is decremented in each scan.
100
D20
–
99
D20
1
Summary of Contents for MICROSmart FC6A Series
Page 1: ...B 1726 7 FC6A SERIES Ladder Programming Manual ...
Page 8: ...Preface 7 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 32: ...1 OPERATION BASICS 1 20 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 96: ...3 INSTRUCTIONS REFERENCE 3 18 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 130: ...4 BASIC INSTRUCTIONS 4 34 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 192: ...9 SHIFT ROTATE INSTRUCTIONS 9 12 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 272: ...12 DISPLAY INSTRUCTIONS 12 24 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 284: ...14 REFRESH INSTRUCTIONS 14 6 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 502: ...25 DATA LOG INSTRUCTIONS 25 22 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 546: ...26 SCRIPT 26 44 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...
Page 598: ...APPENDIX A 14 FC6A SERIES MICROSMART LADDER PROGRAMMING MANUAL FC9Y B1726 ...