PLC Pulse ยท Beginner’s Visual Booklet

PLC & Ladder Logic — A Beginner’s Visual Booklet

With code examples. What is a PLC? Ladder Logic Explained. Hello World in 4 Languages. KSA Jobs & Future. For Beginners & Career Starters. Made for Engineers.

12Sections
10Worked Examples
4Languages
KSACareer Roadmap
01 · Section

Why PLC?

This Booklet is designed to help you understand many important questions in industrial automation, such as:

?

Why do we use PLCs?

?

Why Ladder Logic instead of C or Python?

?

Why not just use hardware logic circuits?

?

Why is PLC control preferred in industry?

Here we try to answer one core idea: “Why?”

In engineering systems, we already use different types of programming approaches such as:

๐Ÿง 
Approach 01

General Purpose Language

e.g. Python, JavaScript — text-based programming used for software, automation, and applications.

โš™
Approach 02

System-Level Language

e.g. C, C++, Assembly — low-level programming used for hardware control and embedded systems.

๐Ÿ“
Approach 03

Engineering Computation Language

e.g. MATLAB, Simulink — mathematical and simulation-based engineering approach.

Now we will compare these approaches and understand how they connect to hardware and industrial control systems.

02 · Section

Side-by-Side Comparison

Feature ๐Ÿชœ Ladder Logic ๐Ÿง  General Purpose Language โš™ System-Level Language ๐Ÿ“ Engineering Computation Language
TypeIndustrial control language (graphical logic used in PLC systems)Text-based programming approach used for software, automation, and applicationsLow-level programming approach used for hardware control and embedded systemsMathematical and simulation-based engineering approach
Basic ideaUses electrical-style diagrams to control machines using ON/OFF logicUses step-by-step instructions to solve problems and automate tasksUses efficient code to directly interact with hardware and memoryUses mathematical equations to model and simulate engineering systems
Visual?โœ… Yes (ladder diagram like electrical circuits)โŒ No (text-based)โŒ No (text-based)โš ๏ธ Partial (visual simulation tools available)
ReadabilityVery easy for technicians and electriciansEasy for beginnersMedium to difficultEasy for engineers and researchers
Real-time controlโœ… Yes (deterministic scan cycle in PLCs)โš ๏ธ Limited (needs extensions)โœ… Yes (with real-time systems)โŒ Not designed for real-time control
Hardware interactionDirect input/output (sensors, motors, relays)Indirect via libraries or interfacesDirect hardware-level controlMostly simulation-based interaction
Math & data handlingVery limited logic operationsStrong (data handling, automation, AI tasks)Basic to moderateVery strong (matrices, equations, signals)
Main usageIndustrial automation, factories, production linesSoftware development, automation, intelligent systemsEmbedded systems, firmware, devicesControl system design, simulation, engineering analysis
Speed/performanceHigh for control tasksModerateVery highHigh for computation
Safety in industryVery high (industrial standards)Depends on system designHigh (if well implemented)Medium (simulation-safe)
DebuggingVisual tracing of logic flowEasy with tools/logsHarder (memory-level issues)Easy with plots and outputs
PortabilityLow (PLC-specific)Very highHigh but hardware dependentHigh (platform dependent)
ScalabilityMedium (machine-level systems)Very high (software systems)High (embedded systems)High (models & systems)
MaintenanceVery easy for techniciansEasyMediumEasy
Industry usageFactories, automation linesSoftware, AI, automation systemsEmbedded systems, firmware, devicesEngineering design, simulation, research
Cost of developmentMedium (PLC hardware required)LowMediumLowโ€“Medium
Typical environmentIndustrial plantsComputers, servers, cloudMicrocontrollers, devicesEngineering labs, simulation PCs
Speed / performanceHigh for control tasksModerateVery highHigh for computation
03 · Section

Symbols & “Hello World” in four languages

Example

|[ A ][ B ]———( Y )|*
# Hello World print(“Hello, World!”)
#include <stdio.h> int main() { printf(“Hello, World!\n”); return 0; }
disp(‘Hello, World!’) % Bonus โ€” MATLAB makes math easy: x = 5; y = 3; result = x * y + sqrt(16) % result = 19

