M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.7 Rotation Instructions
Operation errors
There are no arithmetic errors associated with the SFR(P) or SFL(P) instructions.
Program example
The following program shifts the contents of Y10 to Y1B to the right by the number of bits designated by D0 when X20 goes
ON.
X20
0
4
Y1B
Y18
Y17
1 0 1 0 1 0 1 0 1 0 1 0
D0
4
Y1B
Y18
Y17
0 0 0 0 1 0 1 0 1 0 1 0
Becomes 0
The following program shifts the contents of X10 to X17 3 bits to the left when X1C is ON.
X1C
0
4
Y17
0
0
1
Carry flag
(SM12)
Y17
1
1
0
0
IB-1501667-B
[Ladder mode]
SFR K3Y10 D0
END
Y14 Y13
Y10
Y14 Y13
Y10
[Ladder mode]
SFLP K2Y10 K3
END
Y14 Y13
Y10
1
0
0
1
1
Y14 Y13
Y10
1
1
0
0
0
0
Becomes 0
Steps
0
1
4
Carry flag
(SM12)
1
Steps
0
1
4
290
[List mode]
Inst.
Device
LD
X20
SFR
K3Y10
D0
END
[List mode]
Inst.
Device
LD
XC
SFLP
K2Y10
K3
END