← Back to Blog

How to Program a PLC: Complete Beginner's Guide

August 6, 2026·15 min read·Guide

PLCs (Programmable Logic Controllers) control everything from conveyor belts to chemical plants. Learning to program them is one of the most valuable skills in industrial automation. This guide takes you from zero to your first working PLC program.

What is a PLC?

A PLC is a ruggedized industrial computer designed to control machines and processes. Unlike a standard PC, it's built to handle electrical noise, extreme temperatures, and continuous operation without crashing. It reads inputs (sensors, switches, encoders), executes your program, and controls outputs (motors, valves, lights, solenoids).

You'll find PLCs controlling:

  • Conveyor and material handling systems
  • HVAC and building automation
  • Food and beverage processing
  • Water treatment and pumping stations
  • Oil and gas facilities
  • Automotive assembly lines
  • Packaging machines

Step 1: Understand the Hardware

A PLC system has three main components:

  • CPU (Central Processing Unit): The brain. Executes your program in a continuous scan cycle.
  • I/O Modules: Input modules read sensors (digital: on/off, analog: 4-20mA). Output modules drive actuators (relays, transistors, triacs).
  • Power Supply: Converts AC power to the DC voltages the PLC needs internally.

Common PLC brands: Rockwell/Allen-Bradley (most common in North America), Siemens (Europe/global), Schneider Electric, Mitsubishi, Omron, Beckhoff.

For learning:You don't need hardware. Plaxio's built-in simulator lets you write and test PLC programs without buying any hardware.

Step 2: Choose a Programming Language

IEC 61131-3 defines 5 standard PLC programming languages. Beginners should start with one of the first two:

  • Ladder Diagram (LD): Looks like electrical wiring. Best for discrete control (motors, conveyors, interlocks). Start here if you have an electrical background.
  • Structured Text (ST): Looks like Pascal or C. Best for math, PID control, and complex algorithms. Start here if you have a programming background.
  • Function Block Diagram (FBD): Graphical blocks connected by wires. Good for signal processing and continuous control.
  • Sequential Function Chart (SFC): State machine representation. Good for batch processes and sequential operations.
  • Instruction List (IL): Assembly-like language. Rarely used in new projects — avoid for beginners.

Step 3: Install Your PLC Software

Every PLC vendor has its own IDE: Studio 5000 for Rockwell, TIA Portal for Siemens, EcoStruxure for Schneider. These cost thousands of dollars per year in licenses.

Start with Plaxio (free):Plaxio is a free IDE that supports all IEC 61131-3 languages and includes a built-in simulator. You can learn every concept, write real programs, and test them — all without paying for a vendor license. When you're ready to deploy to actual hardware, you export to the vendor format and import into their tool for the final download step.

Download Plaxio at plaxio.tech/download.

Step 4: Define Your I/O

Before writing a single line of code, define what inputs and outputs your program needs:

  • Inputs: What sensors/switches send signals to the PLC? (Start PB, Stop PB, Limit switch, Temperature sensor)
  • Outputs: What does the PLC control? (Motor contactor, Valve solenoid, Indicator light)
  • Internal bits: Logic flags your program needs internally (Motor_Running, Fault_Active, Timer_Done)

Create a tag list with descriptive names. Good naming now saves hours of debugging later.

// Example tag list for a simple conveyor
Start_PB      : BOOL  // Input: Start pushbutton (NO)
Stop_PB       : BOOL  // Input: Stop pushbutton (NC)
E_Stop        : BOOL  // Input: Emergency stop (NC)
Overload_Relay: BOOL  // Input: Motor overload relay (NC)
Motor_Out     : BOOL  // Output: Motor contactor coil
Run_Light     : BOOL  // Output: Green run indicator
Fault_Light   : BOOL  // Output: Red fault indicator
Motor_Running : BOOL  // Internal: Motor status bit

Step 5: Write Your First Program

Start with the simplest possible program: a motor start/stop circuit.

In Ladder Logic:

Rung 1: Motor Start/Stop with seal-in
|                                              |
|  Start_PB    Stop_PB    E_Stop    OL   Motor |
|----[ ]---+---[/]-------[/]------[/]---( )---|
|           |                                  |
|  Motor    |                                  |
|----[ ]---+                                   |
|                                              |

Rung 2: Run indicator
|                                              |
|  Motor        Run_Light                      |
|----[ ]--------( )---------------------------|
|                                              |

How it works:

  1. Press Start_PB → power flows through → Motor energizes
  2. Motor contact seals in (maintains power after releasing start)
  3. Press Stop_PB, E_Stop, or Overload trips → Motor de-energizes
  4. Motor bit drives Run_Light on Rung 2

Step 6: Simulate Before Hardware

Never go straight to hardware without simulation. In Plaxio:

  1. Click the Simulate button to start the built-in IEC 61131-3 runtime
  2. Toggle Start_PB TRUE — Motor should turn ON
  3. Release Start_PB (FALSE) — Motor should stay ON (seal-in)
  4. Toggle Stop_PB FALSE (it's NC) — Motor should turn OFF
  5. Toggle E_Stop or OL FALSE — Motor should also turn OFF

If the logic behaves correctly in simulation, you can be confident it will work on hardware.

Step 7: Add Timers and Counters

Real machines need time delays and counting. Add a warning light that blinks before starting:

Rung 1: Start command starts warning timer
|                                              |
|  Start_PB    Stop_PB                         |
|----[ ]-------[/]------[TON Warn_Timer 5s]---|
|                                              |

Rung 2: Warning light blinks during countdown
|                                              |
|  Warn_Timer.EN  Warn_Timer.DN  Warn_Light    |
|----[ ]----------[/]-----------( )-----------|
|                                              |

Rung 3: Motor starts when timer done
|  Warn_Timer.DN  Stop_PB  E_Stop  OL  Motor  |
|----[ ]---+------[/]------[/]----[/]--( )---|
|  Motor   |                                  |
|----[ ]--+                                   |

Step 8: Use AI to Learn Faster

One of the most effective ways to learn PLC programming today is using AI as a study partner. Plaxio's built-in AI can generate code from descriptions:

  • Type: "Motor starter with 5-second warning before starting" → Plaxio generates the full Ladder Logic
  • Study the generated code to understand the pattern
  • Modify it to fit your needs
  • Test it in simulation

This accelerates learning dramatically — you see working examples instantly, then learn by reading and modifying real programs.

What to Learn Next

Start Programming PLCs Today

Download Plaxio — a free PLC IDE with AI code generation and built-in simulation. Write your first program in under 10 minutes.

Download Free →