*Here is what each symbol means

โ”€โ”€[ ]โ”€โ”€
Normally Open ContactThe input (sensor/button). Passes power when TRUE (ON). Like a switch.
โ”€โ”€( )โ”€โ”€
Output CoilThe output (motor/light/valve). Turns ON when power flows to it.
โ”€โ”€[/]โ”€โ”€
Normally Closed ContactPasses power when FALSE (OFF). Breaks when the contact is activated.
โ•โ•โ•ฌโ•โ•
Power RailThe two vertical lines. Left = power source. Right = return.
04 · Section

The Electrical Engineering View

Every programming language needs hardware to run on. But here is something most beginners don’t realize: the hardware you need is COMPLETELY different depending on which language you choose. This chapter looks at automation through the eyes of an electrical engineer.

When you write ๐Ÿง  General Purpose Language, โš™ System-Level Language, or ๐Ÿ“ Engineering Computation Language, you are NOT building a control system yet — you are just writing software. To make that software actually control a motor, you must DESIGN and BUILD supporting electronic hardware. A PLC, by contrast, is already that hardware.

โ—† ๐Ÿ’ป General Computer Languages

To control a real motor with ๐Ÿง  General Purpose Language or โš™ System-Level Language, running on a PC or Raspberry Pi, an electrical engineer must design and wire ALL of this:

  • A computer or single-board computer (PC, Raspberry Pi, Arduino)
  • Digital Input circuit — opto-isolators to protect the computer from 24 V field signals
  • Digital Output circuit — relay or transistor driver boards (the computer’s 3.3 V pin cannot switch a motor)
  • Signal conditioning — pull-up/pull-down resistors, debounce circuits for buttons
  • A separate 24 V DC power supply for field devices + 5 V for the logic
  • Surge protection, fuses, and EMI filtering (factories are electrically noisy)
  • An enclosure rated for the environment (dust, heat, vibration)
  • Custom PCB design or breadboard wiring — and you must debug it all yourself

โ—† ๐Ÿ“ Engineering Computation Language

Engineering Computation Language normally runs on a PC for SIMULATION only — it needs no field hardware at all because it doesn’t control real machines directly. To deploy Engineering Computation Language logic to real hardware, Simulink generates ๐Ÿง  General Purpose Language or โš™ System-Level Language code, which then needs the SAME hardware design as the ๐Ÿง  General Purpose Language or โš™ System-Level Language above. Engineering Computation Language is a design tool, not a controller.

You must DESIGN and BUILD all of this for Python/C control โ€” field input, opto-isolation, computer, relay driver, dual power supplies
You must DESIGN & BUILD all of this for Python / C control. 6–8 separate circuits the engineer must design, wire, protect & debug: opto-isolation for inputs, relay/transistor driver boards for outputs, dual power supplies (5 V + 24 V), surge protection, fuses & EMI filtering, signal conditioning & debounce, a rated enclosure + custom PCB / wiring.

โš ๏ธ The Hidden Cost

With ๐Ÿง  General Purpose Language, โš™ System-Level Language, or ๐Ÿ“ Engineering Computation Language, the LANGUAGE is free and easy — but the HARDWARE DESIGN is the hard part. You become an electronics designer: choosing components, calculating resistor values, designing isolation, handling noise, and debugging wiring faults. This can take weeks and requires real high electrical engineering skill.

โ—† ๐Ÿชœ PLC (Ladder Logic) — The Engineered Solution

This is the key advantage. A PLC is a purpose-built industrial computer where all of that supporting hardware is already designed, built, tested, and certified inside one rugged unit:

  • Input modules — opto-isolation, signal conditioning, and 24 V handling are built in
  • Output modules — relay or transistor outputs that can directly switch contactors
  • Industrial power supply — regulated, protected, designed for factory voltages
  • Rugged enclosure — rated for heat, dust, vibration, and electrical noise (EMI)
  • Built-in diagnostics — LED indicators show input/output status instantly
  • Certified to industrial standards (CE, UL) — no custom electronics to debug
