You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old September 6th, 2002, 05:38 AM   #1
labingtone
Member
Philippines

labingtone is offline
 
Join Date: Aug 2002
Location: Manila, Philippines
Posts: 113
FIFO & LIFO instruction

Hi to everyone.

Kindly discuss when to used LIFO & FIFO Instruction. I appreciate if you can give actual application on the use of this instruction.
  Reply With Quote
Old September 6th, 2002, 05:46 AM   #2
WilWil67
Member
United States

WilWil67 is offline
 
Join Date: Aug 2002
Location: Frederick, MD
Posts: 19
Labingtone,
Need more information. What are you trying to do? What type of PLC and or software you using?
__________________
Will Wilson
  Reply With Quote
Old September 6th, 2002, 07:22 AM   #3
Jiri Toman
Member
United States

Jiri Toman is offline
 
Jiri Toman's Avatar
 
Join Date: Jun 2002
Posts: 498
LIFO,FIFO

FIFO instruction is a part of many PLC's instruction set.
LIFO on the other hand is not.
FIFO is an asynchronous shift register. There is also a synchronous
shift register instruction in just about every PLC. That is not to be
confused with LIFO.
LIFO is used primarily as a stack in Assembly language programming
i.e. push and pop from stack.
FIFO applications are varied, one example would be to schedule parts
on a merging conveyor system. Instead of using round robin logic
the FIFO would schedule the parts on to a merge conveyor on a first come first go basis. You could also use it to track parts on a conveyor belt. There are many other applications in data aquisition etc.
  Reply With Quote
Old September 6th, 2002, 12:43 PM   #4
Ron Beaufort
Lifetime Supporting Member
United States

Ron Beaufort is offline
 
Ron Beaufort's Avatar
 
Join Date: Jul 2002
Location: Charleston, SC
Posts: 4,460
I think all that labingtone is looking for is “what-the-heck-is-it” type information. If so, then maybe this will help.

LIFO stands for “Last In First Out”.
FIFO stands for “First In First Out”.

Here is a simple example of each:

Suppose that I have boxes of parts coming into my warehouse. A barcode reader is located at the warehouse door and it reads the barcode labels on each incoming box. This barcode information is to be stored in a PLC to keep track of what parts I have available in my warehouse. Suppose (to keep it simple) that the first box is number 111; the second box is number 222; and the third box is number 333.

Now how should I store the boxes? I have two basic ways – let’s start with a “stack”.

If I “stack” the boxes as they come in, then box 111 will be on the bottom. Box 222 will be in the middle. And box 333 will be on the top of my stack of boxes. Now suppose that I need to send a box of parts out of my warehouse to fill an order. The natural thing to do would be to send out box 333 from the top of the stack. This is what we mean by LIFO (Last In First Out) – in other words, the LAST one to come INto the stack (number 333) is the FIRST one to be sent OUT of the stack. This LIFO method is usually the most convenient method for storing things like lumber that don’t spoil or “go bad” while waiting in storage.

So as far as the PLC is concerned, the best way to program this “stacking” operation is with a LIFO arrangement.

But instead of stacking the boxes, suppose that I store them by lining them up on a shelf as they come into my warehouse. Many programmers call this storage method a “queue” (rhymes with CUE) which is a word that the British people use to describe a line of people waiting to get into a theater (or as they would say, “theatre”). So using this storage method, when box number 111 comes into my warehouse, I store it at the start of the queue (or line). Then when box 222 comes in, I place it next in the queue. Finally, box 333 goes at the end of the queue. Now suppose that I need to send a box of parts out of my warehouse to fill an order. The natural thing to do would be to send out box 111 from the head of the queue. This is what we mean by FIFO (First In First Out) – in other words, the FIRST one to come INto the queue (111) is the FIRST one to be sent OUT of the queue. Just like the people lined up at the theater. The first one to get into the line, is the first one to get out of the line - and on into the theater. This FIFO method is usually the best method for storing things like food that DO spoil or “go bad” while waiting in storage.

