Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: LIFO Instruction in PLC
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > LIFO Instruction in PLC

LIFO Instruction in PLC

LIFO instruction used in the PLC programming applications that require to store the sequence of data in order and unload it.

Last updated: March 4, 2021 11:18 am
Editorial Staff
PLC Tutorials
No Comments
Share
6 Min Read
SHARE

LIFO is a special programming instruction that can be used in the applications that require to store the sequence of data in order and unload it.

Contents
LIFO Instruction in PLCThe following are the block parameters in LIFO load instruction,The following are the block parameters in LIFO unload instruction,

Now we are gonna see how are loading and unloading done in LIFO.

LIFO Instruction in PLC

LIFO Instruction in Allen Bradley PLC Programming

Yes! LIFO should be used in a pair. There should be an instruction to load and there should be an instruction to unload.

The following are the block parameters in LIFO load instruction,

Source: Here is where one should give an address where the values to be loaded are present.

LIFO: Here is where one should specify the address where the values have to be loaded. This address seems weird right with an ‘#’ in the front. When we use an ‘#’ symbol in the front, It is called an array of addresses. Obviously there will be a sequence of values present to be loaded arrays are capable of storing many values right? So why we gave ‘#’ in the front should make sense now.

Control: Here is where one should specify the control address. In the Rockwell PLC programming environment, there is a separate address for the control with R6:0 as starting one. So when the LIFO load is done loading the values the R6:0 address gives us a true bit.

Length: Here is where we have to specify the length of the array so that the array of address prepares them for loading the values.

Position: Here is where we have to give the index number of an array from where the loading has to start. I’ll leave it to 0 so the loading starts from the 0th index.

The following are the block parameters in LIFO unload instruction,

LIFO: Here is where one has to give the address where the values to be unloaded are present. So obviously both the load and unload has the same address in here.

Dest: Here is where one has to give the address where the values have to be unloaded.

Control, Length, and Position carry the same explanation from the LIFO load.

Now we’re going to the run time to see how the loading and unloading happens,

PLC loading and unloading

Now we are on the run time and when the input to LFL is made to turn on the value on N7:0 gets loaded to the array address #B3:0. B3:0 is a binary address to view the value as decimal change the radix to decimal.

Refer to the below figure for the first loaded value.

LIFO Instruction

You can also see the number of lengths we specified is 4 and the Binary data file shows us from 0 to 3.

Here is the next loaded value.

LIFO Load and Unload Instructions for Allen Bradley

Since we didn’t change the number in the source the same number will get loaded to the destination address.

You can see that the position is increasing in the LFL and LFU as the value is getting loaded. So the value is getting loaded from left to right the starting position is 0 and the ending is 3.

Also, notice that the value gets loaded for each false to the true transition of the rung. Refer to the below figure.

So now we have completed loading the values now the Position is at 10 and the done bit goes to the true state.

Tutorial on LIFO instruction of Allen- Bradley PLC

You can also notice from the figure that the Done bit is turned on after completely loading the values.

Now we are going to look at the unloading of the data,

LIFO logic in PLC

Now I made the LFU rung true you can notice that the done bit goes OFF again.

Also, notice that the value which got loaded last comes out first. So the expansion of LIFO is called Last in First Out. The one which came last unloads first.

Likewise, whenever the rung makes false to true transition each value unloads in a manner that which came last goes out. So the last value which comes out should be 30.

Last-In First-Out instruction in PLC

You can also notice from the figure that the empty bit goes up when the values on the LIFO address become empty.

An example of a real-time application where LIFO is used might be tracking parts through an assembly line where parts are represented by values that have a part number and assembly code.

Author: Abishek D

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • InTouch SCADA to Excel
  • FIFO Instruction in PLC
  • Advantages of RTO Timer
  • Scaling for Analog Input
  • Configuration of Alarms
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !
Procedure for Connecting Allen Bradley PLC and PC – RS Logix 500
Developing PLC Logic for Water Pumping and Chemical Addition
The Concept of Shift Register in Omron PLC with Example
Structured Text PLC Program for Measuring Event Duration
Free Download Programmable Logic Controller (PLC) Book
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Kamli on Top Free PLC Software
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals

Related Articles

Draw a ladder logic to switch ON-OFF a bulb using a toggle switch

Draw a Ladder Logic to switch ON-OFF a Bulb using a Toggle Switch ?

Types of PLC Memory

Types of PLC Memory

Single-acting Pneumatic Cylinder operation with Limit Switch

Single-acting Pneumatic Cylinder Operation with Limit Switch

Seven Segment Display Programming with Structured Text

Seven Segment Display Programming with Structured Text

Alarm and Trip Documentation

PLC Alarm and Trip Documentation

Structured Text PLC Programming for Two-Tanks Level Control

Structured Text PLC Programming for Two-Tanks Level Application

PLC FBD Programming for Burglar Alarm Security System

PLC FBD Programming for Burglar Alarm Security System

PLC Stop - Start Circuit

Introduction to PLC Ladder Diagrams

More Articles

Explain how this is an example of Ratio Control?

Questions on Ratio Control System

Download Modscan software

How to Use ModScan Software for Testing Modbus Communication?

Sprinkler System

Basics of Sprinkler System

Lightning Arrester Bursts Problem

Frequent Feeder-A Lightning Arrester (LA) Bursts – Root Cause Analysis

Omron PLC for Product Painting with Integrated Weighing System

Omron PLC for Product Painting with Integrated Weighing System

Immersion Electrical Heaters

Single and Three Phase Immersion Electrical Heaters Wiring Circuits

Coriolis Mass Flow meter as a Multi Variable Transmitter - 1

Coriolis Mass Flow Meter as a Multi-Variable Transmitter

PLC Ladder Logic Door Open and Closing System

Which Language is Best for PLC Programming?

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?