PLC โ€” one integrated unit. Sensor / button feeds an input module with opto-isolation, into CPU + ladder, into output module that drives motor
With a PLC — all that hardware is already built & certified inside one box. PLC = one integrated unit: input module (opto-isolation, 24 V handling, signal conditioning) → CPU + Ladder (runs the program) → output module (built-in relays, drives contactors, surge protected).

The engineer’s job is now simple — no electronics design required:

  • Isolation, drivers, power supply, protection & enclosure are pre-built by the manufacturer
  • Just wire field sensors to labelled input terminals and the motor to output terminals
  • Write the logic in Ladder software — change it anytime without touching a single wire

→ Weeks of hardware design become a few hours of wiring and configuration.

โœ… Why Engineers Choose PLCs

With a PLC, the electrical engineer does NOT design isolation circuits, driver boards, or power supplies. That engineering work is already done by the PLC manufacturer (Siemens, Allen-Bradley, etc.). The engineer simply selects the right modules, wires field devices to labelled terminals, and writes Ladder Logic. Weeks of hardware design become hours of configuration.

Hardware Comparison Table

Hardware Need๐Ÿง  General Purpose / โš™ System-Level on a Computer๐Ÿชœ PLC (Ladder Logic)
Input isolationDesign opto-isolator circuits yourselfBuilt into input module
Output switchingBuild relay/transistor driver boardBuilt into output module
Power supplySource & protect 5 V + 24 V separatelyIndustrial supply included
Noise/EMI protectionAdd filters, shielding manuallyDesigned-in, certified
EnclosureFind/build a rated cabinetRugged industrial housing
DiagnosticsWrite your own; add LEDsBuilt-in status LEDs
Setup effortWeeks of EE design + debugHours of wiring + config
Reliability in factoryDepends on your design skillCertified for 20+ yr service

๐Ÿ’ก The Big Idea

A PLC is essentially ‘electrical engineering hardware design — pre-solved and put in a box.’ You pay more for the unit, but you save enormous amounts of design time, and you get certified industrial reliability. For a factory running 24/7, that is exactly the right trade-off.

05 · Section

Replacing Hardwired Relay Logic — A Real Example

Before PLCs, electrical engineers built control systems by physically wiring electromechanical relays. This is called ‘hardwired logic’. The logic was literally the wiring. Let’s take ONE real example and see how it is built four different ways.

๐Ÿญ The Example: A Two-Conveyor Safety Interlock

A small packaging line has two conveyors:

  • Conveyor 2 (feeds boxes OUT) must NEVER run unless Conveyor 1 (feeds boxes IN) is already running — otherwise boxes pile up and jam.
  • An EMERGENCY STOP button must instantly stop BOTH conveyors.

Logic: Conveyor 2 runs ONLY IF (Start pressed) AND (Conveyor 1 running) AND (E-Stop NOT pressed)

Important — How a PLC Works: The Scan Cycle

A PLC doesn’t run code once — it loops through the same steps thousands of times per second. This loop is called the Scan Cycle:

StepNameWhat Happens
1Read InputsPLC checks all sensors: Is the button pressed? Is the temperature above 80°C? Is the door open?
2Execute ProgramThe program logic runs: ‘IF button is pressed AND door is closed THEN start motor’
3Write OutputsPLC sends signals: turn on motor, open valve, sound alarm
4HousekeepingUpdates communications, timers, internal diagnostics
Step 1Read InputsCheck every sensor & button
Step 2Execute ProgramSolve all ladder rungs
Step 3Write OutputsSwitch motors, lamps, valves
Step 4HousekeepingComms, timers, diagnostics

โฑ๏ธ How Fast?

A typical scan cycle takes 5 to 50 milliseconds — that means the PLC makes decisions 20 to 200 times every second. This is why machines can react so quickly and safely.

06 · Section

Method 1 — Hardwired Relay Logic (The Old Way)

The engineer wires physical relays and contacts. The ‘program’ is the copper wiring inside the panel. To change the logic, you must physically rewire it.

