IEC 1131-3 Instructions
10-20
S7-200 Programmable Controller System Manual
A5E00066097-02
Increment, Decrement
The Increment and Decrement functions add or subtract
1 to or from IN and place the result into OUT.
Increment and decrement byte operations are unsigned.
Error conditions that set ENO = 0: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
These functions affect the following Special Memory bits:
SM1.0 (zero); SM1.1 (overflow), SM1.2 (negative)
Inputs/Outputs Operands Data Types
IN VB, IB, QB, MB, SB, SMB, LB, VW, IW, QW, MW, SW, SMW, LW, T,
C, AIW, VD, ID, QD, MD, SD, SMD, LD, HC, AC, Constant, *VD,
*AC, *LD
BYTE, INT,
DINT
OUT VB, IB, QB, MB, SB, SMB, LB, VW, IW, QW, MW, SW, SMW, T, C,
LW, VD, ID, QD, MD, SMD, SD, LD, AC,*VD, *AC, *LD
BYTE, INT,
DINT
Increment, Decrement Example
LAD
INC
EN
IN%VD96 OUT %AC0
DEC
EN
IN
%VD100
OUT
%VD100
125
increment
VD96
126AC0
128000
127999
Application
decrement
VD100
VD100
%I4.0
Increment Word Decrement Double Word
FBD
ENOENO
INC
EN
IN%VD96 OUT %AC0
ENO%I4.0
DEC
EN
IN OUT
ENO
%VD100 %VD100
Figure 10-8 Example of Increment/Decrement Functions for LAD and FBD
L
A
D
INC
EN
IN OUT
DEC
EN
IN OUT
F
B
D
ENO
ENO
222 224
✓✓✓
221 226
✓