EasyManuals Logo

Siemens SIMATIC S7 System Manual

Siemens SIMATIC S7
866 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 #360 background imageLoading...
Page #360 background image
Program instructions
7.14 Shift and rotate
S7-200 SMART
360 System Manual, V2.3, 07/2017, A5E03822230-AF
7.14.2
Shift register bit
The Shift Register Bit instruction shifts a bit value into the Shift Register. This instruction
provides an easy method for sequencing and controlling product flow or data. Use this
instruction to shift the entire register one bit, once per scan.
LAD / FBD
STL
Description
SHRB DATA,
S_bit, N
The shift register bit instruction shifts the bit value of DATA into the Shift Register.
S_BIT assigns the location of the least significant bit of the shift register. N assigns
the length of the Shift Register and the direction of the shift (Shift Plus = N, Shift
Minus = -N).
Each bit value shifted out by the SHRB instruction is copied to the overflow memory
bit SM1.1.
The shift register bits are defined by both the least significant bit S_BIT location and
the number of bits assigned by the length N.
Non-fatal errors with ENO = 0
SM bits affected
• 0006H Indirect address
• 0091H Operand out of range
• 0092H Error in count field
• SM1.1 Overflow (last bit shifted out)
Input / output
Data type
Operand
DATA, S_bit
BOOL
I, Q, V, M, SM, S, T, C, L
N
BYTE
IB, QB, VB, MB, SMB, SB, LB, AC, *VD, *LD, *AC, Constant
Use the following equation to compute the address of the most significant bit of the Shift
Register (MSB.b):
MSB.b =
[(Byte of S_BIT) + ([N] - 1 + (bit of S_BIT)) / 8]
.
[remainder of the division by 8]
For example: if S_BIT is V33.4 and N is 14, the following calculation shows that the MSB.b is
V35.1.
MSB.b
= V33 + ([14]
- 1 +4)/8
= V33 + 17/8
= V33 + 2 with a remainder of 1
= V35.1

Table of Contents

Other manuals for Siemens SIMATIC S7

Questions and Answers:

Question and Answer IconNeed help?

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

Siemens SIMATIC S7 Specifications

General IconGeneral
BrandSiemens
ModelSIMATIC S7
CategoryController
LanguageEnglish

Related product manuals