PLC Simulator
beginner
basics
ladder logic
fundamentals

Basic PLC Programming: The 20 Rungs You Will Use for the Rest of Your Career

By PLC Simulation Software11 min read

Basic PLC programming: the 20 rungs you will use forever

Basic PLC programming is a much smaller subject than the textbooks suggest. Strip out the vendor-specific bloat, the SCADA integration, the OOP-adjacent UDT discussions, and what's left is about twenty rungs — patterns you'll see in every real program, from a two-button motor starter to a pharmaceutical batch reactor. Learn them properly, in the right order, and you will never have to re-learn the fundamentals.

This post is the back-of-an-envelope course. If you follow it end to end, you'll be dangerous in three weeks.

Three things to learn before any rung

Before we write a single contact, three mental models that every sentence below assumes you have. Skip these and nothing else will make sense.

The scan cycle

A PLC repeats three steps sixty times a second:

  1. Read every input into the input image table.
  2. Solve the ladder, top to bottom.
  3. Write the output image table back to physical outputs.

This order matters. It's why your output is "one scan late" relative to its input. It's why a falling edge of Stop can't trigger Run on the same scan. If this confuses you, read our scan cycle explainer before continuing.

Normally open vs normally closed

An input [ ] (XIC in Rockwell) is TRUE when its signal is TRUE. An input [/] (XIO) is TRUE when its signal is FALSE. A Stop button on a real machine is always wired normally-closed and read with [ ] — because if the wire gets cut, your program sees a disconnected button as if Stop is pressed, which is the safe failure mode. Fail safe is not a suggestion.

Coils vs contacts

