Ladder Logic 106: One Shots

OneShots2

A one shot, or “differential”, is used to develop a signal that is exactly one scan in duration. As shown in the diagram above, when a signal is applied to a contact (a Pushbutton in the diagram above), no matter how long the signal stays on, a pulse of one scan length is generated after the one shot.

Different PLC manufacturers use different names and symbols for one shots, but they pretty much all operate the same. A one shot can be generated from the rising or falling edge of the signal. One Shot Rising (OSR), Positive Differential (PD) and Differential Up (DIFU) are some of the names given to rising edge signals, while One Shot Falling (OSF), Negative Differential (N) and Differential Down (DIFD) are the equivalent falling edge terms. Do you know them by a different name? I’d love to hear some of them, these are the ones I am familiar with.

One shots placed in the middle of rungs as input instructions need a bit address, and it is important that every one shot has a different address. I have seen a program where someone gave all the one shots the same address, and surprisingly it worked most of the time. When it didn’t, the results were quite… unpredictable.

Sometimes when I’m teaching people new to PLC’s about one shots, I get asked “What are they used for?” The classic answer in a lot of textbooks is the diagram shown here:
OneShots1

This is fairly easy to understand. If someone holds down the ON Pushbutton, the device will still be turned off. This is important in some motor or actuator safety circuits to ensure that a device is initialized to the de-energized state.

Another example I like to give is the diagram below:

OneShots3

This is called an Accumulator rung. It adds whatever is in “Word 6”, (a memory location) to the number one and puts the result back in itself. The problem with this rung is that it doesn’t count what you want it to count, which is activations of the count signal. I like to give this exercise to new programmers and ask them to enter it into the PLC and guess what the number will be after one press of a button (assuming Word 6 is at zero of course). Many of them will say “one”. I will say “176” and get a lot of puzzled looks. I have done this enough times that I know about how quickly to press the button to get that count.

It’s fun to see the light go on when they realize that its not the signal that’s being counted, but the number of scans that occur while the button is pressed!

OneShots4

This of course is what the rung should look like if you want to count the number of signals (or pushbutton presses). It is another good way to illustrate some of the uses of one shots.

By the way, this accumulator circuit leads into another topic I will cover at a later date. A few things to note about the accumulator: you can count by numbers other than one, such as ten. You can subtract as well as add. There are other features that make this a useful tool; the accumulator is one of the basic circuits I tell students should be in every programmer’s toolkit.

Share
About

Electrical Engineer and business owner from the Nashville, Tennessee area. I also play music, Chess and Go.

4 Comments on “Ladder Logic 106: One Shots

  1. Gx developer software for Mistsubishi plc’s call it “pulse” i believe.

  2. Thank you for the information. As an engineer I love to see how things work and this learning never stops nor ever gets old and boring. In relation to the programming itself, being able to utilize all of the functionality given by a device will enable you as the programmer the best results for whatever application it is being used for. Knowledge is the key to unlocking understanding and communicating it to others.

  3. Still do not understand well. Isn’t there any other good examples of using one shot? Lets say, pushing the button all the way for 1 min, one shot energized and get the output energized as well for only one scan. What about the next scan? Would it be doing the same thing? or skip the next scan in the state of denergized and the next scan it is energized and do the same process?