PLC Simulator
PLC field notesbeginner

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

Basic PLC programming is a surprisingly small set of patterns — maybe twenty rungs — that appear in almost every real program. Learn them in the right order, in the browser, with automated tests, and you will never have to re-learn the fundamentals.

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.

Reference tableSwipe
RungPatternPrimary use
4TON — delay ONWait X seconds after input before acting
5TOF — delay OFFKeep acting X seconds after input disappears
6TP — pulseEmit a fixed-length pulse on rising edge
7Self-resetting TONFree-running oscillator (blinker)
8Two TONs chainedSequence 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 practice basic PLC programming?

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

Next steps

ShareX / TwitterLinkedIn

From reading to running logic

Practice this yourself in the simulator

Start with guided PLC practice in your browser. No install and no credit card required.

Start practising free

Continue learning

Related field notes

All articles
beginner
fundamentals

PLC Programming for Absolute Beginners (2026 Roadmap)

A gentle, non-jargon guide to PLC programming for people with no electrical background. Covers the scan cycle, your first rung, the five things that will confuse you, and a four-week starter plan that you can follow in a browser without installing anything.

9 min read
training
career

The Complete PLC Programming Course for 2026 (Self-Paced, Browser-First)

A 12-week PLC programming course that takes you from zero electrical background to writing production-grade ladder logic for Allen-Bradley, Siemens, and IEC PLCs. Self-paced, browser-based, no install, no vendor lock-in.

14 min read
tools
beginner

Best PLC Simulators for Students (Free and Paid)

Compare the best PLC simulators for students in 2026: browser-based, desktop, free, and paid options. Includes OpenPLC, Codesys, LogixPro, and browser simulators.

8 min read

Competency and practice field guide

Basic PLC programming guide: practice plan

Direct answer

The learner can translate one machine requirement into tags and logic, predict a scan, run normal and changed cases and explain the physical result.

Written for complete beginners learning scan execution, Boolean logic, start-stop control, timers, counters, state and diagnostics.

an adult PLC learner explaining a tested program, fault record and practical assessment evidence to an instructor while studying PLC programming fundamentals from I/O through tested machine behavior
System map / 02

NODE 01observable

Scope

Machine requirement, initial state, inputs, outputs, independent feedback, scan cycle, Boolean conditions, memory, timer, counter, state, stop priority and reset.

NODE 02observable

Signal path

Field condition through input image, instruction evaluation, internal state, output command, interface device, actuator and physical feedback.

NODE 03observable

Baseline practice

A start-stop or sequence program produces repeatable start, run, stop and reset behavior from a known state.

NODE 04observable

Edge cases

Simultaneous buttons, signal chatter, exact timer preset, counter rollover, lost feedback, program restart and power return.

NODE 05observable

Fault practice

A requirement, input, mapping, logic, memory, timing, output, actuator or feedback mismatch.

NODE 06observable

Transfer to the job

The behavior documented and recreated in the intended controller under supervised equipment tests.

Answer surface / 07

What should a PLC programming beginner learn first?

Start with electrical input states, scan behavior, normally open and closed logic, one output path and independent feedback before adding timers and sequences.

How do I know whether a PLC program works?

Write observable acceptance cases and test normal, stop, boundary, fault, reset and restart behavior—not only whether the code compiles.