Learn PLCs free

Beginner's Guide to PLC Programming: From Zero to First Program

A practical beginner path from the PLC scan cycle and I/O model to a tested first ladder program, with a realistic practice roadmap and clear hardware and safety boundaries.

Twelve-week PLC programming beginner roadmap progressing through scan and I/O, timers and interlocks, vendor project workflow, and supervised hardware verification.
Advance when the acceptance tests pass, not merely because a calendar block ended. Simulation practice and supervised hardware validation are separate stages.

Beginner's Guide to PLC Programming: From Zero to First Program

PLC programming for beginners starts with one mental model: read inputs, execute logic, update outputs, then repeat. This guide is for people with no PLC background. You will learn that model, write a stop-dominant first ladder program, test it against a small acceptance table, and understand when browser practice must give way to a vendor tool and supervised hardware work.

What Is a PLC?

A Programmable Logic Controller is an industrial computer that reads inputs (sensors, switches), executes control logic, and writes outputs (motor commands, valves and indicator states). It repeats that work according to its configured task and I/O schedules. Do not assume one universal scan time: controller model, task configuration, program size, remote-I/O rate and communications all affect when a signal is observed and acted on.

Unlike a regular computer:

  • PLCs are hardened — designed to run 24/7 in factories for decades.
  • PLCs are deterministic — they complete their scan in a bounded time, every time.
  • PLCs handle the physical world — they directly control motors, valves, and actuators.

PLCs are common in manufacturing, material handling, utilities, process plants and infrastructure, but the controller architecture and approved programming environment are project-specific.

Beginner PLC programming workbench with pushbuttons, modular I/O, a conveyor, tank-level sensor and ladder logic visible on a laptop.
A useful beginner model traces one signal from a field input, through the program decision, to an output command and its feedback.

What Does a PLC Program Actually Do?

A PLC program is a set of rules that answer the question: "given the state of all my inputs, what should my outputs be right now?"

For example, a simple motor control program might say:

  • If the Start button is pressed AND the Stop button is not pressed AND the motor is not already running, start the motor.
  • If the Stop button is pressed, stop the motor.
  • If the machine-safety system removes its healthy/permit signal, remove the ordinary run request and require a controlled recovery.
  • If the motor is running for more than 5 minutes continuously, show a warning.

A standard PLC program can coordinate production behavior, but it is not a substitute for a risk assessment, safety-rated devices, verified wiring and validated safety logic.

The Scan Cycle

Every PLC follows the same basic loop:

  1. Read all inputs — sample every physical input and update the PLC memory.
  2. Execute the program — run through your logic, using the latest input values.
  3. Write all outputs — send the computed output states to physical outputs.
  4. Housekeeping — communications, diagnostics, internal maintenance.

This repeats continuously, but modern controllers can also run periodic and event tasks, asynchronous communications and independently updated remote I/O. Measure the actual task and signal path instead of relying on a generic millisecond range.

Understanding the scan cycle is the first mental model you need. Many beginner bugs come from misunderstanding when inputs are read, when outputs change, and what happens to timers during the scan.

PLC scan-cycle diagram showing input sampling, ladder-logic execution, output update and communications with task timing boundaries.
The simple scan model is a starting point. Verify task, I/O and communications timing on the actual controller.

How PLC Programming Differs from Regular Programming

If you are coming from software development, several things will feel backwards:

1. Cyclic execution is common

Many PLC routines execute cyclically, so logic repeatedly evaluates current state. Modern controllers may also support periodic or event tasks. Learn the target scheduler and avoid assuming that every routine executes in one undifferentiated loop.

2. State lifetime must be explicit

PLC platforms provide local, program, controller, block-instance and global scopes in different forms. What matters is knowing which state persists between calls, which data is retained across restart, and which routine or block is allowed to write it.

3. Execution Time Is Bounded

A PLC task must finish within its configured timing budget. Unbounded loops, blocking designs and excessive work can delay other control behavior or trigger a watchdog. Use non-blocking state and timer patterns and measure worst-case execution on the target.

4. The Code Runs Forever

There is no "main is done, exit now." The PLC starts the program when it powers up and runs it until power is removed. Your code has to cope with being halfway through any operation when power cycles.

5. Safety Matters

Control software can affect physical equipment. Ordinary PLC logic must respect the approved safety design and must never bypass a safety function. Safety functions require the applicable lifecycle, suitable components, validated safety logic and documented tests.

The Current IEC 61131-3 Language Suite

