Ladder logic 106: One shots

Different programmable logic controller (PLC) manufacturers use one shots to develop a scan that is exactly one scan in duration and can be generated from the rising or falling edge of the signal.

07/25/2016


Figure 1: When a signal is applied to a contact, no matter how long the signal stays on, a pulse of one scan length is generated after the one shot. Courtesy: Frank Lamb, Automation PrimerA one shot, or "differential", is used to develop a signal that is exactly one scan in duration. When a signal is applied to a contact (a pushbutton as shown in Figure 1), no matter how long the signal stays on, a pulse of one scan length is generated after the one shot.

Different programmable logic controller (PLC) manufacturers use different names and symbols for one shots, but they pretty much operate the same in the end. 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. One shot falling (OSF), negative differential (N), and differential down (DIFD) are the equivalent falling edge signals.

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. There are programs where a user gave all of the one shots the same address, and surprisingly, it worked most of the time. When it didn't, the results were quite unpredictable.

When people ask what one shots are used for, the classic answer in a lot of textbooks is the diagram shown in Figure 2.

Figure 2: Basic example of how a one shot is used in a programmable logic controller (PLC). Courtesy: Frank Lamb, Automation Primer

This is fairly easy to understand. If a user 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.

Figure 3: Example of a one shot using an accumulator rung, which adds the memory location and puts the result back in itself. Courtesy: Frank Lamb, Automation Primer

Figure 3 features 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 are activations of the count signal. It's good 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). Many of them will say "one," which is incorrect. It's interesting to see when users realize that it's not the signal that's being counted, but the number of scans that occur while the button is pressed.

Figure 4 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.

Figure 4: Example of what the accumulator rung should look like if the user wants to count the number of signals. Courtesy: Frank Lamb, Automation Primer

A few things to note about the accumulator: Users can count by numbers other than one, such as 10. Users can subtract as well as add. The accumulator is one of the basic circuits that should be in every programmer's toolkit.

Frank Lamb is the founder of Automation Consulting Services Inc. This article originally appeared on the Automation Primer blog. Automation Primer is a CFE Media content partner. Edited by Chris Vavra, production editor, Control Engineering, CFE Media, cvavra@cfemedia.com.

MORE ADVICE

Key Concepts

  • Programmable logic controller (PLC) manufacturers use one shots to develop a scan that can be generated from the rising or falling edge of the signal.
  • Different PLC manufacturers use different names and symbols for one shots, but they pretty much operate the same in the end.

Consider this

How do you use one shots in PLC applications?

ONLINE extra

For more articles on PLCs and programming, see related articles below.



No comments
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
The Engineering Leaders Under 40 program identifies and gives recognition to young engineers who...
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Sensor-to-cloud interoperability; PID and digital control efficiency; Alarm management system design; Automotive industry advances
Make Big Data and Industrial Internet of Things work for you, 2017 Engineers' Choice Finalists, Avoid control design pitfalls, Managing IIoT processes
Engineering Leaders Under 40; System integration improving packaging operation; Process sensing; PID velocity; Cybersecurity and functional safety
This article collection contains several articles on the Industrial Internet of Things (IIoT) and how it is transforming manufacturing.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

SCADA at the junction, Managing risk through maintenance, Moving at the speed of data
Flexible offshore fire protection; Big Data's impact on operations; Bridging the skills gap; Identifying security risks
The digital oilfield: Utilizing Big Data can yield big savings; Virtualization a real solution; Tracking SIS performance
click me