beautypg.com

Data manipulation, First in - first out (fifo), Figure 10.18—first in - first out function block – Watlow LogicPro User Manual

Page 151

background image

LogicPro User’s Guide

Chapter 10: Function Blocks

Doc.# 28002-00 Rev 3.00

Watlow Anafaze

135

assigned a value out of these ranges, ENO is disabled. C reverts
to its last valid value whenever ENO is disabled.

Data

Manipulation

The following section contains a description of the data
manipulation function blocks found in the standard category.

First In - First Out (FIFO)

The First In - First Out (FIFO) function block, shown in Figure
10.18
, creates and manipulates a stack of integers.

FIFO moves the contents of the input Variable (INP) to the
stack when it encounters a False to True transition of the load
bit (LD). The size of the stack is specified by assigning a
constant to the SIZE parameter. The count Variable (CNT)
tracks the number of integers in the stack.

When the stack is filled with integers, the full bit (FUL)
becomes True. This bit only remains True as long as the count
of integers in the stack is equal to the size of the stack. A False
to True transition of the unload bit (UNLD) moves the first
integer entered in the stack to the output Variable (OUTP) and
changes the output bit (Q) to True. Every succeeding False to
True transition of the unload bit moves the oldest integer from
the stack to the output Variable and causes the output bit to
remain True until the entire stack is unloaded.

At this point, the count Variable equals zero, the output bit is
False, and the empty bit (EMP) is True. This bit only remains
True as long as the count of integers in the stack is equal to
zero. A True condition of the clear bit (CLR) clears the stack
of any integer values and resets the count Variable to zero,
thus causing the empty bit to be True. The output Variable
retains its last value when the stack is cleared.

Figure 10.18 First In - First Out Function Block