ceo@instrumentationblog.in
PLC · How It Works

How a PLC Shift Register Works

Set where the reject pusher sits, counted in part positions from the inspection point, and the conveyor rate. Watch each bad part load a 1 into bit 0, ride along the register one bit per part and fire the pusher when it reaches the chosen bit.

Live animationAdjustable slidersFormula and example

Quick answer: A PLC shift register moves every bit of a word or bit array one place on each clock pulse and loads a new bit at the first position. On a conveyor, one bit per part position lets the PLC remember which parts failed inspection until they reach the reject station.

What Is a PLC Shift Register?

Many machines inspect a product at one point and act on it further down the line. The PLC must remember the result for every part between the two points, even when several parts are on the way.

A shift register does this with one bit per part position. A clock pulse from a part sensor or encoder shifts all bits one place, and the inspection result is loaded into the first bit at the same time.

The bit at the reject position is then wired to the pusher output. In IEC 61131 3 this is done with the SHL or SHR function on a word, and many PLCs also have bit shift instructions such as BSL and BSR.

Advertisement

How a PLC Shift Register Works: Interactive Animation

Numbered markers match the parts list below.
Pitch time = 60 ÷ parts per minute…
Delay from inspection to reject = N × pitch time…
Register word now (decimal)…
Bad parts rejected so far…
  1. 1Inspection sensor loads the data bit
  2. 2Clock pulse: one shift per part pitch
  3. 3Shift register, bit 0 on the left
  4. 4Reject pusher output driven by bit N
  5. 5Bad part tracked by a 1 bit
  6. 6Ladder logic for the shift and the output

PLC Shift Register Working Principle Step by Step

  1. The inspection sensor checks the part that has just arrived at position 0 and gives a 1 for a bad part and a 0 for a good one.
  2. A clock pulse, made once per part pitch by a sensor or an encoder count, triggers the shift instruction.
  3. All bits move one place towards the reject station, the oldest bit drops out of the end and the new result is loaded into bit 0.
  4. Because the bits move exactly as the parts move, bit N always belongs to the part at position N.
  5. When bit N is 1, the PLC fires the reject pusher and that bad part is removed from the line.

PLC Shift Register Labelled Diagram

Labelled diagram showing how a plc shift register works
Numbered parts: 1 inspection sensor loads the data bit; 2 clock pulse: one shift per part pitch; 3 shift register, bit 0 on the left; 4 reject pusher output driven by bit n; 5 bad part tracked by a 1 bit; 6 ladder logic for the shift and the output.
Advertisement

PLC Shift Register Formula

Shift left of a 16 bit word with data input d: new word = (old word × 2 + d) AND 65535
Pitch time = 60 ÷ parts per minute
Delay from inspection to reject = N × pitch time
Reject output = bit N of the register word
Example: N 8, 30 parts/min: pitch time = 60 ÷ 30 = 2 s, delay = 8 × 2 = 16 s; word 37 (0000 0000 0010 0101) shifted with d = 1 gives 37 × 2 + 1 = 75 (0000 0000 0100 1011)

Main Parts of a PLC Shift Register

PartWhat it does
Data inputInspection sensor, camera or weigh check result for the part at position 0
Clock inputPart sensor or encoder count that gives one pulse per part pitch
Shift registerWord or bit array; SHL, SHR, BSL or BSR instruction in the PLC
Reject outputBit N driving a solenoid valve for the pusher or air jet
ResetClears the register at start up or after a jam so old data does not fire the pusher

Where a PLC Shift Register Is Used

Reject trackingRemoves failed bottles, cans or packs at a reject station downstream.
Bottling and filling linesTracks empty positions so fill valves stay closed.
Indexing machinesFollows parts through stations on a rotary table.
Sorting conveyorsHolds the destination code of each part until it reaches its diverter.

Advantages

  • Simple and fast; one instruction per clock
  • Tracks many parts at once with one word
  • Easy to see on a programming terminal as a row of bits

Limitations

  • Only works if parts stay at a fixed pitch with no slip
  • A missed or double clock pulse shifts all data out of step
  • Needs a reset strategy after jams, manual removal or power loss

PLC Shift Register Field Tips and Common Problems

  • Use a one shot on the clock input so the register shifts only once per pulse, however long the sensor stays on.
  • Make the clock from an encoder count when possible; a part sensor can miss gaps in the product flow.
  • Check the bit numbering in your PLC: on some platforms SHL moves bits towards the higher number, BSL works on a bit array.
  • Add a reject confirm sensor after the pusher and alarm if a 1 bit passes without a confirmed reject.
Advertisement

Related Calculators and Tools

Frequently Asked Questions

What is the difference between SHL and BSL?

SHL in IEC 61131 3 shifts a whole word by a number of bits and fills with zeros. BSL type instructions shift a bit array by one and load the data bit you give it.

Why does the register need a clock?

The bits must move exactly when the parts move one pitch. Shifting every PLC scan would push the data out of the register in milliseconds.

What happens if a part is removed by hand?

Its bit keeps travelling, so the pusher may fire on an empty position or a good part. Many lines clear the register or use a tracking sensor before the reject station.

How long can a shift register be?

As long as the PLC memory allows. Words can be chained, or a bit array of hundreds of bits can be used for a long conveyor.

You May Also Like

Learn more on the blog

PLC shift register SHL and SHR

A practical guide on instrumentationblog.in that goes deeper into this topic with field examples.

Read Full Article

More How It Works

All How It Works animations · Instrumentation glossary · Comparisons

Advertisement