Program instructions
7.14 Shift and rotate
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
361
The following figure shows bit shifting for negative and positive values of N.
A Shift Minus operation is indicated by a nega-
tive value of length N. The input value of DATA
shifts into the most significant bit of the shift reg-
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.
The maximum length of the shift register as-
signed by N is 64 bits (positive or negative).
Example: SHRB instruction
LAD
STL
Network 1
LD I0.2
EU
SHRB I0.3, V100.0, +4