If you are new to PLC programming, you may have encountered terms such as Rising Edge, Positive Edge, One-Shot, or Pulse Detection.
At first glance, they may seem complicated.
Why can’t a PLC simply detect whether a button is ON or OFF?
Why do many PLC programs need a special rising-edge instruction when a push button is used?
The answer becomes much easier to understand once you understand how a PLC scan cycle works.
In simple terms:
A rising edge is the moment when a digital signal changes from 0 to 1.
The important point is that the PLC detects the transition, not the entire period during which the signal remains ON.
This small concept is extremely important in industrial automation. It is commonly used for counting products, triggering one-time operations, changing machine states, starting sequences, and preventing a single button press from being interpreted as multiple commands.
1. What Is a Rising Edge?
A digital PLC input normally has two basic states:
- 0 = OFF
- 1 = ON
Suppose a push button is connected to a PLC digital input.
When the button is released:
Input = 0
When the button is pressed:
Input changes from 0 → 1
That exact transition is called a rising edge.
It can be represented simply as:
0 → 1 = Rising Edge
By comparison:
1 → 0 = Falling Edge
A rising edge therefore does not mean that a signal is simply ON.
It means that the signal has just changed from OFF to ON.
This distinction is fundamental in PLC programming.
2. Why Does the PLC Need Rising Edge Detection?
The reason becomes clear when we consider the PLC scan cycle.
A PLC continuously performs a sequence similar to:
Read Inputs → Execute Program → Update Outputs → Repeat
This process may occur many times per second.
Now imagine pressing a push button and holding it down for two seconds.
The physical button may produce:
0 → 1 → 1 → 1 → 1 → 1 → 0
The signal remains at 1 for a relatively long period.
If your PLC program simply checks:
“Is the button ON?”
then the PLC may see the button as ON during many consecutive scan cycles.
For some applications, that is exactly what you want.
But for other applications, you only want the PLC to respond once, at the moment the button is pressed.
This is where rising-edge detection becomes useful.
3. Button ON Is Different From a Rising Edge
Consider two different control strategies.
Method 1: Directly Use the Button Input
Suppose a button is connected to input I0.0.
Your program simply uses:
I0.0 → Start Motor
When the operator presses and holds the button, the PLC continues to see:
I0.0 = 1
As long as the logic conditions remain true, the associated operation can continue to be enabled.
This method is appropriate when the application requires a continuous ON condition.
Method 2: Use Rising Edge Detection
Now suppose the same button is connected to I0.0, but the PLC detects its rising edge.
The PLC only generates a short pulse when the signal changes:
0 → 1
The resulting behavior is approximately:
Button released: 0
Button pressed: 1 → trigger one scan pulse
Button remains pressed: no additional rising edge
Therefore:
One button press = One trigger
This is the major advantage of rising-edge detection.
4. Why Is This Important for Counters?
One of the most common applications of rising-edge detection is counting.
Imagine a photoelectric sensor detecting products on a conveyor.
The sensor changes to ON when a product enters its detection area.
Suppose one box remains in front of the sensor for several PLC scan cycles.
If the PLC simply counts whenever:
Sensor = ON
the same box could potentially be counted repeatedly.
That would produce an incorrect result.
Instead, the PLC can detect the rising edge:
Sensor: 0 → 1
and generate exactly one counting pulse.
The logic becomes:
Product detected → Rising Edge → Counter +1
Once the sensor remains ON, no additional rising edge is generated.
When the product leaves:
1 → 0
the sensor returns to its normal state and becomes ready to detect the next product.
This makes rising-edge detection extremely useful for:
- Product counting
- Part counting
- Packaging machines
- Conveyor systems
- Production statistics
- Batch processing
5. Rising Edge Helps Prevent Repeated Operations
Another important application is machine control.
Imagine a machine with several steps:
Step 1: Clamp → Step 2: Process → Step 3: Release → Step 4: Return
The operator may press a button to confirm that Step 1 has been completed.
If the PLC uses only a continuously active signal, holding the button could potentially affect the logic for multiple scans.
With a rising-edge trigger, the PLC can interpret the operator’s action as:
“The operator has just pressed the confirmation button.”
This produces a single event.
The program can then move to the next sequence.
This approach is particularly useful for sequential control systems.
6. Rising Edge vs. Level Detection
One of the easiest ways to understand the difference is to compare level detection and edge detection.
Level Detection
The PLC asks:
“Is the signal currently ON?”
Example:
0 → 1 → 1 → 1 → 1 → 1
The PLC sees the signal as ON throughout the entire period.
Rising Edge Detection
The PLC asks:
“Has the signal just changed from OFF to ON?”
Example:
0 → 1 → 1 → 1 → 1 → 1
Only the transition at the beginning is detected.
Therefore:
Level = Current State
Rising Edge = State Change
This simple distinction explains many PLC programming problems encountered by beginners.
7. A Rising Edge Usually Produces a One-Scan Pulse
In many PLC implementations, a rising-edge instruction produces a temporary internal pulse.
For example:
Input:
0 → 1 → 1 → 1
Rising-edge output:
0 → 1 → 0 → 0
The output may therefore be active for only one PLC scan.
This short pulse can then be connected to another instruction, such as:
- Counter
- Set/Reset logic
- Step transition
- Data acquisition
- One-time calculation
- Sequence trigger
The exact implementation depends on the PLC manufacturer and programming environment.
8. How Does a PLC Know That the Signal Has Changed?
The PLC needs to compare the current signal state with its previous state.
Conceptually, it remembers:
Previous state
and compares it with:
Current state
A rising edge occurs when:
Previous state = 0
and
Current state = 1
Therefore:
0 + 1 → Rising Edge
After detecting the transition, the PLC updates its stored state.
On the next scan, if the input is still 1:
Previous state = 1
Current state = 1
There is no new rising edge.
This is why holding the button does not continuously generate new rising-edge pulses.
9. Rising Edge Instructions in Different PLC Brands
Different PLC manufacturers use different names and programming instructions for essentially similar concepts.
For example, depending on the PLC platform, you may encounter terms such as:
- Rising Edge
- Positive Edge
- Positive Transition
- One-Shot
- One-Shot Rising
- Pulse
- Differential Up
- P instruction
The exact instruction and syntax depend on the PLC family and programming software.
Siemens PLCs
In Siemens PLC programming, positive-edge detection can be implemented using edge-detection instructions or equivalent logic.
For example, Siemens S7-1200 and S7-1500 systems can use positive-edge detection to generate a pulse when an input changes from 0 to 1.
A simplified logic structure can be represented as:
Button Input → Positive Edge → Counter / Sequence Trigger
AB PLCs
In AB control systems, similar functionality is commonly implemented using one-shot instructions or equivalent edge-detection logic.
For example, a one-shot rising instruction can generate a single pulse when the triggering condition transitions from false to true.
The terminology may be different, but the underlying engineering principle is similar:
Detect the transition instead of continuously reacting to the ON state.
10. Practical Example: Counting Products on a Conveyor
Let’s look at a simple industrial application.
A conveyor carries boxes past a photoelectric sensor.
The sensor output is connected to a PLC digital input.
When a box enters the detection area:
Sensor = 0 → 1
The PLC detects the rising edge and sends one pulse to a counter.
The counter increases:
1 → 2 → 3 → 4 → 5…
When the box moves away:
Sensor = 1 → 0
The system resets its detection condition and waits for the next box.
The important point is that the PLC does not count every scan cycle during which the box remains in front of the sensor.
It counts the event.
This is one of the simplest and most useful examples of edge detection in industrial automation.
11. Practical Example: Manual / Automatic Mode Switching
Rising-edge detection can also be useful when switching machine operating modes.
Suppose a machine has:
Manual Mode / Automatic Mode
The operator presses a selector or push button to change the mode.
You may want each press to cause exactly one transition:
Manual → Automatic
and the next press:
Automatic → Manual
Using an appropriate edge-triggered method can make the logic easier to control.
Instead of continuously reacting to the button’s ON state, the PLC responds to the operator’s actual button press.
This can make the machine state logic more predictable.
12. Practical Example: Multi-Step Machine Sequences
Industrial machines often operate through multiple steps.
For example:
Clamp → Drill → Retract → Unclamp
Each step may need a confirmation signal before the next step starts.
A rising edge can be used to trigger the transition from one step to the next.
For example:
Step 1 Complete → Rising Edge → Start Step 2
This prevents the control program from repeatedly interpreting the same confirmation signal as a new command.
In more advanced applications, edge detection may work together with:
- State machines
- Timers
- Counters
- Interlocks
- Set/Reset logic
- HMI commands
- Servo positioning
- Motion control
13. Rising Edge Is Not the Same as a Long-Pressed Button
This is an important concept for beginners.
Suppose a button is pressed and held.
The input may remain:
1 1 1 1 1 1 1
A rising edge occurs only at the beginning:
0 → 1
It does not mean:
1 → 1 → 1 → 1
Therefore, if your application needs to know how long a button has been pressed, rising-edge detection alone is not enough.
You may instead need:
- On-delay timer
- Off-delay timer
- Input state monitoring
- Pulse measurement
- Long-press logic
The correct instruction depends on the control requirement.
14. Rising Edge vs. Falling Edge
PLC programmers also frequently use falling-edge detection.
The principle is the opposite.
Rising Edge
1. OFF → ON
0 → 1
Typical applications include:
- Button press detection
- Product counting
- Start commands
- Event triggers
- Sequence transitions
Falling Edge
ON → OFF
1 → 0
Typical applications can include:
- Button release detection
- End-of-signal events
- Sequence completion
- Detecting when a sensor becomes inactive
Understanding both types of edge detection is essential for developing reliable PLC logic.
15. Why Edge Detection Makes PLC Programs Cleaner
Using rising-edge logic is not only about preventing repeated counting.
It can also make the control program easier to understand and troubleshoot.
Compare these two concepts:
Continuous signal → Directly controls an operation
versus:
Signal transition → Generates an event → Triggers an operation
The second structure clearly separates:
Trigger
from
State
This distinction can be extremely useful in larger PLC programs.
For example:
Button Press → Trigger Event
while:
Machine Ready → Current State
The program becomes easier to organize because an event does not have to be confused with a permanent machine condition.
16. Common Beginner Mistakes
Several common PLC programming mistakes are related to edge detection.
Mistake 1: Counting a continuously ON signal
If a counter is directly driven by a continuously active sensor, the program may not behave as expected.
For event-based counting, consider whether an edge-detection instruction is required.
Mistake 2: Confusing ON with “just turned ON”
These are not the same.
ON describes a state.
Rising edge describes a transition.
Mistake 3: Ignoring PLC scan timing
A PLC does not process a digital input in exactly the same way as a human perceives a button press.
The input must be detected according to the PLC’s input processing and scan architecture.
Very short pulses may require appropriate high-speed inputs, hardware pulse capture, or specialized instructions depending on the application.
Mistake 4: Using the wrong edge
If the machine needs to respond when a signal turns ON, use positive/rising-edge logic.
If it needs to respond when the signal turns OFF, falling-edge logic may be appropriate.
17. A Simple Rule to Remember
If you are new to PLC programming, remember these two rules:
0 → 1 = Rising Edge
1 → 0 = Falling Edge
And one more:
A level tells you the current state. An edge tells you that something has just happened.
Once you understand this difference, many PLC programs become much easier to read.
Conclusion
Rising-edge detection is one of the simplest concepts in PLC programming, but it plays an important role in real industrial automation.
It allows a PLC to distinguish between:
“The button is ON”
and
“The button has just been pressed.”
That distinction is essential for applications such as product counting, machine sequencing, mode switching, event triggering, and one-time operations.
Whether you are working with a Siemens S7-1200, S7-1500, Allen-Bradley ControlLogix, CompactLogix, Mitsubishi PLC, or another industrial controller, the terminology and instructions may differ, but the underlying principle remains the same.
0 → 1 is a rising edge.
Once you understand that simple transition, concepts such as one-shot logic, pulse generation, counters, and sequence control become much easier to understand.
For industrial automation projects, selecting the right PLC is only the first step. The correct I/O modules, HMI, communication modules, industrial drives, sensors, and programming strategy are equally important for building a reliable control system.
At PLC Provider, we supply industrial automation components from leading manufacturers, including Siemens, Allen-Bradley, ABB, and other major brands. If you are looking for PLC CPUs, I/O modules, HMIs, drives, or other automation hardware, choosing the correct component for your application can help create a more stable and maintainable automation system.
