Increment And Decrement Instructions; Increment Word, Decrement Word; Increment, Decrement Example - Siemens Simatic S7-200 CPU 210 System Manual

Table of Contents

Advertisement

5.6

Increment and Decrement Instructions

Increment Word, Decrement Word

L
A
INC_W
D
EN
IN
DEC_W
EN
IN
S
INCW
T
L
DECW

Increment, Decrement Example

I0.0
Figure 5-6
Example of Increment/Decrement Instructions
S7-200 Programmable Controller, CPU 210
C79000-G7076-C235-01
The Increment Word and Decrement Word instructions add or
subtract 1 to or from the input word.
Operands:
OUT
In ladder:
OUT
In STL:
Increment and decrement word operations are signed
OUT
(16#7FFF > 16#8000).
OUT
When programming in ladder, if you specify the address for IN
to be the same address as OUT, you can reduce the amount of
memory required.
These instructions affect the following Special Memory bits:
SM1.0 (zero); SM1.1 (overflow); SM1.2 (negative)
LAD
INC_W
EN
MW0
IN
OUT
MW0
DEC_W
EN
MW2
IN
OUT
MW2
Application
Increment Word
MW0
125
increment
MW0
126
IN:
T, C, MW
OUT:
T, C, MW
IN + 1 = OUT
IN - 1 = OUT
OUT + 1 = OUT
OUT - 1 = OUT
STL
Network
LD
I0.0
INCW
MW0
DECW
MW2
Decrement Word
MW2
5000
decrement
MW2
4999
Instruction Set
5-9

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents