Everything You Need to Know About One-Shot Instructions
Nov 16, 2026
Learn why one PLC button press counts 40 times, and fix it with the rising and falling edge contacts. Build a one shot and test every case in a free simulator.
⚡ QUICK ANSWER
Press a button once, hold it four seconds, and an increment instruction adds 40 rather than 1. Nothing is broken. A PLC reads its inputs, solves every rung top to bottom, writes its outputs, and then does it all again, and this simulator does that ten times a second. For the whole four seconds the rung is true, so the increment runs on all forty scans. The fix is a contact that passes power for exactly one scan: a rising edge contact, drawn with a P inside it, conducts only on the scan where its bit goes from off to on. A falling edge contact, drawn with an N, does the same when the bit goes from on to off. The part most people get wrong is which one to use. On a normally closed stop button the input is on until you press it, so the press is a falling edge and a rising edge contact would count the release instead. Counters already have edge detection built in, which is why they never needed this. Math, move and toggle logic do not.
📖 FULL STEP-BY-STEP + DOWNLOADS (example program, Structured Text file, screenshots)
https://accautomation.ca/rising-edge-one-shot-ladder-logic-p-n-contacts/
⏱️ TIMESTAMPS
0:00 Rising Edge and One-Shot in Ladder Logic
0:41 One Press, 40 Counts, and Why the Scan Does It
1:21 The Rising Edge (P) Contact
1:41 The Falling Edge (N) Contact
2:00 Why Counters Never Needed This
2:21 Defining the Task, the IO and the Sequence
3:34 The Nine Rungs: Wrong Way and Right Way
3:57 Push On, Push Off from One Button
4:22 Counting a Normally Closed Stop Button
4:43 Structured Text: R_TRIG and F_TRIG
5:06 Testing Every Case on the Simulator
7:02 Four Common One-Shot Mistakes
📚 WHAT YOU'LL LEARN
✅ Work out why a plain contact feeding an increment counts once per scan, by following what the PLC scan actually does while a button is held
✅ Use a rising edge (P) contact to pass power for exactly one scan when a bit turns on, and a falling edge (N) contact for when it turns off
✅ Pick the right edge for a normally closed button, where the input is on until pressed, so the press is the falling edge and not the rising one
✅ Turn one Start button into push on push off motor control, by driving a toggle rung from a one scan pulse instead of the button itself
✅ Write the same logic in Structured Text with the IEC R_TRIG and F_TRIG function blocks, which replace the edge contacts ladder does not have
❓ FREQUENTLY ASKED
Q: Why does my PLC counter or math instruction trigger multiple times on one button press?
A: Because the rung stays true for as long as the button is held, and the instruction runs on every scan it is true. A four second press at a ten per second scan rate is forty executions. An edge contact limits it to the single scan where the input changed.
Q: What is the difference between a P contact and an N contact?
A: A P contact is the rising edge: it passes power for one scan when its bit goes from off to on. An N contact is the falling edge: one scan when the bit goes from on to off. Use P for a press on a normally open button, N for a release, or for a press on a normally closed one.
Q: Why does my rising edge contact not work on my Stop button?
A: Because a Stop button is normally closed, so its input sits on and goes off when pressed. That makes the press a falling edge. A rising edge contact there fires when you let go of the button, not when you push it.
Q: Do I need a one-shot with a counter instruction?
A: No. Counter instructions have edge detection built in and count once per false to true change of the rung. Math, move and toggle logic have no such thing and will run on every scan, which is where the one-shot is needed.
👉 Full step-by-step with the example program: https://accautomation.ca/rising-edge-one-shot-ladder-logic-p-n-contacts/
🔗 MORE RESOURCES
▶ Run it yourself, free in the browser: https://accautomation.ca/simulator/
▶ Why counters never needed a one-shot: https://youtu.be/OYDyXmTduXU
▶ Example ladder logic file: https://accautomation.ca/simulator/acc-example-one-shot.json
▶ Structured Text file: https://accautomation.ca/simulator/acc-example-one-shot.st
▶ PLC Beginners Guide: https://accautomation.ca/programming/plc-beginners-guide/
▶ Free eBooks: https://accautomation.ca (subscribe for download)
🛒 RECOMMENDED HARDWARE
▶ Shop: https://www.automationdirect.com/
▶ Parts Guide: https://www.accautomation.ca/purchase-find-parts/
💬 Questions? Drop a comment below.
🔔 New tutorials every Monday — Subscribe and hit the bell!
#PLC #LadderLogic #IndustrialAutomation #PLCProgramming #ACCAutomation #PLCTutorial #LearnPLC #StructuredText #PLCSimulator
Regards,
Garry
ACC Automation
http://www.accautomation.ca
Show More Show Less 
