EasyManuals Logo

Siemens Simatic S7 Series System Manual

Siemens Simatic S7 Series
726 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
Page #315 background imageLoading...
Page #315 background image
Program instructions
7.14 Shift and rotate
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
315
7.14
Shift and rotate
7.14.1
Shift and rotate
Shift instructions (only the byte size LAD box is illustrated, the others are similar)
LAD / FBD
STL
Shift type
Description
SLB OUT,
N
SRB OUT,
N
Shift left byte
Shift right byte
The shift instructions shift the bit values of input value IN right or left by
the bit position shift count N and load the result in the memory location
assigned to OUT.
The shift instructions fill empty bit positions with zero as each bit is shift-
ed out. If the shift count N is greater than or equal to the maximum al-
lowed (8 for byte operations, 16 for word operations, and 32 for double
word operations), the value is shifted the maximum number of times for
the operation. If the shift count is greater than 0, the overflow memory bit
SM1.1 is set to the value of the last bit shifted out. The SM1.0 zero
memory bit is set if the result of the shift operation is zero.
Byte operations are unsigned. For word and double word operations, the
sign bit is shifted when you use signed data values.
SHL_W
SHR_W
SLW OUT,
N
SRW OUT,
N
Shift left word
Shift right word
SHL_DW
SHR_DW
SLD OUT,
N
SRD OUT,
N
Shift left double
word
Shift right double
word
Non-fatal errors with ENO=0
SM bits affected
0006H Indirect address SM1.0 Result of operation = zero
SM1.1 Overflow (last bit shifted out)
Input / out-
put
Data type
Operand
IN
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
WORD
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, AIW, *VD, *LD, *AC, Constant
DWORD ID, QD, VD, MD, SMD, SD, LD, AC, HC, *VD, *LD, *AC, Constant
OUT
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC
WORD
IW, QW, VW, MW, SMW, SW, T, C, LW, AC, *VD, *LD, *AC
DWORD
ID, QD, VD, MD, SMD, SD, LD, AC, *VD, *LD, *AC
N
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant

Table of Contents

Other manuals for Siemens Simatic S7 Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Siemens Simatic S7 Series and is the answer not in the manual?

Siemens Simatic S7 Series Specifications

General IconGeneral
CPUVaries by model (e.g., S7-300, S7-400, S7-1200, S7-1500)
Communication InterfacesPROFIBUS, PROFINET, Ethernet, MPI
ProgrammingTIA Portal, STEP 7
Programming LanguagesLAD, FBD, STL, SCL, GRAPH
I/O ModulesDigital, Analog, Specialty modules available
Operating Temperature0°C to 60°C (standard models)
MountingDIN rail mounting
Operating Voltage24V DC or 120/230V AC (varies by model)
Protection ClassIP20 (standard models)
MemoryVaries depending on the S7 model. Includes work memory (RAM) for program execution, load memory (EEPROM or Flash) for program storage, and system memory for operating system functions. Memory sizes range from kilobytes to megabytes.

Related product manuals