Method 1 โ€” Hardwired Relay Panel โ€” START NO, E-STOP NC, CONV1 RUNNING in series through CR2 control relay coil with CR2 aux seal-in branch, driving Conveyor-2 motor
Method 1 — Hardwired Relay Panel (the program IS the wiring). L1 (+24 V) → START (NO) → E-STOP (NC) → CONV1 RUNNING → CR2 control relay coil → L2 (0 V). CR2 aux (seal-in) parallels START. A second CR2 aux contact drives the Conveyor-2 motor.
Every contact, coil and line above is a REAL physical part joined by REAL copper wire. To change the logic you must physically rewire the panel — and every relay is a part that can fail. There is no software, no diagnostics screen, and no remote monitoring.
โŒ Problems with Hardwired Logic
  • Changing logic = rewiring the panel (hours/days)
  • Each relay is a physical part that can fail
  • Large panels — relays take lots of space
  • Hard to troubleshoot — must trace wires
  • No data, no remote monitoring
โš™ What the Engineer Must Do
  • Draw a wiring schematic
  • Select & buy each relay and contact
  • Mount and wire every component
  • Test by physically pressing buttons
  • Re-wire entirely if requirements change
07 · Section

Method 2 — PLC Ladder Logic (The Modern Replacement)

The SAME interlock, now in a PLC. The relays become software contacts. The wiring is replaced by a Ladder program. To change the logic, you edit software — no rewiring.

Method 2 โ€” Conveyor-2 Interlock as a two-rung Ladder Program. Rung 1: START with CONV2_RUN seal-in branch, /E-STOP NC, CONV1_RUN, driving CONV2_RUN coil. Rung 2: CONV2_RUN contact driving CONV2_MOTOR
Method 2 — Same Interlock in PLC Ladder Logic (the program is software). Conveyor-2 Interlock — Ladder Program. Rung 1: [START] with [CONV2_RUN] seal-in branch → [/E-STOP][CONV1_RUN](CONV2_RUN). Rung 2: [CONV2_RUN](CONV2_MOTOR).

Ladder Logic was designed to look exactly like relay wiring — a direct one-to-one replacement:

  • Relay coil CR2 → Ladder coil ( CONV2_RUN )
  • Seal-in wire → parallel Ladder branch
  • Relay aux contact → Ladder contact [ ]
  • Copper wiring → editable software

→ To change the logic: just edit the program and download — no rewiring, ever.

๐Ÿ”„ The Direct Replacement

Notice: the relay CR1_aux contact becomes the Ladder contact [CONV1_RUN]. The relay CR2 coil becomes the Ladder coil (CONV2_RUN). The seal-in wire becomes a parallel contact. Ladder Logic was DESIGNED to look exactly like relay wiring — so electricians could switch from hardwired panels to PLCs without learning a totally new way of thinking.

08 · Section

The Motor Latch — “Hello World” of PLCs

The Motor Start/Stop circuit is THE fundamental building block of industrial automation. Every engineer learns this first. It solves a real problem: How do you press a button briefly to start a motor, and have it keep running after you release the button?

๐Ÿค” The Problem to Solve

You have:

  • A green START button (momentary — only ON while held)
  • A red STOP button (momentary — only ON while held)
  • A motor contactor (needs continuous signal to stay ON)

Challenge: Press START briefly → motor runs. Press STOP → motor stops. How do you keep the motor running after you release START?

The Logic Solution: Seal-In (Latch)

The answer is a feedback loop called a ‘seal-in’ or ‘latch’. Once the motor starts, a contact on the motor output feeds back to keep the rung TRUE — even after START is released. The STOP button breaks this loop.

Step-by-Step Logic Trace

  • Press START → [START_BTN] contact closes → rung goes TRUE → MOTOR_RUN coil energizes
  • MOTOR_RUN coil ON → [MOTOR_RUN] seal-in contact also closes (because the coil is ON)
  • Release START → [START_BTN] opens → BUT [MOTOR_RUN] seal-in keeps the rung TRUE
  • Motor keeps running! The output is ‘latched ON’ by its own contact
  • Press STOP → [STOP_BTN] NC contact opens → rung goes FALSE → MOTOR_RUN coil de-energizes
  • [MOTOR_RUN] seal-in contact also opens → motor stops and stays stopped

