![IDEC OpenNet series User Manual Download Page 187](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384187.webp)
13: B
IT
S
HIFT
/ R
OTATE
I
NSTRUCTIONS
13-4
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
Examples: SFTR
• Data Type: Word
• Data Type: Double Word
M8120
REP
M8120 is the initialize pulse special internal relay.
When the CPU starts operation, the MOV (move) instruction sets 29 to
data register D10.
Each time input I0 is turned on, 16-bit data of data register D10 is
shifted to the right by 2 bits as designated by operand bits. The last bit
status shifted out is set to a carry (special internal relay M8003). Zeros
are set to the MSB.
SOTU
I0
S1 –
29
D1 –
D10
S1
D10
bits
2
SFTR(W)
MOV(W)
0
Before shift: D20 = 29
0
0
0
0
0
0
0
0 0
0
0
1
1
0
1
1
CY
M8003
MSB
LSB
D10
0
After first shift: D20 = 7
1
0
0
0
0
0
0
0 0
0
1
0
0
0
0
1
CY
M8003
MSB
LSB
D10
Bits to shift = 2
0
1
0
0
0
0
0
0
0 0
0
0
0
0
0
0
0
After second shift: D20 = 1
CY
M8003
MSB
LSB
D10
1
0
0
Shift to the right
Each time input I1 is turned on, 32-bit data of data registers D10 and
D11 is shifted to the right by 2 bits as designated by operand bits.
The last bit status shifted out is set to a carry (special internal relay
M8003). Zeros are set to the MSBs.
Bits to shift = 2
SOTU
I1
S1
D10
bits
2
SFTR(D)
0
Before shift: D10·D11 = 1,900,573
0
0
0
0
0
0
0
0 0
0
0
1
1
0
1
1
CY
M8003
MSB
LSB
D10·D11
0
After shift: D10·D11 = 475,143
1
1
0
0
0
0
0
0 0
0
1
0
0
0
0
1
CY
M8003
MSB
LSB
D10·D11
Shift to the right
1
0
0
0
0
0
0
0 0
0
1
0
0
0
0
1
0
0
0
0
0
0
0
0 0
0
0
1
1
0
1
1
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]