309
FX3G/FX3U/FX3UC 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/FILO Control]
11
FNC30-FNC39
Rotation and
Shift
12
FNC40-FNC49
Data Operation
13
FNC50-FNC59
High Speed
Processing
14
FMC60-FNC69
Handy
Instruction
15
FNC70-FNC79
External FX I/O
Device
16
FNC80-FNC89
External FX
Device
17
FNC100-FNC109
Data
Transfer 2
18
FNC110-FNC139
Floating Point
19
FNC140-FNC149
Data
Operation 2
20
FNC150-FNC159
Positioning
Control
Explanation of function and operation
1. 16-bit operation (SFWR and SFWRP)
The contents of are written to "n-1" devices from +1, and "1" is added to the number of data stored in
.
For example, when = 0, the contents of are written to +1. When = 1, the contents of
are written to +2.
1) When X000 turns ON from OFF, the contents of are stored to +1. So the contents of +1
become equivalent to .
2) When the contents of are changed and then the command input is set to ON from OFF again, the new
contents of are stored to +2. So the contents of +2 become equivalent to . (When the
continuous operation type SFWR instruction is used, the contents are stored in each operation cycle. Use the
pulse operation type SFWRP instruction in programming.)
3) Data are stored from the right end in the same way, and the number of stored data is specified by the contents of
the pointer .
Related device
→ For the carry flag use method, refer to Subsection 6.5.2.
Related instructions
Caution
1. In the case of continuous operation type (SFWR) instruction
Note that data are stored (overwritten) in each scan time (operation cycle).
Device Name Description
M8022 Carry
When the contents of the pointer exceeds "n-1", no operation is executed (so data is not written)
and the carry flag M8022 turns ON.
Instruction Description
SFRD (FNC 39) Shift read (for FIFO control)
POP (FNC212) Shift last data read (for FILO control)
S
D
D
D
S
D
D
S
D
n
Command
input
FNC 38
SFWRP
D
S
Before
execution
After
execution
D
D+n ... D+2D+10 D+9 D+8 D+7 D+6 D+5 D+4 D+3 D+1
n
S
D
D+n ... D+2D+10 D+9 D+8 D+7 D+6 D+5 D+4 D+3 S
D
D+n ... S
D+10 D+9 D+8 D+7 D+6 D+5 D+4 D+3 S
+1
→
D
+1
→
Executed at the 2nd time
(K1)(K0)
(K2)
(K1)
Executed at the 1st time
( = 0)
D
Pointer
Pointer
Pointer
S
D
D
D
S
S
D
D
S
S
S
D
D
S
D
D