Specifications

SIMATIC Instructions
9-122
S7-200 Programmable Controller System Manual
C79000-G7076-C233-01
Shift and Rotate Examples
LAD STL
LD I4.0
RRW AC0, 2
SLW VW200, 3
I4.0
ROR_W
EN
IN
N
AC0
2
OUT
AC0
SHL_W
EN
IN
N
VW200
3
OUT VW200
Application
Before rotate
AC0
Zero Memory Bit (SM1.0) = 0
Overflow Memory Bit (SM1.1) = 0
x
Overflow
1010 0000 0000 0000
After first rotate
AC0 1
Overflow
0101 0000 0000 0000
After second rotate
AC0 0
Overflow
0100 0000 0000 0001
Before shift
VW200
Zero Memory Bit (SM1.0) = 0
Overflow Memory Bit (SM1.1) = 1
x
Overflow
1100 0101 0101 1010
After first shift
VW200 1
Overflow
1000 1010 1011 0100
After second shift
VW200 1
Overflow
1110 0010 1010 1101
0001 0101 0110 1000
After third shift
VW200 1
Overflow
Rotate Shift
FBD
ROR_W
EN
IN
N
AC0
2
OUT
AC0
SHL_W
EN
IN
N
VW200
3
OUT VW200
ENO
ENO
ENO
ENO
I4.0
Figure 9-39 Example of Shift and Rotate Instructions for LAD, STL, and FBD