Mitsubishi Electronics FX2C Home Theater Server User Manual


 
FX Series Programmable Controlers Applied Instructions 5
5-40
5.4.10 SFRD (FNC 39)
Operation:
The source device (S) identifies the head address
of the FIFO stack. Its contents reflect the last entr
y
point of data on to the FIFO stack, i.e. where the
end of the FIFO is (current position).
This instruction reads the first piece of data from
the FIFO stack (re
g
ister S
+1
), moves all of the data
within the stack ‘up’ one position to fill the read
area and decrements the contents of the FIFO
head address (S) b
y
1. The read data is written to
the destination device (D).
When the contents of the source device (S) are
equal to ‘0’ (zero), i.e. the FIFO stack is empt
y
, the
fla
g
M8020 is turned ON.
Points to note:
a) FIFO is an abbreviation for ‘First-In/ First-OUT’.
b) Onl
y
n
-1
pieces of data ma
y
be read from a FIFO stack. This is because the stack requires
that the first re
g
ister, the head address (S) is used to contain information about the current
len
g
th of the FIFO stack.
c) This instruction will alwa
y
s read the source data from the re
g
ister S
+1
.
d) This instruction should be used in con
j
unction with SFWR FNC 38. The n parameter in both
instructions should be equal.
Mnemonic Function
Operands
Program steps
SD n
SFRD
FNC 39
(Shift
re
g
ister read)
This instruction
reads and
reduces FIFO
stack- must be
used with SFWR
FNC 38
KnY, KnM,
KnS,
T, C, D,
KnY,
KnM,KnS,
T, C, D
KnY, KnM,
KnS,
T, C, D,
KnY,
KnM,KnS,
T, C, D, V, Z
K,H,
Note:
2
n
512
SFRD,
SFRDP:
7 steps
X1
SFRD
D 20 K 10
[ S ] [ D ]
D 1
[ n ]
D 20D 10 D 9 D 8 D 7 D 6 D 5 D 4 D 3 D 2 D 1
[D]
= 10
[n]