Mitsubishi MELSEC-Q/L Programming Manual page 342

Table of Contents

Advertisement

SFR, SFRP, SFL, SFLP
SFL
(1) Shifts 16-bit data at device designated by
Bits starting from the lowest bit to n bit are filled with 0s.
Carry flag
(SM700)
1
(2) When a bit device is designated for
The number of bits by which a shift is executed is the remainder of n/(specified number of bits). For example, when n
15 and (specified number of bits)
(3) Specify any of 0 to 15 as n. If the value specified as n is 16 or greater, the remainder of n/16 is used for a shift to the left.
For example, when n
Operation Error
(1) There is no operation error in the SFR(P) or SFL(P) instruction.
Program Example
(1) The following program shifts the data of D0 to the right by the number of bits designated by D100 when X20 is turned
ON.
[Ladder Mode]
[Operation]
b15
b14 b13b12 b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D0
1
0
1
0
0
1
D100
3
b15
b14 b13b12 b11b10 b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
D0
0
0
0
1
0
1
Filled with 0s.
(2) The following program shifts the contents of X10 to X17 3 bits to the left when X1C is ON.
[Ladder Mode]
340
n bits to the left.
D
b15
b14 b13 b12 b11b10 b9
1
1
1
1
0
b15
b14 b13 b12 b11b10 b9
0
0
0
0
1
, a left shift is executed within the device range specified by digit specification.
D
X17
Carry flag
(SM700)
X17
1
8 bits, the remainder of 15/8
18, the data is shifted 2 bits to the left since the remainder of 18/16
[List Mode]
Step
1
1
0
0
1
0
1
0
0
0
1
1
1
0
0
1
[List Mode]
Step
b8
b7
b6 b5 b4 b3 b2 b1
0
1
1
0
0
0
0
1
b8
b7
b6 b5 b4 b3 b2 b1
1
1
1
0
0
0
0
0
Filled with 0s.
X14
X13
X10
0
0
1
1
0
0
1
1
X14 X13
X12
X10
1
0
0
1
1
0
0
0
Filled with 0s.
1 is "7", and the data is shifted 7 bits.
Instruction
Device
0
0
Carry flag
(SM700)
0
1
0
Instruction
Device
b0
1
1
1
D
When n=8:
b0
D
0
0
0
1 is "2".

Advertisement

Table of Contents
loading

Table of Contents