By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
Automation CommunityAutomation Community
  • PLC
  • Control Systems
  • Instrumentation
  • Calibration
  • Electrical
  • Courses
    • Siemens PLC Course
    • Allen Bradley PLC Course
    • InTouch SCADA Course
    • WinCC SCADA Course
    • Siemens Tia Portal
    • Omron PLC Course
    • Advanced PLC Course
Search
  • Customize Interests
  • My Bookmarks
© Automation Community. All Rights Reserved.
Reading: Shift Register in PLC – Sorting Machine Example
Share
Notification Show More
Aa
Automation CommunityAutomation Community
Aa
  • PLC
  • Control Systems
  • Instrumentation
Search
  • PLC
  • Control Systems
  • Instrumentation
  • Calibration
  • Electrical
  • Courses
    • Siemens PLC Course
    • Allen Bradley PLC Course
    • InTouch SCADA Course
    • WinCC SCADA Course
    • Siemens Tia Portal
    • Omron PLC Course
    • Advanced PLC Course
Follow US
© 2023. All Rights Reserved.
Automation Community > Blog > Competition > Shift Register in PLC – Sorting Machine Example
CompetitionPLC

Shift Register in PLC – Sorting Machine Example

Mahmoud Salama
Last updated: 2023/04/29 at 8:00 AM
Mahmoud Salama
Share
7 Min Read
SHARE

Shift Register is one of the many applications of the Rotate and shift instructions in a PLC. In fact, a shift register might be their most common if not most important application, and it is used a lot in many industrial processes.

Contents
What is a Shift Register?Sorting Conveyor SystemPLC Sorting Conveyor System LogicConclusion

In this article, we will try to explain the idea behind it and give an example project for a sorting machine.

What is a Shift Register?

A shift register is a byte, word, double word, or even a group of words. We use it to move a 1 or 0 along the register bits. We move this bit using the shift and rotate instructions and the purpose is to monitor the case of a certain event along a moving process so that when this event arrives at the point where we need to take action, the control will remember and knows exactly what to do with it.

This probably doesn’t make a lot of sense, but imagine the following case:

You have a conveyer belt carrying products to a packaging area, but any defective product should be removed from the belt at a certain point before reaching the end.

You should have a sensor at the start of the conveyer to detect defective products. But you have a continuous flow of products on the conveyer, so the problem is how a system will know that a defective product is now at the stage where it should be removed from the conveyer to energize whatever method is designed to remove it.

And here comes the use of a shift register.

A shift register will know when there is a defective part, and it will also know when action should be taken to remove this defective part.

Usually, for a shift register, we need 3 elements:

  1. The detection system – to detect a wanted case.
  2. Index signal – to shift the data each time it arrives(the index signal)
  3. To know at which bit of the register – does our product reach the required place.

The following example project will try to simulate the use and working principle of a shift register. And because it is not a real project, so we will simulate some of the elements that we need when coding the shift register. That will be shown later in the example.

The below picture is a generic picture taken from the Internet.

Sorting Conveyor System

Sorting Conveyor System
Image Courtesy: Flexli

We have a conveyor system that is supposed to identify incoming products and sort these products along the way between 5 different Bins.

We have 5 destinations for our products and we have 20 different product types. The products are sorted as follows:

Product Type1, 2 and 34 to 910 to 1314 and 1516 to 20
Destination BinBin 1Bin 2Bin 3Bin 4Bin 5

To identify products, we have a scanner system that detects a product and gives it an identification number from 1 to 20.

To simulate our products, we will create a PLC function that will give us a random number from 1 to 20

More Read

30 Communication Protocols in Automation and Instrumentation

RS232 RS485 RS422 Communication Protocols – Questions and Answers

Serial Communication Questions and Answers

Profibus Questions and Answers

Stepper Motor Questions and Answers

 And to guide the products to their Bins we have 5 pneumatic arms that extend and retract to guide the products.

The product takes about 15 seconds to move from the Scanning station to the end of the line.

DestinationBin 1Bin 2Bin 3Bin 4Bin 5End of line
Time to reach2 Sec4 Sec6 Sec8 Sec10 Sec15 Sec

PLC Sorting Conveyor System Logic

  1. We have a simulation function for the products, this FB gives us a random number each 1 sec to simulate the presence of a new product on the conveyer each 1 sec.
  2. Once there is a new product, the system will compare the number it has to know which bit this product will activate in the shift register.
  3. After a certain bit is activated, for example, %M50.0 for products 1, 2, or 3- this bit will be set to 1 and with the help of the index signal and SHL instruction, this bit will be shifted to the left each 500ms.
  4. We know how long it takes to reach each bin, and we know the index signal frequency – 2Hz-, so we know at which bit of the register the product will be in the right place. And then we can activate the Arm to push the product to the Bin.
  5. See the next Pictures for more clear idea.
