157
SFT, SFTP
1
2
3
4
5
6
7
8
5.4
S
hift Instr
uctions
5.4.1
S
FT
, SFTP
5.4
Shift Instructions
: Device number to shift (bits)
Function
(1) When bit device is used
(a) Shifts to a device designated by the ON/OFF status of the device immediately prior to the one designated by ,
and turns the prior device OFF.
For example, if M11 has been designated by the SFT instruction, when the SFT instruction is executed, it will shift
the ON/OFF status of M10 to M11, and turn M10 OFF.
(b) Turn the first device to be shifted ON with the SET instruction.
(c) When the SFT and SFTP are to be used consecutively, the program starts from the device with the larger number.
(2) When word device bit designation is used
(a) Shifts to a bit in the device designated by the 1/0 status of the bit immediately prior to the one designated by ,
and turns the prior bit to 0.
For example, if D0.5 (bit 5 [b5] of D0) has been designated by the SFT instruction, when the SFT instruction is
executed, it will shift the 1/0 status of b4 of D0 to b5, and turn b4 to 0.
SFT, SFTP
Bit device shift
5.4.1
SFT, SFTP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
Other
DY
Bit
Word
Bit
Word
(Other than T, C)
––
Basic
Process
High
performance
Redundant Universal
LCPU
Command
Command
SFTP
SFT
D
SFT
D
SFTP
D
D
D
D
M0
Sh
i
ft
i
nput
M1
4
S
FT
P
H
ead
dev
i
ce
to
sh
i
ft
(
1
)
0
0
M15 M1
4
0
M13
0
M12
0
M11
1
M10
1
M9
0
M8
M13
S
FT
P
M12
S
FT
P
M11
S
FT
P
M10
S
ET
(
7
)
0
0
1
0
0
0
1
0
(
2
)
0
0
0
0
1
0
1
0
(
3
)
0
0
0
1
0
0
1
0
(4)
0
0
0
1
0
1
1
0
(
5
)
0
0
1
0
1
0
1
0
(
6
)
1
0
0
1
0
0
1
0
Sh
i
ft
range
X02
O
N
After
the
1st
sh
i
ft
i
nput
After
the
2nd
sh
i
ft
i
nput
X02
O
N
After
the
3rd
sh
i
ft
i
nput
After
the
4
th
sh
i
ft
i
nput
After
the
5th
sh
i
ft
i
nput
X2
*
At
M8
to
M15
, "
1
" i
nd
i
cates
O
N
and
"
0
" i
nd
i
cates
O
FF.
0
0
0
0
0
D
D
1
Before the
execution of shift
0
0 0 1 0 0 0 1 1 0 1 0 0 0 1
to b0
b4
to
b15
b5
1
After the
execution of shift
0
0 0 1 0 0 0 1 1 1 0 0 0 0 1
0
D0