Arithmetic instructions
492
Part III FP Instructions
F117_FIFW
Write to FIFO buffer
How to use the FIFO buffer (see page 483)
The spe
cified data is written to the address indi
cated by the writing pointer when the instruction is
executed.
d1
d1+1
d1+2
15 0
d1+n+2
d1+n+1
[s]
d1+3
Writing
pointer
Data storage area
(n words)
Number of stored data items (words), written
and not read
Memory size of FIFO buffer (n)
Writing pointer in lower byte
Data [0]
Data [n-2]
Data [n-1]
(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 writing pointer is
stored in the lower eight bits of the third word of the FIFO buffer area, and is
indicated by a relative position in the data storage area. The actual address to which data is being
written is specified by d1 plus the offset 3 plus the value of the writing pointer (the value of which
only the lower byte is a decimal value).
When the writing is executed, 1 is added to the number of stored data items, and the writing pointer
is incremented by 1, or reset to zero if the writing 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 F117_FIFW (see page 1320)
Variable Data type Function
s 16-bit area or equivalent constant for storing data to write in
the FIFO buffer
d1
ANY16
starting 16-bit area of FIFO buffer
The variables s and d1 have to be of the same data type.
Description
F/P117 writes the data specified by s into the FIFO buffer specified by d1.
Data types