Arithmetic instructions
488
Part III FP Instructions
F116_FIFR
Read from FIFO buffer
How to use the FIFO buffer (see page 483)
Rea
ding of data is done st
arting from the address specified by the reading pointer when the
instruction is executed.
d1+n+1
d1
d1+1
d1+2
15 0
d1+n+2
[d2]
d1+3
Memory size of FIFO buffer (n)
Number of stored data items (words),
written and not read
Data [0]
Data [n-2]
Data [n-1]
Reading pointer in upper byte
Data storage area
(n words)
Reading
pointer
(0), (n–2) and (n–1) are addresses assigned to the data storage area.
n is the value specified by the F115_FIFT (see page 483) instruction.
The reading pointe
r is stored in the upper eight bits of the third word of the FIFO buffer area. The
actual address is the value of the leading address in the FIFO buffer area specified by d1 plus 3,
plus the value of reading pointer (the value of which only the first byte is a decimal value).
When the reading is executed, 1 is subtracted from the number of stored data items, and the
reading pointer is incremented by 1, or reset to zero if the reading pointer pointed to the final
element.
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 F116_FIFR (see page 1320)
Variable Data type Function
d1 starting 16-bit area of FIFO buffer
d2
ANY16
16-bit area for storing data read from FIFO buffer
The variables d1 and d2 have to be of the same data type.
For Relay T/C Register Const.
d1, d2 - WY WR WL SV EV DT LD FL -
Description
F/P116 reads the data d1 from the FIFO (First-In-First-Out) buffer and stores the data in area
specified by d2.
Data types
Operands