FIFO Load (FFL) and FIFO Unload (FFU) Instructions
[Main Course Page]
| ||The FFL and FFU instructions are
used together. The FFL loads logic words into a user created file called a FIFO stack. The FFU instruction
is used to unload the words from the FIFO stack, in the same order as the words were entered. The first word entered is the first word out.|
Note: These instructions are only available with the Allen Bradley ML1000, SLC 5/02, SLC 5/03, and SLC 5/04 processors.
The FFL command has several parameters that must be set:
The Source is a word address or a constant ranging from -32,768 to 32,767 that becomes the next value in the stack.
The FIFO is the first word address in the stack that stores
the word specified in the source. The pound symbol will be automatically entered when an address is typed in.
The Control is a control file address used to store the status bits, the stack length, and the position value. Do not use the control file address for any other instruction.
The Length specifies the maximum number of words in the stack. For SLC processors this is 128 words and 105 words for the MicroLogix 1000 controllers.
The Position is the next available location where the instruction loads data into the
stack. The first address in the stack is position 0. As each word is entered into the stack, the position
counter, on both the FFL and FFU will increment up by one. The stack is considered full when the position value equals the length.
When the rung condition goes from being false to true, the Enable Bit (EN) is then set, and copies
the Source into the FIFO at the next available position. When all the positions are filled, the Done Bit (DN) is then activated to prohibit loading any more words to the stack.
The FFU command has several parameters that must be set:
The FIFO is the first word address in the stack that stores the word specified in the
source. The word address needs to be the same address that was entered in the FFL command.
The Destination is a word address that is the location where you want to store the word
after it is unloaded from the stack.
The Control is a control file address used to store the status bits, the stack length, and the position value. Do not use the control file address for any other instruction. Note, since the FFL and FFU commands are used in pairs, the Control File address needs to be the same.
The Length specifies the maximum number of words in the stack. For SLC processors this is 128 words and 105 words for the MicroLogix 1000 controllers. The length must be the same.
The Position is the next available location where the instruction unloads data from the stack to the destination. Since the FFL and the FFU commands work together, each time a value is unloaded from the stack, the position counter on both the LFL and LFU will decrement.
When the rung condition goes from being false to true, the Enable Bit (EU) is then set, and unloads
the first word copied into the stack into the destination address. The words are then shifted up one
position in the stack. The position decreases after each operation. When the position equals zero, this
indicates that all words have been unloaded, the Empty Bit (EM) is activated.
If you fill the stack using the FFL command and the Done Bit (DN)activates when the stack is full and then unload the stack using the FFU command and activate the Empty Bit (EU) when the stack is empty, the Done Bit and Empty Bit will not RESET (RES).
The above figure demonstrates a simple rung to reset the position counter when the DN bit is activated. To
Reset the position counter; insert a rung. Incorporate an examine if closed switch to activate the reset.
Specify the examine if closed switch with the control file used in your program. If you specify R6:0 as
your control file then, specify the switch as R6:0/DN. This means that when the DN bit becomes active, the
reset command will take place. The reset command can only be specified to the element. Therefore, to reset
the position, the reset command needs to be specified as "R6:0".
Values and addresses are assigned to the FFL and FFU commands by positioning the cursor to the right of the
of the parameter you want to set, and and then double clicking the left mouse button. This opens a text box
so that the address can be typed. If integer addresses are used, then the integer data must be placed into
the integer data base.
An operator loads a value into a system for the number of parts he/she wants for assembly by a certain
machine. Develop a ladder rung that will take this input, and stores it in a stack. Then remove the
inputs based on first in, first out, principle.
In this example a decimal value, 5 was entered into the word address N7:0. When the rung containing the
FFL command became true, 5 was entered into the stack starting at position 0, address N7:10. The next value
entered into N7:0 was 10 followed by 15. When the rung containing the FFL command became true, 10 and 15 were entered into the stack at the next available positions 1 and 2 respectively. The stack has a length
parameter of 4 positions.
When the rung for the FFU command became true, the value 5 stored in position 0, addressed at N7:10 was
moved to the destination address N7:20. The values stored in the remaining positions were moved up one position. Therefore, the value 10 was moved from position 1 to position 0. The next time the FFU command
would become true, the value 10 would be placed in the address N7:20, writing over the value already being
stored there. The figure below shows the ladder logic program.
[Main Course Page]