Program instructions
7.14 Shift and rotate
S7-200 SMART
318 System Manual, 09/2015, A5E03822230-AC
Non-fatal errors with ENO = 0
• 0006H Indirect address
• 0091H Operand out of range
• 0092H Error in count field
• SM1.1 Overflow (last bit shifted out)
I, Q, V, M, SM, S, T, C, L
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.
= V33 + 2 with a remainder of 1
The following figure shows bit shifting for negative and positive values of N.
A Shift Minus operation is indicated by a neg
a-
tive value of length N. The input value of
DATA
shifts into the most significant bit of the shift re
g-
ister, and shifts out of the least significant bit
location assigned by S_BIT. The data shifted out
is then placed in the overflow memory bit SM1.1.
A Shift Plus operation is indicated by a positive
value of length N. The input value of DATA shifts
into the least significant bit location assigned by
S_BIT and out of the most significant bit of the
Shift Register. The bit value shifted out is then
placed in the overflow memory bit SM1.1.
length of the shift register as-
signed by N is 64 bits (positive or negative).