IEC 61131-3:2025 Edition 4 covers three programming languages plus Sequential Function Chart elements. You will mainly encounter two or three:

  1. Ladder Logic (LD) — Visual language that looks like electrical relay diagrams. Most common starting point.
  2. Structured Text (ST) — Text-based, Pascal-like. Good for complex calculations.
  3. Function Block Diagram (FBD) — Graphical block-wiring. Good for control loops.
  4. Sequential Function Chart (SFC) — Step-by-step state machines. Good for sequences.

Legacy note: Instruction List (IL) was part of Edition 3 but was removed from the current Edition 4 suite. You may still encounter it in older projects.

Start with ladder logic. Once you are comfortable, add structured text for the things ladder handles poorly (math, loops, strings).

Your First Ladder Logic Rung

The simplest possible rung: a Start_Button contact on the left side of the rung, directly connected to a Motor coil on the right. When Start_Button is closed (pressed), the Motor coil energises. This is a momentary start — the motor runs only while the button is held.

Add a seal-in and a stop:

  • A Start contact in series with a Stop (examine-on-normally-closed) contact drives the Motor coil.
  • In parallel with the Start contact, add a Motor feedback contact.

Now: press Start, and the Motor energises. The Motor feedback contact closes, sealing the rung. The motor stays on even after Start is released. Press Stop, the series chain breaks, the Motor de-energises.

This is the three-wire motor control circuit, and it is the "hello world" of PLC programming. We cover it in depth in our motor start/stop tutorial.

Stop-dominant ladder-logic seal-in circuit with start request, stop condition, motor run state and overload permissive.
Program symbols describe logical state, not the physical contact type. Document the field wiring and map it to unambiguous tag names.

Before moving on, test at least these cases:

Initial run state Start Stop requested Overload fault Expected run request
FALSE FALSE FALSE FALSE FALSE
FALSE TRUE FALSE FALSE TRUE
TRUE FALSE FALSE FALSE TRUE
TRUE FALSE TRUE FALSE FALSE
TRUE FALSE FALSE TRUE FALSE
FALSE TRUE TRUE FALSE FALSE

Your first twelve-week practice milestones

A calendar is not an acceptance test, so use the phases below as milestones rather than promises.

Weeks 1–3 — Concepts and first rung

  • Understand the scan cycle.
  • Learn the current IEC language suite and recognise legacy Instruction List.
  • Read about ladder logic contacts, coils, and rungs.
  • Build a mental model of PLC memory (inputs, outputs, internal bits, timers, counters).

Weeks 4–6 — Timers, counters and state

  • Master contacts, coils, and branch logic (parallel rungs).
  • Understand the seal-in pattern for motor control.
  • Learn the standard timers (TON on-delay, TOF off-delay, TP pulse).
  • Learn counters (CTU, CTD, CTUD).

Weeks 7–9 — Vendor project workflow

  • Write a traffic-light sequence.
  • Write a conveyor-with-photoeye sort.
  • Understand set/reset coils.
  • Learn how to track fault states and alarms.

Weeks 10–12 — Supervised transfer

  • Build a batch-mixer or bottling-line scenario end to end.
  • Add HMI-style status bits.
  • Add fault handling.
  • Review your code like an instructor would.

Practise logic in a simulator, then move into the approved vendor environment and supervised hardware when the project requires it. For guided practice, browse the ladder logic tutorial.

PLC beginner testing a conveyor photoeye sequence with start and stop controls, live ladder status and a written fault checklist.
A useful practice project includes the requirement, I/O list, logic, abnormal cases and captured results—not code alone.

Choose tools by the next learning objective

You can learn the scan cycle, Boolean logic, timers and sequences without committing to an expensive vendor licence. Do not, however, treat a learning simulator as proof that native project files, firmware behavior, safety instructions, wiring or real I/O will behave identically.

Objective Appropriate starting tool
Learn Ladder, timers, counters and state A browser or desktop learning simulator with observable I/O
Learn IEC POUs and task configuration CODESYS Development System or OpenPLC, within their documented limits
Commission a named controller The manufacturer-supported engineering tool and version for that controller
Learn physical I/O and diagnostics A supervised, documented hardware bench with suitable protection
Validate a safety function The approved safety lifecycle, hardware, toolchain and verification procedure

Disclosed browser practice option

PLC Simulation Software is operated by the same publisher as plcprogramming.io. It provides a non-expiring free account, 8 listed learning dialects and 140 source-catalogued practice records in the versioned product catalogue. Use it for repeatable logic exercises and simulated I/O—not as a production PLC or exact emulator of every vendor runtime.

PLC Simulation Software browser editor showing editable ladder logic, simulated input controls and live output status for a beginner exercise.
Real product capture: browser practice helps you repeat logic tests before moving into a vendor-specific project.

Common Beginner Mistakes

  1. Watching tutorials without writing code. Video tutorials are passive. You learn by building, not by watching.
  2. Skipping the scan cycle. If you do not internalise how the scan works, you will write code that "works" in a tutorial and fails mysteriously on real hardware.
  3. Treating a program bit as a safety function. A simulated E-stop bit is useful for sequence testing but does not replace safety-rated devices, wiring, logic or validation.
  4. Hiding command priority. Test start and stop together and make the required dominant condition explicit.
  5. Confusing logical symbols with physical contacts. An examine-if-open instruction is not proof that the field contact is physically normally closed; document polarity and fail state separately.
  6. Not commenting code. Your future self in six months will thank you.
  7. Programming without paper. Sketch the logic on paper first. Draw the state machine. Draw the sequence. Then open the editor.

Where to Go Next

After the first month, pick a direction:

  • Want to ship real-world projects? Pick a vendor (Siemens, Rockwell, or Codesys), get certified, and start with maintenance or commissioning roles.
  • Want depth on programming patterns? Work through all the standard scenarios (motor, traffic light, conveyor, elevator, batch mixer, PID temperature). Then add structured text.
  • Want real-hardware experience? Set up a Raspberry Pi with OpenPLC. Connect some switches and LEDs. Write code that flashes them in real sequences.
  • Want to understand industrial context? Read about the industries that use PLCs and the protocols that connect everything.

For certification and career paths, see our PLC career guide. For vendor-specific tutorials, browse the PLC guides section.

Conclusion

PLC programming can be entered through technician, electrician, engineering, software and apprenticeship routes. The qualification and supervised-experience requirements depend on the role, employer and jurisdiction. You do not need to buy a commercial licence before writing your first rung; you do need disciplined practice, clear test evidence and respect for the project’s safety and commissioning procedures.

Start with ladder logic. Build the motor-control seal-in rung, test the simultaneous-command and fault cases, then add a traffic-light sequence and conveyor photoeye. Progress when you can explain and reproduce the result—not when an arbitrary study period has elapsed.

PLC learner transferring a tested simulator exercise to a supervised hardware bench with an I/O checklist and recorded commissioning limits.
Simulation evidence and supervised hardware evidence answer different questions; a complete learning path includes both.

Sources and scope

Examples on this page are vendor-neutral teaching patterns. Recreate and verify them in the engineering software, controller, firmware, I/O and safety architecture selected for the real project.

Frequently Asked Questions

How long does it take to learn PLC programming?

There is no reliable universal duration. Measure progress by tasks: explain the scan and I/O path, implement and test stop-dominant logic, use timers and counters correctly, diagnose a forced fault, archive a project, and transfer the result into a supported vendor environment. Professional commissioning competence also requires supervised field experience.

Do I need to buy a real PLC to learn?

Not for the first logic exercises. A simulator can teach state, timers, counters and testing without hardware. Use real hardware when you need to learn wiring, electrical diagnostics, communications, module configuration and commissioning, ideally on a supervised bench selected for the vendor ecosystem you intend to use.

What mathematics do I need to know?

For ladder logic: basic arithmetic and Boolean algebra. For PID loops: intuitive understanding of proportional/integral/derivative behaviour (the algebra is not complex). For advanced analog work: some linear systems and control theory helps but is not essential for most day-to-day work. Calculus is rarely required.

Can I learn PLC programming part-time while working another job?

Yes. Use a repeatable schedule built around completed exercises rather than hours watched: one requirement, one implementation, one abnormal-case table and one captured result per study block. Seek review from an instructor, experienced controls professional or technically focused community before treating a project as portfolio evidence.

What is the scan cycle and why does it matter?

The scan cycle is the useful model of reading inputs, executing scheduled logic, updating outputs and performing system work. Modern controllers may also use periodic and event tasks, asynchronous communications, remote-I/O intervals and immediate-I/O instructions. It matters because task and signal timing determine whether a transition is seen and when an output can respond.

What is the first project I should build after learning the basics?

Build a motor start/stop request with a seal-in path, stop-dominant behavior, overload permissive and feedback timeout. Treat any E-stop input as a simulated status only, not a real safety function. Test simultaneous start/stop, loss of permissive, missing feedback, reset and restart before moving to a traffic-light or conveyor sequence.

Free PLC simulator

Stop reading, start doing

Write ladder logic in your browser, hit Run, and watch machine scenarios react. A 12-lesson curriculum across 8 PLC dialects — free account, no credit card.

Practice PLCs free →