Programmable Logic Controllers
By Dr Ahsan Rahman
The first edition of Dr Ahsan Rahman's comprehensive book on programmable logic controllers — published online as structured study notes, chapter by chapter. Each chapter pairs the theory with worked PLC programming examples drawn from real industrial automation problems, so students don't just learn the concept — they see it solved.
Programmable Logic Controllers
Dr Ahsan Rahman, PhD
University of Prince Mugrin · 2026
First Edition · Published 2026
The inaugural edition of Dr Rahman's PLC textbook
Fifteen chapters across four parts — written for undergraduate electrical and mechatronics engineering students at the University of Prince Mugrin, and published chapter-by-chapter online throughout 2026. A complete first edition; subsequent editions will refine and extend this foundation.
About this book · First Edition
Master PLCs from fundamentals to industrial applications
This first edition is a complete academic course on programmable logic controllers — from the very basics of how a PLC works, through ladder logic programming, timers and counters, advanced data manipulation, and on to real-world industrial applications including SCADA and ControlLogix systems. Each chapter is published online as a self-contained note set, including key concepts, ladder logic diagrams, common student mistakes, exam-style review questions, and a library of worked PLC programming examples with truth tables, ladder rungs, and run-time test cases. Written for undergraduate electrical and mechatronics engineering students.
How to study this book
A simple 3-step routine for every chapter
Read the theory
Work through the sections, diagrams, and tables. Take notes on key concepts.
Study the worked examples
Trace each example line by line. Verify the truth table or run-time output yourself.
Solve the review questions
Try every question on your own first, then check the model answer. Don't skip the tricky ones.
I
Part I
Foundations of PLC Systems
Chapters 1–4
▾
Part I
Foundations of PLC Systems
-
1→
Programmable Logic Controllers (PLCs): An Overview
History and definition of PLCs, parts of a PLC, principles of operation, modifying the operation, PLC versus computer, and PLC size and application categories.
Beginner 6 Topics 3 Case Studies -
2→
PLC Hardware Components
The I/O section, discrete and analog modules, special I/O modules, I/O specifications, the CPU, memory design and types, programming terminals, data recording, and Human Machine Interfaces (HMIs).
Beginner 11 Topics 4 Examples -
3→
Number Systems and Codes
Decimal, binary, octal, hexadecimal, and Binary Coded Decimal (BCD) systems; Gray code, ASCII code, parity bit, negative numbers, binary arithmetic, and floating point arithmetic.
Beginner 11 Topics 9 Worked Examples -
4→
Fundamentals of Logic
The binary concept; AND, OR, NOT, and Exclusive-OR (XOR) functions; Boolean algebra; deriving logic circuits from Boolean expressions and vice-versa; hardwired versus programmed logic; and word-level logic instructions.
Beginner 7 Topics 7 PLC Programs
II
Part II
Ladder Logic Programming Essentials
Chapters 5–8
▾
Part II
Ladder Logic Programming Essentials
-
5→
Basics of PLC Programming
Processor memory organization (program and data files), program scan, PLC programming languages, bit-level logic instructions, instruction addressing, branch instructions, internal relays, examine if closed/open instructions, entering ladder diagrams, modes of operation, and connecting analog devices.
Intermediate 11 Topics 8 PLC Programs -
6→
Developing Fundamental PLC Wiring Diagrams & Ladder Logic Programs
Electromagnetic control relays, contactors, motor starters; manually and mechanically operated switches; sensors (proximity, magnetic reed, light, ultrasonic, weight, temperature, flow, position); output control devices, seal-in and interlocking circuits, latching relays; converting relay schematics to ladder programs; writing ladder logic from a narrative description; and instrumentation.
Intermediate 13 Topics 10 PLC Programs -
7→
Programming Timers
Mechanical timing relays; PLC timer instructions; on-delay (TON), off-delay (TOF), and retentive (RTO) timers; cascading and reciprocating timers; and timer control bits.
Intermediate 6 Topics 6 PLC Programs -
8→
Programming Counters
Counter instructions, up-counter (CTU), down-counter (CTD), one-shot instruction, cascading counters, incremental encoder–counter applications, combining counters and timers, and high-speed counters.
Intermediate 7 Topics 6 PLC Programs
III
Part III
Advanced Instructions & Data Handling
Chapters 9–12
▾
Part III
Advanced Instructions & Data Handling
-
9→
Program Control Instructions
Program control overview; Master Control Reset (MCR); jump and label; subroutine functions; immediate input/output instructions; forcing external I/O addresses; safety circuitry; selectable timed interrupts; fault routines; temporary end and suspend instructions.
Advanced 11 Topics 5 PLC Programs -
10→
Data Manipulation Instructions
Data manipulation concepts, data transfer (MOV) operations, data compare instructions (EQU, NEQ, LES, GRT, LIM), data manipulation programs, numerical data I/O interfaces, and an introduction to closed-loop control.
Advanced 6 Topics 5 PLC Programs -
11→
Math Instructions
Math instructions overview; addition (ADD), subtraction (SUB), multiplication (MUL), and division (DIV); other word-level math (CPT, MOD, SCP); and file arithmetic operations.
Advanced 7 Topics 6 PLC Programs -
12→
Sequencer and Shift Register Instructions
Mechanical sequencers, sequencer instructions and programs (SQO, SQC), bit shift registers (BSL, BSR), and word shift operations including FIFO and LIFO.
Advanced 5 Topics 5 PLC Programs
IV
Part IV
Industrial Implementation & Modern Systems
Chapters 13–15
▾
Part IV
Industrial Implementation & Modern Systems
-
13→
PLC Installation Practices, Editing, and Troubleshooting
PLC enclosures, electrical noise, leaky inputs and outputs, grounding, voltage variations and surges; program editing and commissioning, programming and monitoring; preventive maintenance, troubleshooting (processor, input, output, ladder logic), and PLC programming software (RSLinx, RSLogix).
Intermediate 10 Topics 4 Case Studies -
14→
Process Control, Network Systems, and SCADA
Types of industrial processes, structure of control systems, on/off control, PID control, motion control; data communications including Data Highway, Serial, DeviceNet, ControlNet, EtherNet/IP, Modbus, Fieldbus, and PROFIBUS-DP; and Supervisory Control and Data Acquisition (SCADA).
Advanced 7 Topics 8 PLC Programs -
15→
ControlLogix Controllers
Six-part deep-dive into the modern ControlLogix platform: Part 1 Memory and Project Organization (tags, structures, arrays); Part 2 Bit-Level Programming (tag-based addressing, latch/unlatch, one-shot); Part 3 Programming Timers (TON, TOF, RTO); Part 4 Programming Counters (CTU, CTD); Part 5 Math, Comparison, and Move Instructions; Part 6 Function Block Diagram (FBD) Programming.
Advanced 6 Parts 12 PLC Programs
New in this First Edition
Programming Examples Library
Beyond the chapter notes, this first edition includes a dedicated library of worked PLC programming examples grouped by topic. Each example follows the same template: problem description, list of inputs and outputs, ladder diagram, run-time test cases, and a short discussion of where the technique is used in industry. Use them after each chapter to put the theory into practice.
Set 1 · Digital Logic
Logic Gates & Code Conversions
Implement every basic logic gate in ladder form, then move on to Boolean function realisation and code-converter circuits.
- AND, OR, NOT, NAND, NOR, XOR, XNOR gates
- Boolean function realisation
- Boolean don't-care conditions
- Combinational logic circuit (Karnaugh-map design)
- Binary ↔ BCD converter
- BCD ↔ Excess-3 converter
- Binary ↔ Gray code converter
Set 2 · Building Blocks
Comparators, MUX, Encoders, Flip-Flops
The classic digital building blocks built from ladder logic — useful when designing custom control circuits before resorting to dedicated function blocks.
- Magnitude comparator
- 4 : 1 and 8 : 1 multiplexers
- 1 : 8 demultiplexer
- 3-to-8 decoder · 8-to-3 encoder
- SR · D · T flip-flops
- Seven-segment display driver
- Parts stamping sequencer
Set 3 · Building Automation
Latching, Interlocks & Home Systems
Latch / unlatch instructions and interlocking — the foundation of every safe machine control. Then practical home and building automation problems.
- Latch / unlatch (basic, sealing, time-delayed)
- Burglar alarm system
- Car parking system (capacity counter)
- Classroom occupancy controller
- Automatic car wash sequence
- Forward / reverse motor drive
- Interlocked drive motors
Set 4 · Time & Math
Timers, Counters, Math & Sequencing
All the timer and counter instructions in action, plus equation-based outputs, jump/subroutine control, and the classic traffic-light controller.
- Sequential lights (timer-based and bit-shift)
- Mathematical functions ladder
- Outputs from custom equations
- Jump-to-other-process
- Pulse-width modulation
- Subroutine call
- Traffic / pedestrian light controller
Set 5 · Process Industry
Tank Level & Process Control
The bread-and-butter of process plants — tank level control, heating, mixing, and reactor control, including a continuous stirred tank reactor (CSTR).
- Single-tank level control
- Two-tank level control
- Series & parallel tank arrangements
- Tank heating with PID
- Tank mixing with agitator control
- Heat tank with steam-flow control
- Continuous stirred tank reactor (CSTR)
- Oil-water separation process
Set 6 · Production Lines
Industrial Production & Conveyor Systems
Real production-line problems — bottle filling, conveyor counting and sorting, drilling stations, and inspection lines you would meet on a real factory floor.
- Bottle filling, capping & rinsing
- Conveyor part counting / packing / sorting
- Drilling station automation
- Spray-painting station
- Defective-part detection
- Robotic-arm screwing of parts
- Heat / bend glass tubes
- Process data logging
End Matter
Glossary & Index
A complete glossary of PLC and industrial automation terminology, plus a searchable index of every concept and worked example covered in this first edition.
About the author
Dr Ahsan Rahman, PhD, P.E.
Associate Professor and Head of the Electrical Engineering Department at the University of Prince Mugrin (UPM). PhD in Control, Mechatronics, AI, and System Design from Jeju National University, Korea, with PLCs as a core specialisation. Over two decades of international academic experience, with PLCs taught as a core undergraduate course and dedicated workshops on Ladder Programming and PLC Programming delivered to engineers in industry. Fluent in all four IEC 61131-3 PLC programming languages — Ladder Diagram, Structured Text, Instruction List, and STEP7 — with supervised industrial automation projects including a Mitsubishi PLC-based robotic arm and a PLC-based frequency counter. Co-inventor of two patents in printed electronics, with $500K+ in research funding from SABIC, KACST, LG Chem, and KIMM, and over 20 publications in IEEE and Current Applied Physics. HEC-approved PhD supervisor.
Need help with PLC coursework, projects, or industrial automation?
Get one-on-one guidance from Dr Ahsan Rahman — Head of Electrical Engineering, with two decades of teaching and supervising PLC-based mechatronics and industrial automation projects.