289
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
11 Rotation and Shift Operation – FNC 30 to FNC 39
11.9 FNC 38 – SFWR / Shift Write [FIFO/LIFO Control]
11
FN
C30-
FN
C39
R
o
ta
tion and
Sh
ift
12
FNC
4
0
-FNC49
D
a
ta
Op
e
ra
tio
n
13
FNC5
0
-FNC5
9
H
igh Speed
Pr
ocessi
ng
14
FM
C6
0
-F
NC6
9
H
and
y
In
st
ru
cti
o
n
15
FNC7
0
-FNC7
9
Ex
te
rn
a
l F
X
I
/O
D
evi
ce
16
FNC8
0
-FNC8
9
Ext
e
rnal
FX
D
evi
ce
17
F
N
C1
00
-F
NC
10
9
Da
ta
Tr
ansf
e
r 2
18
FN
C
110-FN
C
13
9
Fl
oat
ing P
o
in
t
19
FN
C
140-FN
C
149
Da
ta
O
per
at
io
n
2
20
FN
C
15
0-F
N
C
159
P
o
si
tioni
ng
C
ont
ro
l
Program example
1. Example of first-in first-out control
→
For a program example of last-in first-out, refer to Section 27.3.
In the example below, the shift write (SFWR) and shift read (SFRD) instructions are used.
1) Contents of operation
- In this circuit example, a product number to be taken out now is output according to "first-in first-out" rule
while products which were put into a warehouse with their product numbers registered are taken out of
the warehouse.
- The product number is hexadecimal, and up to 4 digits. Up to 99 products can be stored in the
warehouse.
2) Program
X020
FNC 12
MOVP
K4X000
D256
FNC 38
SFWRP
D256
D257
K100
X021
FNC 39
SFRDP
D257
D357
K100
FNC 12
MOV
D357
K4Y000
M8000
RUN
monitor
Button for request to take a
product out of warehouse
Button for request to put a
product into warehouse
The product number is input from X000 to X017, and
transferred to D256.
Pointer
D257: Data register for storing the product number
D258 to D356 (99 points)
The product number of a product put into first is output
to D357 in response to the request to put a product out
of the warehouse.
The product number to be taken out is output to Y000
to Y017 in a four-digit hexadecimal number.
1234
D256
MOV instruction
0320
0
0232
0462
0539
0142
0
0
D258
D259
D260
D261
D262
D263
D355
D356
0
5
D257
0
0
4
0
Shift
0232
0462
0539
0142
0
0
+1
SFRDP instruction
is executed.
SFWRP instruction
is executed.
−
1
0320
D357
0
0
0320
0
0232
0462
0539
0142
1234
6
100
99
1
7
2
3
4
5
6
MOV instruction
1
2
3
4
Request to
put a
product into
warehouse
Request to
take a
product out
of warehouse
X20
X21
Digital switch 0000 to FFFF
Seven-segment display unit
Y017 to Y000
X017 to X000
Command
Command