Arithmetic instructions
484
Part III FP Instructions
F115_FIFT
FIFO buffer area definition
n: memory size (number of words (16-bit)) of FIFO buffer,
n = 1 to 256.
d1: the starting 16-bit area of FIFO buffer
How to use the FIFO buffer (see page 483)
Definition of the area using the FIFT instru
ction should be carried out only once, before writing to or
reading from the FIFO buffer. When the FIFT instruction is executed, the FIFO buffer area is
defined as follows:
0
0
nd1
d1+1
d1+2
15 0
d1+3
d1+n+2
15 0
0
d1+4
d1+n+1
Memory size of FIFO buffer (n)
Number of stored data items (words),
written and not read
FIFO pointer
Data [0]
Data
storage
area
(n words)
Data [1]
Data [n-1]
Data [n-2]
Writing pointer
(0 to 255/16#00 to 16FF)
Reading pointer
(0 to 255/16#00 to 16FF)
When the FIFT instruction is executed, the following are stored as default values: d1 = n (the value
specified by the FIFT instruction), d1 + 1 = 0, and d1 + 2 = 16#0000.
This instruction also exists as a P instruction (for FP2/2SH, FP3/5, FP10/10SH PLC types), which
is only executed at the rising edge of the EN trigger. Select [Insert P instruction] from the
"Instructions" pane if you require a P instruction. To facilitate reuse, the instruction then appears
under "Recently used" in the pop-up menu. Press <Ctrl>+<Shift>+<v> within the programming
area to open the list of recently used elements.
PLC types Availability of F115_FIFT (see page 1320)
Variable Data type Function
n INT specifies the memory size of FIFO buffer
d1 ANY16 starting 16-bit area of FIFO buffer
Description
F115 specifies the starting area d1 for the FIFO (First-In-First-Out) buffer and the memory size n of
the FIFO buffer.
Data types