Siemens Simatic S7-200 System Manual page 268

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Instruction Set
Shift Right Byte, Shift Left Byte
L
A
EN
D
IN
N
EN
IN
N
S
SRB
T
L
SLB
212
214
Shift Right Word, Shift Left Word
L
A
EN
D
IN
N
EN
IN
N
S
SRW
T
L
SLW
212
214
10-80
The Shift Right Byte and Shift Left Byte instructions shift the
input byte value right or left by the shift count (N), and load the
SHR_B
result in the output byte (OUT).
OUT
Operands:
OUT
SHL_B
OUT
OUT
The shift instructions fill with zeros as each bit is shifted out.
If the shift count (N) is greater than or equal to 8, the value is
OUT, N
shifted a maximum of 8 times. If the shift count is greater than 0,
the overflow memory bit takes on the value of the last bit shifted
OUT, N
out.
Shift right and shift left byte operations are unsigned.
215
216
Note: When programming in LAD, if you specify IN to be the
same as OUT, you can reduce the amount of memory required.
These instructions affect the following Special Memory bits:
SM1.0 (zero); SM1.1 (overflow)
The Shift Right Word and Shift Left Word instructions shift the
input word value right or left by the shift count (N), and load the
SHR_W
result in the output word (OUT).
OUT
Operands:
OUT
SHL_W
OUT
OUT
The shift instructions fill with zeros as each bit is shifted out.
If the shift count (N) is greater than or equal to 16, the value is
OUT, N
shifted a maximum of 16 times. If the shift count is greater than
zero, the overflow memory bit takes on the value of the last bit
OUT, N
shifted out.
Shift right and shift left word operations are unsigned.
215
216
Note: When programming in LAD, if you specify IN to be the
same as OUT, you can reduce the amount of memory required.
These instructions affect the following Special Memory bits:
SM1.0 (zero); SM1.1 (overflow)
IN:
VB, IB, QB, MB, SMB, SB, AC, *VD,
*AC
N:
VB, IB, QB, MB, SMB, SB, AC,
Constant, *VD, *AC
OUT:
VB, IB, QB, MB, SMB, SB, AC, *VD,
*AC
IN:
VW, T, C, IW, MW, SMW, AC, QW,
AIW, Constant, *VD, *AC, SW
N:
VB, IB, QB, MB, SMB, AC, Constant,
*VD, *AC, SB
OUT:
VW, T, C, IW, QW, MW, SMW, AC,
*VD, *AC, SW
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents