7.3 Shift Instructions
7.3.1 n-bit right/left shift of 16-bit data
7-43
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
SFR, SFL
SFR, SFL
Program Example
(1) In the following program, the data in Var_D0 are shifted to the right by the number of bits
specified for Var_D100 when X20 turns ON.
[Structured ladder]
[ST]
Var_D0:=3;
SFRP(X20,Var_D0,Var_D100);
[Operation]
(2) In the following program, the data in the devices from X10 to X17 are shifted 3 bits to the left
when X1C turns ON.
[Structured ladder]
[ST]
SFLP(X1C,3,K2Y10);
[Operation]
0
1
0
1
0
1
1
1
0
0
1
0
1
0
0
0
b14 b13b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
0
b15
C
arr
y
f
l
ag
(SM700)
Become
0
1
0
0
0
0
1
0
0
1
1
1
0
0
1
0
1
b14 b13b12 b11 b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
b15
Var
_
D
100
Var
_
D
0
Var
_
D
0
3
0
0
1
1
0
0
1
1
1
0
0
1
1
0
0
0
X
14
X
13
X
13
X
14
1
X
17
X
10
X
17
X
10
C
arr
y
f
l
ag
(SM700)
Become
0
X
12
W
hen
n
=5:
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......