Inc (Increment); Dec (Decrement) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

INC (Increment)

INC(*)
*****

DEC (Decrement)

DEC(*)
S/D
*****
Valid Devices
Device
S/D (Source/Destination)
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
W (word)
X
I (integer)
X
D (double word)
X
L (long)
X
F (float)
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
INC(W)
SOTU
I0
Example: DEC
DEC(W)
SOTU
I1
Data type W or I:
Data type D or L:
S/D
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.
Data type W or I:
Data type D or L:
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.
Function
Device to increment data
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.
S/D
D10
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.
S/D
D20
D20
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.
FC6A S
MICROS
ERIES
S/D + 1 → S/D
S/D·S/D+1 + 1 → S/D·S/D+1
S/D – 1 → S/D
S/D·S/D+1 – 1 → S/D·S/D+1
I
Q
100
+
1
D10
100
1
D20
L
P
MART
ADDER
ROGRAMMING
7: B
A
INARY
RITHMETIC
M
R
T
C
D
P
X
101
99
M
FC9Y-B1726
ANUAL
I
NSTRUCTIONS
Constant
Repeat
7-13

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents