Using FIFO

jpfletcher

Member
Join Date
Nov 2014
Location
Lexington,NC
Posts
13
The exercise is to keep tracking of three boards coming down a conveyor. Each one hits a part present switch. From the part present switch there is a certain number on encoder counts from the switch to the cutter that will jump in for each board. We'll say the number of fixed counts is 20,000 counts. How would you use FIFO to keep track of each board and the counts.

Thanks
Johnny
 
You didn't mention the PLC type, but I'll assume AB. There are also plenty of threads so also do a search as well.

FIFO implementation is pretty straight forward. It uses two instructions the FFL and FFU. FFL loads the fifo, and FFU unloads it. I've found that the instruction manual for each is pretty easy to walk through, but if it's your first FIFO then I can understand why it can be confusing.

For any FIFO, you need an array. Call it FIFO_Array, and we will give it a length of 5 and say it is a DINT datatype. I can now load data into:

FIFO_Array[0]
FIFO_Array[1]
FIFO_Array[2]
FIFO_Array[3]
FIFO_Array[4]

The FFL upon a trigger, will load a value that has been feed to it into the first available position. In this case FIFO_Array[0]. Now, there is a control tag that is assigned to the FFL/FFU instructions for the FIFO, this is what keeps track of the position, and state of the instruction. Very important note, because you need to use both the FFL and FFU instructions to create a FIFO, the control tag is SHARED between them, this is how they stay synchronized.

As a second trigger occurs, the associated data is loaded into the next available position, FIFO_Array[1]. FIFO_Array[0] is the 'current' value, or the next one to be unloaded. As subsequent triggers occur, it continues to populate the FIFO array. The data contained in FIFO_Array[0] will remain until the FFU instruction is triggered. When the FFU instruction is triggered data from FIFO_Array[0] is unloaded, or dumped, and the data in the array shifts up to re-populate FIFO_Array[0].

In your case, your sensor is the FFL trigger, the encoder count + 20,000 would be loaded into your FIFO_Array[0]. As the next two parts are triggered, the data populates FIFO_Array[1] and FIFO_Array[2]. Once your encoder reaches the value in FIFO_Array[0], activate your cutter. At this point, you could also trigger your FFU to unload that value, or if you have a secondary sensor you could use that as well, or if you have an indication that the cut completed that might work too. Your pick.

So this will cycle, part entry, FFL is triggered, Cut happens, FFU is triggered and so on.

Pretty simple, HOWEVER there must be consideration for when things go wrong. If there is a problem and the parts are removed, you will need to clear/reset the FIFO. What if the middle part is removed? Does the cutter just do a 'ghost' cut? What if parts are shifted after first detection?

I would walk through the manual, get something basic going then start to think of how to react when things go wrong. This can really hose up FIFOs. I have implemented a modified version, FIAO "First In Any Out". This was for a material handling system, as material was queued up, and a problem occurred with the requester before it was it's turn? I had to be able to remove it from the array. However it wasn't guaranteed to follow the rules of 'first in first out'. In short, pay very close attention to what 'what-ifs'.
 
Last edited:

Similar Topics

AB SLC 5/04 RSlogix 500 I have been trying to keep track of how many hours some conveyor motors run in a 24 hour period and be able to look and...
Replies
14
Views
3,282
Hello, I'm currently programming a MicroLogix 1400 in RSLogix Micro, and I'm trying to put data into FIFO queues. Would you know how to use the...
Replies
4
Views
5,100
Attatched is the logic for a dumb little project i'm working on. I tested it today and it woks fine other than needing the photo eyes...
Replies
28
Views
9,291
hi guys, really need your help again.. i find it difficult not familiar with Omron software while my project schedule is so tight! I would like...
Replies
7
Views
12,525
Hi I'm very new to PLC programming and I'm trying to find out if this library (Tc2_NcFifoAxes) is necessary for our task In our case we need to...
Replies
0
Views
38
Back
Top Bottom