EasyManua.ls Logo

Siemens SIMATIC S7 - Increment and Decrement

Siemens SIMATIC S7
866 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Program instructions
7.8 Math
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
305
7.8.4
Increment and decrement
LAD / FBD
STL
Description
INC_W
INC_DW
INCB OUT
INCW OUT
INCD OUT
The increment instructions add 1 to the input value IN and place the result into the
location at OUT.
LAD and FBD: IN + 1 = OUT
STL: OUT + 1 = OUT
Increment byte (INC_B) operations are unsigned. Increment word (INC_W) operations
are signed. Increment double word (INC_DW) operations are signed.
DEC_W
DEC_DW
DECB OUT
DECW OUT
DECD OUT
The decrement instructions subtract 1 from the input value IN and place the result into
the location at OUT.
LAD and FBD: IN - 1 = OUT
STL: OUT - 1= OUT
Decrement byte (DEC_B) operations are unsigned. Decrement Word (DEC_W) opera-
tions are signed. Decrement double Word (DEC_D) operations are signed.
Non-fatal errors with ENO = 0
SM bits affected
0006H Indirect address
SM1.1 Overflow
SM1.0 Result of operation = zero
SM1.1 Overflow, illegal value generated during the operation, or illegal input
SM1.2 Negative result
Input / output
Data type
Operand
IN
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
INT
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AIW, *VD, *LD, *AC, Constant
DINT
ID, QD, VD, MD, SMD, SD, LD, AC, HC, *VD, *LD, *AC, Constant
OUT
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *AC, *LD
INT
IW, QW, VW, MW, SMW, SW, T, C, LW, AC,*VD, *LD, *AC
DINT
ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *LD, *AC

Table of Contents

Other manuals for Siemens SIMATIC S7

Related product manuals