Fifo

Just looking for a sanity check I've never programmed a FIFO before.

Each time an input turns on push that input number on to the top of then stack and increment the stack counter to show the depth of the stack.

Each time a station is done filling get the last input number from the bottom of the stack and decrement the stack counter.

Does this sound like a reasonable way to implement a FIFO?

Thanks
JT
 
Yep, that's a perfectly valid way to use it. Use FFL to "load" the stack and FFU to "unload" the stack. Make sure to use the same control tag for both the FFL and the FFU.

Also just remember to check whether your FIFO is full before trying to load it - [Control_Tag].DN bit is on when full.
 
JT
When using a FIFO you need to us both the FFL (Load) and FFU (Unload) together

FFL
On every false to true transition of the FFL if the FIFO full bit is false the load tag value is copied to index 0 of the FIFO stack and the value of index 0 is mover to index and index 1 is copied to index 2 and so on up through the stack basically pushing the new value in the bottom of the stack until the stack is full
It also moves the pos pointer up the stack by 1
When the pos pointer equals the max number the full bit is set.
When the stack is full no more data can be moved and FIFI cannot be loaded.
FFU
On every false to true transition of the FFU if the FIFO empty bit is false the value at the pointer is moved out to the unload tag and the pointer is down by 1

You can fill a FIFO without unloading up to the pointer is at the max number but you must at some point unload it or you will not be able to move more date in
That’s why it’s best to use the load and unload together they both must contain the same control
 
I forgot to mention that I'll be using an Automation Direct Click not an AB. So it's a single copy to move one and a block copy to push the stack up or down.

JT
 

Similar Topics

I'm trying to find a simpler solution to how we display tag history in our HMIs today. This isn't for trending just the last 3 results. Right now...
4
Replies
337
Views
Hello, Long time lurker, first time poster. I am working with a CompactLogix 5069, studio 5000 rev 32 and an Ignition HMI. I have 8 different...
12
Replies
1,038
Views
Hey guys, anyone have a simple Queue / FIFO Add On Instruction - I'm looking at running 2/3 hot water units at all times, then turn one off and...
1
Replies
482
Views
Hi all! Looking for some advice. I am trying to set up a reject system that will kick of products from an input signal (thickness detection). I...
3
Replies
938
Views
I have a pick and place system. Where a robot(R01) drops parts in 3 different locations .R02 picks the part from any one of the locations. I want...
9
Replies
2,051
Views
Top