Chapter 4. Ladder Diagram (LD) Programming
178
PACSystems* RX7i, RX3i and RSTi-EP CPU Programmer's Reference Manual
GFK-2950C
4.9.3
FIFO Read
The First-In-First-Out (FIFO) Read (FIFO_RD) function moves data out of
tables. Values are always moved out of the bottom of the table. If the
pointer reaches the last location and the table becomes full, FIFO_RD
must be used to remove the entry at the pointer location and
decrement the pointer by one. FIFO_RD is used in conjunction with the
FIFO_WRT function, which increments the pointer and writes entries
into the table.
Mnemonics:
FIFO_RD_DINT
FIFO_RD_DWORD
FIFO_RD_INT
FIFO_RD_UINT
FIFO_RD_WORD
1.
FIFO_RD copies the top location (entry 0) of the table to output parameter Q. Additional program
logic must then be used to place the data in the input reference.
2.
The remaining items in the table are copied to a lower numbered position in the table.
3.
FIFO_RD decrements the pointer by one.
4.
Steps 1, 2, and 3 are repeated each time FIFO_RD is executed, until the table is empty (PTR = 0).
The pointer does not wrap around when the table is full.
When FIFO_RD receives power flow, the data at the first location of the table is copied to output Q.
Next, each item in the table is moved down to the next lower location. This begins with item 2 in the
table, which is moved into position 1. Finally, the pointer is decremented. If this causes the pointer
location to become 0, the output EM is set ON, i.e., EM indicates whether or not the table is empty.
FIFO_RD passes power to the right if the pointer is greater than zero and less than the value
specified for LEN.
Note:
A FIFO table is a queue. A LIFO table is a stack.
Operands for FIFO Read
Note:
For each mnemonic, use the corresponding data type for the TB and Q operands. For
example, FIFO_RD_DINT requires TB and Q to be DINT variables.
Parameter
Description
Allowed Operands
Optional
Length (??)
1
Length
32,767.
Constants
No
TB (must be the same type as
Q)
The elements in the FIFO table All except constants
No
PTR
Pointer. Index of the last
element of the FIFO table.
All except constants, data flow,
and variables in %S -%SC
No
EM
Energized when the last
element of the table is read
Flow
No
Q (must be the same type as
TB)
The element read from the FIFO
table
All except constants, S; SA, SB, SC
allowed only for WORD, DWORD
No
Summary of Contents for PACSystems RSTi-EP
Page 357: ......
Page 466: ...Chapter 9 Diagnostics GFK 2950C February 2018 451 ...