Learn PLCs free

CODESYS Tutorial: Getting Started in 30 Minutes

From a blank development PC to a running ladder logic program, simulating in CODESYS Control Win. Installation, project creation, your first POU, building, downloading, and forcing I/O.

Beginner-friendly~30 minutesUpdated 2026

Why CODESYS?

CODESYS is the most widely-OEM'd PLC programming environment in the world. Beckhoff TwinCAT, Schneider Machine Expert, Wago e!Cockpit, ABB AC500 and dozens of vendor IDEs are built on CODESYS — so learning it gives you transferable skills across many platforms. The Development System is free for personal/educational use, and CODESYS Control Win lets you run a full PLC runtime on your own PC for testing without any hardware.

Step 1: Download and install

  1. Go to store.codesys.com and create a free account.
  2. Download the latest CODESYS Development System V3.5.
  3. Also download CODESYS Control Win V3 — the SoftPLC runtime for testing on your PC.
  4. Install both. Reboot when prompted.

Step 2: Create your first project

  1. Launch CODESYS. File → New Project.
  2. Select Standard project. Click OK.
  3. Name your project (e.g., FirstSteps).
  4. Choose Device: CODESYS Control Win V3 x64 and PLC_PRG language: Ladder Diagram (LD). OK.

CODESYS opens with a project tree showing Device → PLC Logic → Application → MAIN (PRG).

Step 3: Write a ladder program (motor seal-in)

Double-click MAIN. In the variables section, declare:

PROGRAM MAIN
VAR
    Start : BOOL;
    Stop  : BOOL := TRUE;  (* NC: TRUE means not pressed *)
    Motor : BOOL;
END_VAR

In the ladder editor, build a classic seal-in: Start in series with Stop, with Motor in parallel with Start as the seal-in contact, energising the Motor coil.

Step 4: Build and simulate

  1. Build → Build (F11). Watch for 0 errors.
  2. Make sure CODESYS Control Win V3 is running (green icon in system tray; right-click → Start PLC).
  3. Online → Login (Alt+F8). Confirm prompts about loading the application.
  4. Online → Start (F5). The PLC is now running your code.

Step 5: Force I/O and observe

  1. In the variables section, click Prepared value column for Start; enter TRUE.
  2. Debug → Write values (Ctrl+F7). Motor turns TRUE.
  3. Set Start back to FALSE and write again. Motor stays TRUE — seal-in works.
  4. Set Stop to FALSE (NC button pressed). Motor drops.

That's a complete dev cycle: write → build → download → run → force → observe.

Step 6: Connect to real hardware (optional)

CODESYS-compatible hardware:

  • Beckhoff CX series (TwinCAT 3 is CODESYS-derived)
  • Wago PFC200 with e!Cockpit
  • Schneider M241/M251/M262 with Machine Expert
  • ABB AC500
  • Raspberry Pi with CODESYS Runtime for Pi (paid licence after 30-day trial)
  • Industrial Shields Arduino-compatible boards

In the Device tree, right-click → Update Device to switch targets. Your application code stays the same — IEC 61131-3 portability.

What to learn next

  • Function blocks: encapsulate reusable logic — far cleaner than copy-pasted ladder rungs.
  • Structured Text: for math, loops, string handling, ST is dramatically more readable.
  • CODESYS Visualisation: built-in HMI editor — drag widgets, bind to variables.
  • Modbus TCP server: add the Modbus library to expose variables to external clients.
  • OPC UA server: built into Control Win — turn on UA server in device config to publish to SCADA.

Related guides