So as far as the PLC is concerned, the best way to program this “queue-ing” (or lineup) operation is with a FIFO arrangement.

So that’s what we mean by LIFO and FIFO. Now how to actually program either one of these methods into your PLC depends (as others have pointed out) on what type of PLC you have and on what you’re trying to accomplish with your program.

Hope this helps.
__________________

2-B ?
Best regards, ----+----] [----+------------( )----
Ron | |
PLC Training Boot Camp | 2-B |
+----]/[----+

I once was lost, but now am found, was blind, but now I see.

  Reply With Quote
Old September 6th, 2002, 07:12 PM   #5
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
A LIFO is a Temporary Holding Place for thingees - whatever they might be. Those thingees are held in place, in the same order that they were entered or loaded. Example: Push 1/2" marbles into a 1/2" hose. All of the marbles maintain their relative positions.

A FIFO is a Temporary Holding Place for thingees - whatever they might be. Those thingees are held in place, in the same order that they were entered or loaded. Example: Push 1/2" marbles into a 1/2" hose. All of the marbles maintain their relative positions.

Notice that both descriptions, up to this point, are the EXACTLY the same... at least, up 'til now.

Now, you are told, by some loud voice in the sky, to "re-acquire" those thingees, those marbles - in order. (Notice that I didn't use the word "retrieve".)

If you are sharper than those marbles you've been loading, you might ask... "Which order? I could re-acquire those marbles from this-end-of-the-hose or that-end-of-the-hose."

So, the loud voice in the sky that's telling you to get those damned marbles back says, "In the SAME order that you got them". So you go to the far-end-of-the-hose and "re-acquire" the marble-thing-a-ma-bobbers.

That is a FIFO operation.

Or, the loud voice in the sky that's telling you to get those damned marbles back says, "In the REVERSE order that you got them". So you go to the near-end-of-the-hose and "re-acquire" the marble-thing-a-ma-bobbers.

That is a LIFO operation.

NOTICE...
The difference is in "how" those thingees are "re-acquired".

I didn't use the word "retrieve" because the word "retrieve" is "loaded". That is, "retrieve" implies, to a certain degree, that you "re-acquire" the marbles in a particular order - namely, "Reverse Order" - as in LIFO.

Having used the word "re-acquire" instead, the method of retrieval is completely ambiguous and, therefore, no particular method is implied. And so it should be!

You are then forced to consider the specific method that you need; "Last In, First Out", or "First In, Last Out"

FIFO is being a person standing in a check-out line at the grocery store.
LIFO is being a person standing in a "standing-room-only" subway-train.

The real-world applications, in terms of PLC's, are very similar, and, can, in fact, be EXACTLY the same! That is, you just might have a PLC that is monitoring people (or things) going through a Grocery check-out line. You could also have a PLC that is monitoring people with particular ID Numbers entering and exiting a "standing-room-only" subway-train.

In some cases, it's instances of things moving in/out of a que.
In other cases, it's data being placed on a "STACK". That is the way that ASSEMBLY LANGUAGE (which is about as close to Machine-Language as we are likely to get to, these days) handles its data and related instructions.
  Reply With Quote
Old September 6th, 2002, 07:48 PM   #6
Allen Nelson
Member
United States

Allen Nelson is offline
 
Join Date: Apr 2002
Location: West Chester, PA
Posts: 1,368
Re: FIFO & LIFO instruction

Quote:
Originally posted by labingtone
Hi to everyone.

Kindly discuss when to used LIFO & FIFO Instruction. I appreciate if you can give actual application on the use of this instruction.
Ah, I see that NYP is back in session.

"actual application". Tracking information (serial numbers, status, destinations)

FIFO emulates a conveyor belt (the first item to go onto it is the first one to come off)

LIFO emulates a storage compartment (with only one entrance - you have to take the last one you put in, before you can get to the one behind it)
__________________
©¿©¬
  Reply With Quote
Old September 8th, 2002, 08:52 PM   #7
labingtone
Member
Philippines

labingtone is offline
 
Join Date: Aug 2002
Location: Manila, Philippines
Posts: 113
Thanks to everyone for your effort is answering my query.

As I read your answers, I understand now what is FIFO and LIFO.As far is my understanding is concerned and correct if im wrong. FIFO is just like SHIFT Register(BIT) with specify lenght of bit, let say 8 bit. IN is the bit to shifted in, Q is the bit shifted out.
This is a shift register functional block of GE FANUC PLC.


________
EN ___: SHFR_ :
: BIT :
: :
___: R Q:__
: :
: :
: :
___:IN :
: :
___:ST :
:________:

Last edited by labingtone; September 8th, 2002 at 08:59 PM.
  Reply With Quote
Old September 8th, 2002, 10:12 PM   #8
Gerry
Member
New Zealand

Gerry is offline
 
Join Date: Jun 2002
Location: Auckland
Posts: 1,141
They're not the same

A shift register operates synchronously - for every item shifted in, one is shifted out.
A FIFO operates asynchronously - load and unload (shift in & out) happen at differrent times (normally).
Data entered in a shift register must be shifted the length of the register (one position per shift pulse) before it is available to shift out.
Data loaded in a FIFO can be immediately available for unload, regardless of length.
For tracking applications, a shift register will track position, whereas a FIFO will track sequence.
  Reply With Quote
Old September 9th, 2002, 03:20 AM   #9
jeb
Guest
 
Posts: n/a
Lightbulb PLC software?

hello my fellow engineers, i have a problem about our Siemens S7-300/400 PLC that we have in our company. I dont have the latest PLC software which is window based. if anyone of you do have the software plz send it to my email at jeb@swirvemail.com. thanks in advance!
  Reply With Quote
Old September 9th, 2002, 07:07 AM   #10
rsdoran
Lifetime Supporting Member
United States

rsdoran is offline
 
rsdoran's Avatar
 
Join Date: Apr 2002
Location: Birmingham, AL
Posts: 7,372
An engineer I am sure would "know" how to obtain the proper software for his companies needs. Step 7/Simatic for the S7300/400 requires an activation disk (similar to AB RSLogix). The software is no good without it.
__________________
http://www.patchn.com Industrial Electrical & Maintenance @ www.patchn.com "Tell me and I forget, show me and I remember, involve me and I understand."
  Reply With Quote
Old September 9th, 2002, 07:11 AM   #11
john paley
Member
United States

john paley is offline
 
john paley's Avatar
 
Join Date: Apr 2002
Location: Tennessee
Posts: 304
Those are all good examples of LIFO/FIFO use. But now for something completely different, as an application.

I use the FIFO as a storage file to average or smooth out "nervous" analog input signals.

Use a self re-triggering timer to load the naalog value into the stack, and when the stack is full, average the file. The lag of the filter is determined by the timer preset and the file length.

The thing is easy in processors with a "average file" command, but a little trickier with those that don't. If you don't have the "average file" command, you have to keep a running total of the sum of the values loaded into the stack by adding a value to the total when it is loaded, as well as subtracting a value from the total when it is unloaded.

It works very well as a filter, and I've used it many times.
__________________
The Big Cheese
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
FIFO Check The_Wanderer LIVE PLC Questions And Answers 1 October 15th, 2003 06:44 AM
OSF Instruction with SLC 50/4 Craig LIVE PLC Questions And Answers 11 April 2nd, 2003 06:33 PM
Cascading ONS and OSR instruction ettikudiappan LIVE PLC Questions And Answers 5 January 30th, 2003 03:14 AM
Cascading ONS and OSR instruction ettikudiappan LIVE PLC Questions And Answers 1 January 29th, 2003 02:02 PM
Using FSC instruction in Controllogix ettikudiappan LIVE PLC Questions And Answers 2 October 21st, 2002 05:07 PM


All times are GMT -5. The time now is 11:14 PM.


.