How Does the PLC Sorting Conveyor System Work

Products 1, 2, and 3 should go to Bin1 (as per above image)

PLC Sorting Machine Example

Products from 4 to 9 will go to Bin 2 (as per above image)

Can you see which BIT does this group of product activate?

Can you see which Bit will activate the arm?

The same concept is done for the rest of the products.

See the next picture for products from 16 to 20 (below image)

Example of Shift Register in PLC

The next video will show a simple Visualization of the shift register code we just made.

Can you notice the BIT at which the arm is activated for each product?

You can download the PLC source code and try the simulation yourself using Siemens Tia Portal.

If you don’t have Siemens PLC software, then download the PDF of the sorting conveyor machine logic.

Conclusion

Shift Register is very useful and commonly used in a lot of industrial processes. Especially when you want to monitor the case of a certain event along a moving process, so that when this event arrives at the point where we need to take action the process will know what to do with it.

This article was published in the Automation Community Competition.

You Might Also Like

Sensors and Transducers Objective Questions and Answers

Cybersecurity Questions and Answers

Electrical Switches Objective Questions and Answers

Programmable Logic Controller Questions and Answers – PLC

Fire Fighting Pump Room Monitoring System – PLC Project

TAGGED: PLC, PLC Example, PLC Program, Programmable Logic Controller, Shift Register, Sorting Machine

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
[mc4wp_form]
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Whatsapp Whatsapp LinkedIn
Share
By Mahmoud Salama
Experienced Electrical Maintenance Engineer with over 7 years of experience. Skilled in PLC, SCADA, and HMI programming in many platforms(TIA-Portal on top).
Previous Article Difference Between Fuse and Relay Difference Between Fuse and Relay
Next Article What is Instrumentation What is Instrumentation? Purpose, Career, Salary, Skills
2 Comments 2 Comments
  • Kalyan says:
    January 16, 2023 at 10:40 pm

    Thank you. Very helpful

    Reply
  • Sharmil says:
    January 18, 2023 at 8:46 am

    Thanks for sharing

    Reply

Leave a Reply Cancel reply

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

Stay Connected

120.5k Followers Like
10.1k Followers Follow
90.6k Subscribers Subscribe

Latest Articles

Orifice Plate
Orifice Plate Questions and Answers
Instrumentation June 5, 2023
Sensors and Transducers Objective Questions and Answers
Sensors and Transducers Objective Questions and Answers
Instrumentation Control Systems PLC June 4, 2023
Cybersecurity Questions and Answers
Cybersecurity Questions and Answers
Control Systems PLC June 3, 2023
Electrical Motors Multiple-Choice Questions
50 Electrical Motors Multiple-Choice Questions
Electrical June 2, 2023
Pressure Gauge Questions and Answers
Instrumentation

Pressure Gauge Questions and Answers

Welcome to our Pressure Gauge Questions and Answers. In this section, we…

Vivek By Vivek May 15, 2023
Bottle Line Simulation in PLC
CompetitionPLC

Bottle Line Simulation in LogixPro PLC Simulator

The Bottle Line Simulator of LogixPro simulates an automated production line that…

Sonali Charpe By Sonali Charpe February 28, 2023
Stepper Motor Questions and Answers
ElectricalInstrumentationPLC

Stepper Motor Questions and Answers

The list of stepper motor questions and answers will help you understand…

Vivek By Vivek May 21, 2023
RS-485 Half Duplex Mode Operation
CompetitionPLC

Basics of RS232, RS422, and RS485 Serial Communication

The RS232, RS422, and RS485 serial communication protocol standards are used to…

Alumula Sridevi By Alumula Sridevi February 27, 2023
Electrical Tools Multiple Choice Questions and Answers
Electrical

Top Electrical Tools Multiple Choice Questions and Answers (MCQ)

Look at the top electrical tools multiple choice questions and answers (MCQ)…

Vivek By Vivek May 5, 2023
Difference Between SCADA and HMI
PLC

Difference Between SCADA and HMI

In this article, you will learn the difference between SCADA and HMI…

Editorial Staff By Editorial Staff January 21, 2023
Show More
//

We provide resoucres to million users and we are the number one business and industrial automation news network on the planet

Quick Link

  • Customize Interests
  • My Bookmarks

Top Categories

  • PLC
  • Control Systems
  • Instrumentation

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

[mc4wp_form id=”847″]

Follow US
© 2023 All Rights Reserved. Supported by Inst Tools.
login
Welcome Back!

Sign in to your account

Lost your password?