The Ladder Logic Diagram

โš™ Motor Start/Stop with Seal-In Latch

โ•‘โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•‘ โ•‘ [START_BTN]โ”€โ”€โ”ฌโ”€โ”€[/STOP_BTN]โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€(MOTOR_RUN) โ•‘ โ†‘ START (NO) in series with STOP (NC) โ†’ energizes motor coil โ•‘โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•‘ โ•‘ [MOTOR_RUN]โ”€โ”€โ”˜ โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€( ) โ•‘ โ†‘ MOTOR_RUN contact in parallel with START โ€” this is the SEAL-IN (latch) โ•‘โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•‘
STARTSTOPMOTOR_RUN (prev)Result
OFF (0)NOT pressed (NC=1)OFF (0)Motor stays OFF
ON (1) — pressedNOT pressed (NC=1)OFF (0)Motor turns ON โœ“
OFF (0) — releasedNOT pressed (NC=1)ON (1)Motor STAYS ON (seal-in) โœ“
OFF (0)PRESSED (NC=0)ON (1)Motor turns OFF โœ“
09 · Section

The Same Logic in Every Language

Now the magic: let’s write EXACTLY the same motor latch logic in ๐Ÿง  General Purpose Language, โš™ System-Level Language, or ๐Ÿ“ Engineering Computation Language, and Ladder Logic. Notice how the logic is identical — only the syntax changes.

โ—† ๐Ÿชœ Ladder Logic — The Visual Way

Simple seal-in ladder โ€” INPUT A in series with /INPUT B NC, driving OUTPUT Y coil, with OUTPUT Y feedback contact in parallel with A
The seal-in pattern in its simplest form. Input A starts the rung; Output Y latches itself ON through its own feedback contact in parallel with A; Input B (NC) breaks the rung when pressed.

โ—† ๐Ÿง  General Purpose Language — The Readable Way

In General Purpose Language, we simulate the same logic with variables. This is exactly what PLC simulation software does internally:

# Motor Latch Logic # This simulates one PLC scan cycle # — Input Variables (read from sensors) — start_btn = False # Green START button stop_btn = False # Red STOP button (True = pressed = OPEN the circuit) overload = False # Thermal overload relay # — Output Variables (written to actuators) — motor_run = False # Motor contactor run_lamp = False # Green indicator lamp # — SCAN CYCLE LOOP — while True: # — READ INPUTS (simulated) — start_btn = read_input(‘START’) # reads digital input stop_btn = read_input(‘STOP’) overload = read_input(‘OVERLOAD’) # — RUNG 1: Motor start/stop logic — # (START pressed OR motor already running) AND STOP not pressed AND no overload if (start_btn or motor_run) and (not stop_btn) and (not overload): motor_run = True else: motor_run = False # — RUNG 2: Indicator lamp — run_lamp = motor_run # — WRITE OUTPUTS — write_output(‘MOTOR’, motor_run) write_output(‘LAMP’, run_lamp)

โ—† โš™ System-Level Language — The Embedded Way

System-Level Language is used in custom embedded controllers and some PLC modules. Here the same logic runs in a while(1) loop — just like the PLC scan cycle:

/* Motor Latch Logic */ #include <stdint.h> #include <stdbool.h> /* Hardware I/O register addresses (example) */ #define START_BTN read_digital_in(0) #define STOP_BTN read_digital_in(1) #define OVERLOAD read_digital_in(2) int main(void) { bool motor_run = false; bool run_lamp = false; /* PLC-style scan loop */ while (1) { /* RUNG 1: Start/stop with seal-in */ if ((START_BTN || motor_run) && !STOP_BTN && !OVERLOAD) { motor_run = true; } else { motor_run = false; } /* RUNG 2: Indicator lamp mirrors motor state */ run_lamp = motor_run; /* Write outputs to hardware */ write_digital_out(0, motor_run); write_digital_out(1, run_lamp); delay_ms(10); /* 10ms scan cycle */ } return 0; }

โ—† ๐Ÿ“ Engineering Computation Language — The Simulation Way

Engineering Computation Language is used to SIMULATE and TEST the logic before deploying to a real PLC:

% Motor Latch Logic % Simulates 100 scan cycles to test behavior % — Initialize variables — motor_run = false; run_lamp = false; % — Simulate 100 scan cycles — for cycle = 1:100 % Simulate button presses (test scenario) start_btn = (cycle == 10); % Press START at cycle 10 stop_btn = (cycle == 50); % Press STOP at cycle 50 overload = false; % RUNG 1: Start/stop latch logic if (start_btn || motor_run) && ~stop_btn && ~overload motor_run = true; else motor_run = false; end % RUNG 2: Lamp run_lamp = motor_run; % Log results for plotting log_motor(cycle) = motor_run; end % Plot the motor state over time plot(log_motor); title(‘Motor State vs Scan Cycle’); xlabel(‘Scan Cycle’); ylabel(‘Motor ON/OFF’);

๐ŸŽฏ Key Insight

The motor latch logic is IDENTICAL in all four languages — the same conditions, the same logic. What changes is:

  • HOW you write it (graphical vs text)
  • WHERE you run it (PLC vs computer vs microcontroller vs simulation)
  • WHO reads it (electrician vs developer vs engineer)

This is why learning the LOGIC first makes learning any language easier!

10 · Section

Jobs, Future & Getting Started

Saudi Arabia’s Vision 2030 is the largest industrial transformation in the Middle East. It is creating thousands of automation jobs — and the skills in this booklet are exactly what employers need.

KSA Job Market Snapshot (2025)

RoleSalary (SAR/yr)Key SkillsWhere
Automation & Controls Engineer120K–160KLadder, SCADA, HMIKAEC, Riyadh
Maintenance Automation Engineer200K–300KPLC troubleshoot, drivesJubail, Yanbu
OT/IIoT Integration Engineer150K–220KOPC-UA, Python, MQTTNEOM, Riyadh
DCS & Safety Engineer180K–280KYokogawa, Honeywell, SILAramco, SABIC
Embedded Systems Engineer90K–150KC/C++, RTOS, hardwareAll regions
OT Cybersecurity Specialist200K–350KIEC 62443, firewallsRiyadh, Aramco

The Future: OT + IoT + Smart Systems

Where We Are Now
  • PLCs run isolated on factory floors
  • Data stays local — paper records
  • Maintenance is reactive (fix when broken)
  • Operators must be on-site
  • Limited analytics, manual reports
Where We Are Going
  • PLCs connected to cloud via IIoT
  • Real-time data dashboards anywhere
  • Predictive maintenance with AI
  • Remote monitoring from a phone
  • AI detects faults before they happen

Your Beginner Roadmap

PhaseTimelineWhat To Do
STARTMonth 1–2Install Codesys (free). Write your first Ladder program. Make a light turn ON with a button. Understand NO/NC contacts and output coils.
BASICSMonth 3–4Build the motor start/stop latch. Add a timer (TON). Add a counter. Build a 3-step sequence. Install Python and run Hello World.
CONNECTMonth 5–8Learn SCADA (try Ignition free edition). Connect Python to a PLC simulator via Modbus. Build a simple data logger. Study Profinet basics.
ADVANCEMonth 9–18Learn Siemens TIA Portal (S7-1200). Study PID control. Get a hands-on training kit. Target your first automation job in KSA.
EXPERT18+ monthsAdd OPC-UA, IIoT, and cybersecurity. Pursue ISA CCST or CAP certification. Work toward IEC 62443 specialist roles.

Free Tools to Start Today

CodesysFree professional PLC IDE supporting all IEC 61131-3 languages (codesys.com)
PLC FiddleBrowser-based Ladder Logic simulator, no install needed (plcfiddle.com)
Siemens S7-PLCSIMFree PLC simulator included with TIA Portal trial
PythonFree, download from python.org, thousands of automation libraries
MATLAB OnlineFree 30-day trial, Simulink included for control system design
RealPars on YouTubeBest free video tutorials for PLC programming beginners
ISA Student MembershipAccess to standards, webinars, and industry network

๐ŸŒŸ Final Message

You now have the foundation: you understand what a PLC is, how Ladder Logic works, how the same logic looks in Python, C, and MATLAB, and why these languages exist together. The factory floor and the digital world are merging — and engineers who speak BOTH languages are the ones who will build Saudi Arabia’s industrial future. Start with one button. One light. One rung. Then never stop building.

11 · Section

Example and Practice Questions

Example 01

Start a Motor

Requirement: When the START button is pressed, the MOTOR turns ON.

|—-[ START ]—————-( MOTOR )—-|
Explanation
  • [ START ] → Input contact
  • ( MOTOR ) → Output coil
  • If START becomes TRUE → MOTOR energizes
Example 02

Stop a Motor

Requirement: The MOTOR runs only when STOP is NOT pressed.

|—-[/ STOP ]—————( MOTOR )—-|
Explanation
  • [/ STOP ] = Normally Closed Contact
  • When STOP is pressed → logic opens → MOTOR OFF
Example 03

Start/Stop Conveyor System

Requirement:

  • START button → Conveyor ON
  • STOP button → Conveyor OFF
|—-[ START ]—-[/ STOP ]——–( CONVEYOR )—-|
Explanation — Both conditions must be TRUE:
  • START pressed
  • STOP not pressed
Example 04

Automatic Light Control

Requirement: Turn ON a LIGHT when motion is detected.

|—-[ MOTION_SENSOR ]————( LIGHT )—-|
Explanation — Motion detected → LIGHT turns ON.
Used in:
  • Smart buildings
  • Corridors
  • Security systems
Example 05

Water Tank Pump Control

Requirement: Turn ON pump when water level becomes LOW.

|—-[ LOW_LEVEL ]—————( PUMP )—-|
Explanation — Low water detected → Pump starts filling tank.
Example 06

High Temperature Alarm

Requirement: Turn ON alarm if temperature becomes too high.

|—-[ HIGH_TEMP ]—————( ALARM )—-|
Explanation — High temperature → Alarm activates.
Used in:
  • Factories
  • Boilers
  • Industrial ovens
Example 07

Safety Interlock System

Requirement: Machine runs only if:

  • SAFETY_DOOR closed
  • START pressed
|—-[ SAFETY_DOOR ]—-[ START ]—-( MACHINE )—-|
Explanation — Both conditions must be TRUE. This is an AND logic example.
Example 08

OR Logic Alarm System

Requirement: Alarm turns ON if:

  • SENSOR_A detects danger OR
  • SENSOR_B detects danger
|—-[ SENSOR_A ]————————( ALARM )—-| | โ”‚ | |—-[ SENSOR_B ]————————————-|
Explanation — Any one sensor can activate the alarm. This is an OR logic example.
Example 09

Timer Example

Requirement: Turn ON FAN 5 seconds after START button pressed.

|—-[ START ]——–( TIMER 5s )—-| |—-[ TIMER_DONE ]( FAN )———|
Explanation
  • Timer starts counting
  • After 5 seconds → FAN ON
Example 10

Traffic Light Sequence (Concept)

Requirement: Control:

  • RED
  • YELLOW
  • GREEN lights sequentially
// Typical PLC Functions Used: // โ€ข Timers // โ€ข Counters // โ€ข Sequential logic // // Stage 1: RED ON โ†’ Timer1 expires // Stage 2: GREEN ON โ†’ Timer2 expires // Stage 3: YELLOW ON โ†’ Timer3 expires โ†’ loop
Used in:
  • Traffic systems
  • Factory sequencing
  • Automatic processes
12 · Section

Final Understanding

PLC programming is not only about code.

It is about:

  • Controlling machines safely
  • Designing industrial behavior
  • Managing real-world inputs and outputs
  • Building reliable automation systems

Common Industrial Applications

Conveyor systems
Water treatment plants
Elevator systems
Smart factories
Packaging machines
HVAC systems
Traffic control systems
Industrial processes

You finished the booklet

Start with one button. One light. One rung. Then never stop building.