A coil writes a bit. A contact reads a bit. You can have many contacts reading a bit, but in a well-written program only one coil writes each bit. (There are exceptions — SET / RESET pairs, latches — but they're explicit, not accidental.)

With those three in your head, on to the twenty rungs.

Rung 1 — start / stop with seal-in

Rung 1 — start/stop with seal-in

The first rung is the only rung that absolutely must be burned into muscle memory. In IEC 61131-3:

| Start  Stop                         Run |
|---[ ]---[/]-----+-----------------( )---|
|                 |                        |
| Run             |                        |
|---[ ]-----------+                        |

The seal-in — Run's own contact, in parallel with Start — is what keeps the motor running after the operator releases the Start button. The [/] on Stop is there because Stop is wired NC in the field (see above). If you get nothing else from this post, get this rung.

Practice in our Motor Start/Stop scenario. Free tier. 20 minutes.

Rung 2 — forward / reverse with interlock

Rung 2 — forward/reverse with interlock

Now do it for a motor that runs in two directions. The trick is that Fwd and Rev contactors must never both be on — if they are, you get a line-to-line short. The interlock is two contacts:

| Fwd  Rev_Out                        Fwd_Out |
|--[ ]---[/]------------------------(     )---|
|                                              |
| Rev  Fwd_Out                        Rev_Out |
|--[ ]---[/]------------------------(     )---|

Each direction reads "the OTHER direction's output is NOT on" as a precondition. A normally-open aux contact on the physical contactor can add a hardware-level interlock — belt and braces.

Practice in Forward/Reverse Motor. Basic tier.

Rung 3 — jog / run

A real operator wants two modes:

  • Jog — motor runs only while the button is held.
  • Run — motor runs continuously, same start/stop pattern as Rung 1.

You need a selector switch (a two-position input in software) to decide which mode the Start button invokes. The rung:

| Mode_Run  Start  Stop                Run |
|---[ ]-------[ ]---[/]-+--------------( )--|
|  Mode_Run  Run        |                    |
|---[ ]-------[ ]-------+                    |
|                                            |
| Mode_Jog  Start  Stop                Jog  |
|---[/]-------[ ]---[/]----------------( )---|

Note Run has a seal-in, Jog does not. That's what makes it jog.

Practice in Jog / Run Motor Control.

Rungs 4–8 — timers

Five rungs, five timer patterns. Learn them all or you'll misuse TON for something that needs TP.

| Rung | Pattern | Primary use | |------|---------|-------------| | 4 | TON — delay ON | Wait X seconds after input before acting | | 5 | TOF — delay OFF | Keep acting X seconds after input disappears | | 6 | TP — pulse | Emit a fixed-length pulse on rising edge | | 7 | Self-resetting TON | Free-running oscillator (blinker) | | 8 | Two TONs chained | Sequence two delayed actions |

Our timers in PLC programming deep-dive walks each of these rung-by-rung with waveforms. It's the single most important reference in basic PLC programming.

Rungs 9–10 — counters

Two rungs cover the useful counter patterns:

  • CTU counting rising edges of a sensor → output when preset reached
  • CTUD counting up on conveyor entry, down on conveyor exit → "how many parts on the belt right now"

Reset logic is the part people get wrong. CTU.Reset is latched as long as the reset input is TRUE, so if you tie it to a sensor that chatters, your counter never accumulates. Debounce it — with a short TON — or use a one-shot.

Practice in Conveyor Sort.

Rungs 11–15 — state machines with phase variables

The 20 basic rungs, in the order to learn them

A bottling line doesn't have one rung. It has six phases — idle, infeed, fill, cap, label, discharge — and transitions between them. The novice approach is nested IF-THEN-ELSE ladder, which works for three states and collapses at five. The professional approach is an explicit PHASE integer variable and one rung per transition:

| PHASE=0  Start_Cycle                PHASE:=1 |
|---[EQ]-----[ ]-----------------------(MOV)----|
|                                                |
| PHASE=1  Fill_Complete              PHASE:=2 |
|---[EQ]----[ ]------------------------(MOV)----|

Each phase is a number. Each transition is a one-rung rule. Adding a new phase is one rung, not a ladder rewrite.

Practice in CIP Sequence Controller.

Rungs 16–17 — set / reset (latch / unlatch)

Use with care. Set and reset coils let a bit stay on after the rung that set it goes false — useful for phase transitions, dangerous if overused.

| Phase_Complete                       Phase_Done |
|------[ ]------------------------------(S)--------|
|                                                   |
| Reset_Cycle                          Phase_Done  |
|------[ ]------------------------------(R)--------|

Rule of thumb: for every S coil in your program, you must be able to point at the corresponding R coil. If you can't, you will one day find a latched bit and spend an afternoon hunting its setter.

Rungs 18–19 — one-shots (rising/falling edge)

A one-shot is TRUE for exactly one scan when its input rises (or falls). Essential for:

  • Incrementing a counter exactly once per operator button press
  • Triggering a recipe step on operator acknowledgement
  • Resetting a latched bit without holding the reset TRUE

In Rockwell: ONS. In IEC: R_TRIG / F_TRIG function blocks.

| Button   ButtonLast                   PulseOne |
|---[ ]-----[/]-------------------------( )-------|
|                                                  |
| Button                               ButtonLast |
|---[ ]---------------------------------( )-------|

Rung 20 — fault handling and reset

The rung your program never has until the first incident:

| Any_Fault                             Fault_Latch |
|-----[ ]---------------------------------(S)-------|
|                                                    |
| Reset_PB   Fault_Latch                Fault_Latch |
|------[ ]-------[ ]-----------------------(R)------|

Fault conditions latch. Operator acknowledges with a physical reset button. Don't auto-reset faults — the whole point of a fault is to force a human to look at it.

What you can do when you're done

When you're done with basics, you can do this

Those twenty rungs cover roughly 80% of what you'll write in the first five years of a PLC career. The remaining 20% is dialect-specific (AOIs, FBs, SCL libraries), process-specific (PID, analog scaling), or infrastructure (SCADA integration, recipe management).

At this point:

  • You can debug a race condition by counting scan cycles, not guessing.
  • You can read an RSLogix, Studio 5000, or TIA Portal project and find the start-stop rung in the first minute.
  • You can walk into a maintenance-tech interview and answer "how does a seal-in work" without notes.
  • You can move to PID, sequencers, and multi-step batch processes with a solid foundation.

Where to learn this for real

  1. Sign up free. Two scenarios, three lessons, a quiz, no card.
  2. Open Motor Start/Stop. Write Rung 1 until the tests pass. This is 80% of basic PLC programming.
  3. Move to Forward/Reverse Motor. Rung 2.
  4. Work through the 12-week PLC course. Rungs 3–20 are covered in Weeks 3–6.

Three weeks, the first one free. That's the whole basic PLC programming curriculum.

FAQ

Is PLC programming hard to learn?

Basic PLC programming is one of the easiest professional skills to pick up — four contacts, one coil, a handful of timer/counter blocks, and scan-cycle discipline. Advanced topics (PID, safety, multi-vendor portability) take years. The basics take weeks.

Is there a free basic PLC programming course?

Yes — our free tier covers the foundational rungs (Motor Start/Stop, Ladder Logic Basics). Full 40-scenario access is USD 99/year on the Basic plan.

How long does basic PLC programming take to learn?

Three weeks at 8 hours a week is enough for the 20 rungs above. Real-world fluency — reading a complex project quickly, spotting bad patterns, debugging intuitively — takes 6–12 months of daily practice.

What is the best programming language to start with on a PLC?

Ladder. It's the most common in industry, the easiest to learn visually, and it introduces you to scan-cycle thinking without syntactic distractions. Learn structured text second, and only once you're fluent in ladder. Our ladder-vs-ST post has the full comparison.

Do I need a PLC to practise basic PLC programming?

No. Everything in this post can be practised in our browser simulator against the same IEC 61131-3 semantics your physical PLC will run. Skills transfer 1:1.

Next steps

Share:X / TwitterLinkedIn

Practice this yourself in the simulator

3 scenarios free — no install, no credit card. Write real ladder logic against a live machine model.

Try the simulator free →

Related articles

ladder logic
function block

Ladder Logic vs Function Block Diagram: When to Use Each

Ladder logic suits discrete interlocks and relay replacement; function block diagram suits analog, PID, and reusable logic. Compare LD vs FBD and pick the right one.

June 7, 2026 · 8 min read
ladder logic
examples

PLC Programming Examples and Solutions (with Ladder Logic)

Eight classic PLC programming examples with full ladder logic solutions and explanations — motor seal-in, timers, counters, traffic lights, tank control and star-delta.

June 7, 2026 · 10 min read
fundamentals
career

PLC Programming vs Traditional Programming: Python, Arduino & C

How PLC programming differs from Python, C and Arduino: the scan cycle, ladder vs relay logic, determinism, and whether a software dev can make the switch.

June 7, 2026 · 9 min read