Increment, Decrement Example - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

IEC 1131-3 Instructions
Increment, Decrement
L
A
D
EN
F
B
IN
D
EN
IN
221
222 224
Inputs/Outputs
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
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

Increment, Decrement Example

%I4.0
%VD96
%I4.0
EN
%VD96
IN
Figure 10-8
10-20
The Increment and Decrement functions add or subtract
1 to or from IN and place the result into OUT.
INC
ENO
Increment and decrement byte operations are unsigned.
OUT
Error conditions that set ENO = 0: SM1.1 (overflow),
SM4.3 (run-time), 0006 (indirect address)
DEC
These functions affect the following Special Memory bits:
ENO
SM1.0 (zero); SM1.1 (overflow), SM1.2 (negative)
OUT
226
Operands
INC
EN
ENO
IN
OUT
%AC0
INC
ENO
%VD100
OUT
%AC0
Increment Word
VD96
125
increment
AC0
126
Example of Increment/Decrement Functions for LAD and FBD
LAD
DEC
EN
ENO
IN
OUT
%VD100
%VD100
FBD
DEC
EN
ENO
IN
OUT
%VD100
Application
Decrement Double Word
VD100
128000
decrement
VD100
127999
S7-200 Programmable Controller System Manual
Data Types
BYTE, INT,
DINT
BYTE, INT,
DINT
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents