← Back to PDF Library AYE TECH HUB — INTERACTIVE READER Join Telegram
Cover
AYE
TECH HUB
PLC & AUTOMATION ENGINEERING GUIDE
PLC ProgrammingComplete Guide
Siemens S7  •  Ladder Logic  •  FBD  •  Structured Text
HMI  •  PROFINET  •  Safety Standards  •  Career Pathways
12
Chapters
150+
Concepts
20+
Diagrams
FREE
Access
✓ FREE OPEN ACCESS
Awet G. Nway
Founder, AYE Tech Hub  •  Industrial Automation & PLC Expert
AYE Tech Hub — Engineering the Future
ayetechub.com  •  © 2026 AYE Tech Hub. All Rights Reserved.
AYE Tech HubPLC Programming Complete Guide
Contents
Table of Contents

01PLC Architecture & HardwareCPU • I/O Modules • Memory • Scan Cycle3
02Ladder Logic ProgrammingContacts • Coils • Instructions • Addressing5
03Function Block Diagram (FBD)Blocks • Data Flow • IEC Standard Blocks7
04Structured Text (ST / SCL)Syntax • Data Types • Control Structures8
05Timers & CountersTON • TOF • TP • CTU • CTD9
06Data Blocks & MemoryGlobal DB • Instance DB • UDT • ARRAY10
07HMI & SCADA IntegrationPanels • WinCC • Tags • Alarms11
08Industrial NetworksPROFINET • PROFIBUS • Modbus • OPC-UA12
09PID Control & Analog ProcessingTheory • Tuning • Scaling • TIA Portal12
10Safety PLCs & Functional SafetySIL • IEC 62061 • Safety Circuits13
11TIA Portal Workflow & SimulationProject Setup • PLCSIM • Diagnostics13
12Career Pathways & CertificationsRoles • Salaries • Certifications14
• ♦ •
📖 How to Navigate

Use the Next / Previous buttons above, or press ← → arrow keys. Click the page edges to flip. Each chapter builds on the previous.

AYE Tech Hub — Engineering the Future2
Chapter 1PLC Architecture & Hardware
Chapter 01
I
PLC Architecture
& Hardware

CPU • I/O Modules • Memory • Scan Cycle • Families

A Programmable Logic Controller (PLC) is an industrial digital computer designed for real-time control of manufacturing processes and automated systems. Invented in 1968 by Dick Morley for General Motors, PLCs replaced relay-based control panels. They withstand −20 to +70°C, 95% humidity, 3.5g vibration, and severe electromagnetic interference.

PLCs execute a deterministic scan cycle — reading inputs, running logic, updating outputs — with guaranteed 1–100ms timing, essential for safety-critical control.

Where PLCs Are Used

IndustryApplicationKey Requirement
AutomotiveWelding robots, assembly lines<5ms scan, high I/O
Oil & GasPipeline, compressor controlSIL 2/3, ATEX rated
Water TreatmentPump control, filtrationSCADA, remote I/O
Food & BeverageFilling, packaging, CIPIP69K, washdown
Building AutomationHVAC, lighting, accessBACnet/Modbus
AYE Tech Hub — Engineering the Future3
Chapter 1PLC Architecture & Hardware

PLC Hardware Architecture

BACKPLANE BUS PSU24VDC CPUS7-1516 DI 16x24VDC DO 16x24VDC AI 8x4-20mA AO 4x0-10V CM PROFINET100 Mbps SENSORS ACTUATORS TRANSMITTERS NETWORK Fig 1.1 — Siemens S7-1500 backplane: PSU + CPU + DI + DO + AI + AO + CM

Core Hardware Modules

ModuleFunctionSpec
CPUProgram execution, memory, comms300MHz, 1–4MB RAM
Power Supply120/240VAC to 24VDC24VDC / 5–20A
Digital InputRead ON/OFF from sensors16–64 ch, 3ms filter
Digital OutputDrive contactors, solenoids16–32 ch, 0.5A/ch
Analog InputRead 4-20mA or 0-10V8 ch, 16-bit ±0.1%
Analog OutputControl VFDs, valves4–8 ch, 12–16 bit
Comm ModulePROFINET, PROFIBUS, Modbus100Mbps, dual-port
AYE Tech Hub — Engineering the Future4
Chapter 2Ladder Logic Programming
Chapter 02
II
Ladder Logic
Programming

Contacts • Coils • Instructions • Addressing • Examples

Ladder Logic (LD) is the most-used PLC language, standardized in IEC 61131-3. It looks like relay circuits — contacts are input conditions, coils are outputs, evaluated left-to-right on each rung. Electrical engineers find it immediately familiar.

Core Instructions

InstructionSymbolFunction
Normally Open--| |--TRUE when bit=1 (closed)
Normally Closed--|/|--TRUE when bit=0 (open)
Output Coil--( )--Sets bit TRUE when rung TRUE
Latch Coil--(L)--Set and hold until unlatched
Unlatch Coil--(U)--Reset a latched bit
Rising Edge--(P)--One scan pulse on 0→1
Rung 1: Motor Start/Stop with Seal-In Contact I0.0START I0.1E-STOP I0.2OL Q0.0MOTOR Q0.0 SEAL Rung 2: TON delay timer (5 seconds) Q0.0 TON PT: T#5S Q0.1DONE Fig 2.1 — Motor Start/Stop with seal contact (R1) and TON timer (R2)
⚠ Double Coil Warning

Never assign the same output (Q0.0) to two Output Coils. The last rung evaluated wins — earlier assignments are silently overwritten. Use M-bits for intermediate logic.

AYE Tech Hub — Engineering the Future5
Chapters 3–4FBD & Structured Text
Chapter 03
III
Function Block Diagram & Structured Text

FBD shows data flowing left-to-right through connected function blocks — ideal for analog processing, PID loops, and signal chains. ST (SCL in TIA Portal) is a high-level Pascal-like language ideal for complex math, state machines, and algorithms.

FBD: Sensor → PID → Valve Chain

SENSORIW64 SCALE_X0–100% PID_CompactSP → PV → Out VALVEQW80 Fig 3.1 — FBD: Sensor → Scale → PID Controller → Control Valve
Chapter 04
IV
Structured Text (ST / SCL)

ST Control Structures

// Scale raw AI to engineering units (°C) Temp_C := (DINT_TO_REAL(IW64) / 27648.0) * 150.0; IF Temp_C > 80.0 THEN Cooling := TRUE; Alarm := TRUE; ELSIF Temp_C > 60.0 THEN Cooling := TRUE; Alarm := FALSE; ELSE Cooling := FALSE; END_IF;
AYE Tech Hub — Engineering the Future7
Chapters 5–6Timers, Counters & Data Blocks
Chapter 05
V
Timers & Counters

BlockNameBehaviourUse Case
TONOn-DelayQ TRUE after IN=TRUE for PTMotor start delay
TOFOff-DelayQ stays TRUE for PT after IN=FALSEFan run-on
TPPulseQ TRUE for exactly PT on rising edgeFixed pulses
CTUCount UpCV++ on CU pulse; Q when CV≥PVPart counting
CTDCount DownCV-- on CD pulse; Q when CV≤0Batch quantity
IN Q ET PT (e.g. T#5S) IN rises Q ON Fig 5.1 — TON On-Delay timing
Chapter 06
Data Blocks & Memory

// UDT: reusable motor data structure TYPE Motor_Type STRUCT Running : BOOL; Fault : BOOL; Speed_rpm : REAL; Run_Hours : DINT; END_STRUCT; END_TYPE // Use for every motor in the plant Motor_Feed : Motor_Type; Pumps : ARRAY[1..8] OF Motor_Type;
AYE Tech Hub — Engineering the Future9
Chapters 7–8HMI, SCADA & Networks
Chapter 07
VII
HMI, SCADA & Networks

Siemens HMI Panel Range

PanelScreenTagsBest For
KTP700 Basic7" touch500Small machines
KTP900 Basic9" touch800Mid machines
TP1200 Comfort12" touch2048Complex, recipes
WinCC Runtime PCPC512K+Full plant SCADA

Industrial Network Protocols

ProtocolSpeedCycleBest Application
PROFINET IRT100Mbps<1msMotion control, high-speed sync
PROFINET RT100Mbps1–10msStandard automation
PROFIBUS-DP1.5Mbps2–10msLegacy field devices
Modbus TCP100Mbps10–100msThird-party, energy meters
OPC-UA1Gbps100ms+MES / ERP / Cloud / IIoT
ℹ HMI Tag Performance

Only poll at 500ms or faster what operators genuinely need live. Excessive fast polling significantly increases PLC scan time. Audit your HMI tag list regularly.

AYE Tech Hub — Engineering the Future11
Chapters 9–11PID Control, Safety & TIA Portal
Chapter 09
PID, Safety & TIA Portal

PID Control Formula

Output = Kp × e(t) + Ki × ∫e(t)dt + Kd × de(t)/dt e(t) = SP − PV (error: setpoint minus process variable) Kp = Proportional Ki = Integral Kd = Derivative // Scale 4-20mA to bar in SCL Pressure := (DINT_TO_REAL(IW64) / 27648.0) * 100.0;

Safety Integrity Levels (SIL)

SILPFDApplications
SIL 110⁻¹–10⁻²General machinery, light curtains
SIL 210⁻²–10⁻³Industrial automation, chemical
SIL 310⁻³–10⁻⁴Oil & gas, nuclear, railway
⚠ Safety CPU Required

SIL 2+ requires a certified safety CPU (e.g. S7-1500F). Standard PLCs cannot fulfil SIL 2 regardless of software approach.

TIA Portal V18 Key Steps

StepAction
1 — HardwareDevices & Networks → add CPU, assign IP
2 — ProgramOB1 → write Ladder / FBD / SCL
3 — SimulatePLCSIM → force I/O, test HMI
4 — DownloadOnline → Download → Run mode
AYE Tech Hub — Engineering the Future12
Chapter 12Career Pathways & Certifications
Chapter 12
XII
Career Pathways &
Certifications

Roles • Salaries • Certifications • 90-Day Learning Path

PLC programming is one of the highest-demand skills in industrial automation. A global shortage of certified automation engineers means strong salaries and rapid promotion for those who invest in proper training.

Career Roles & Salaries (2025)

RoleExperienceSalary (USD/yr)
PLC Technician0–2 yrs$42,000 – $62,000
PLC Programmer2–5 yrs$62,000 – $90,000
Automation Engineer5–10 yrs$85,000 – $120,000
Senior Controls Engr.10–15 yrs$110,000 – $150,000
Automation Consultant15+ yrs$130,000 – $200,000+

Key Certifications

CertificationProviderFocus
Siemens SCCMSiemensTIA Portal, S7-1200/1500
CAPISA InternationalVendor-neutral automation
TÜV FS EngineerTÜV RheinlandFunctional Safety SIL 2/3
🎓 90-Day Path

Days 1–30: Ladder Logic basics, TIA Portal setup. Days 31–60: FBD, ST, HMI, timers. Days 61–90: PROFINET, PID, safety overview, first project. Start at ayetechub.com/courses

AYE Tech Hub — Engineering the Future14
"Engineering the Future — one engineer at a time."

Part of AYE Tech Hub's free engineering education initiative, serving engineers across Africa and beyond.
📚 PDF Library — Free & premium guides  ayetechub.com/pdfs.html
🏫 Courses — PLC, HMI, SCADA, CAD, AI Tools  ayetechub.com/courses.html
💬 Telegram Community — Live support  t.me/ayetechub
© 2026 AYE Tech Hub. Published by Awet G. Nway.
Free for personal and educational use.