Mitsubishi Electronics FXCPU Video Game Controller User Manual


 
10 Applied Instructions (Rotation and Shift Operation)
10.10 SFRD / Shift Read [FIFO Control]
223
FXCPU Structured Programming Manual
[Basic & Applied Instruction]
1
Outline
2
Instruction List
3
Configuration of
Instruction
4
How to Read
Explanation of
Instructions
5
Basic Instruction
6
Step Ladder
Instructions
7
Applied Instructions
(Program Flow)
8
Applied Instructions
(Move and
Compare)
9
Applied Instructions
(Arithmetic and
Logical Operation)
10
Applied Instructions
(Rotation and
Shift Operation)
Function and operation explanation
1. 16-bit operation (SFRD, SFRDP)
The data of the device specified by [ +1] written in turn by SFWR instruction is transferred (read) to the
device specified by , and "n-1" words from the device specified by +1 are shifted rightward by 1
word. "1" is subtracted from the number of data stored in the device specified by .
1) When the command contact turns ON, the contents of the device specified by [ +1] are transferred
(read) to the device specified by .
2) Accompanied by this transfer, the contents of the pointer specified by decrease, and the data on the
left side are shifted rightward by 1 word. (When the continuous operation type SFRD instruction is used,
the contents are shifted in turn in each operation cycle. Use the pulse operation type SFRDP instruction
in programming.)
Related device
For the zero flag use method, refer to Section 1.3.4.
Related instructions
Cautions
1) The contents of the device specified by [ +n] do not change by reading.
2) In the case of continuous operation type (SFRD) instruction, data is read in turn in each scan time
(operation cycle), but the contents of the device specified by [ +n] do not change.
3) When pointer specified by is "0", data is not processed, and the contents of the device specified by
do not change.
4) Some restrictions to applicable devices
S1:The FX
3G, FX3GC, FX3U and FX3UC PLCs only are applicable.
S2:The FX
3U and FX3UC PLCs only are applicable.
Program examples
Refer to the program example provided for SFWR instruction.
Device Name Description
M8020 Zero
Data is always read from the device specified by [ +1]. When the contents of the pointer specified
by become "0", the zero flag M8020 turns ON.
Instruction Description
SFWR Shift write (for FIFO/FILO control)
POP Last-in data read (for FILO control)
Command input
Readout data
Storing device
SFRD
EN
s
n
ENO
d
Number of pieces
of data
ss+n ··· s+2s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3 s+1
d
n
d
ss+n ··· s+2s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3s+n
d
ss+n ··· s+10 s+9 s+8 s+7 s+6 s+5 s+4 s+3s+ns+n
–1
Executed at the 2nd time
Executed at the 1st time
s+2
Word data is shifted.
Word data is shifted.
s+1
= n
Pointer
Pointer
Pointer
–1
s
s
s s
s
Before
execution
After
execution