IAE Academy

FOR CORE AND IT JOBS · CHAPTER 1 OF 7

Industrial automation and the PLC

This chapter explains why plant logic moved from relay panels into PLC programs, what is inside a PLC, and how the scan cycle and image tables decide when it sees an input and acts. Every rung runs on that timing.

Updated 30 Oct 2026

What you will be able to do

You will name the parts of a PLC and say what each does. You will work out a scan time, the longest input-to-output delay and the chance of missing a short pulse. You will trace a rung through the image tables and say why a PLC, not a bare microcontroller board, runs a plant.

Before you start

  1. Voltage, current, AC and DC (school physics)

  2. Boolean AND, OR and NOT, with OR written + and AND written as a dot

  3. Straight-line proportion

  4. Converting between ms and µs

  5. Probability as a favourable length over a total length

From relay panels to PLCs

Industrial automation runs machines and processes with little human action: sensors report the plant's state, and motors, valves and heaters are switched in response. That logic was once wired from relays (switches worked by an electromagnet), so a change meant rewiring a panel, and relays wore out and were slow to fault-find. A programmable logic controller (PLC) holds the logic as a program you edit, while the plant wiring stays as it is.

Part

What it does

Power supply

Supplies the low DC voltages the CPU and modules use

CPU

Stores and runs the program

Input modules

Turn switch and 4-20 mA signals into bits and numbers, usually isolated from the CPU

Output modules

Relay or transistor (DC, faster) outputs switch contactors (motor relays), lamps and valves; analog outputs send 4-20 mA or 0-10 V

Programming device

A computer that writes, loads and monitors the program

A compact PLC has the supply, the CPU and a fixed set of input and output points in one case: small and cheap, with little room to grow. A modular PLC sits on a rack, so you add the modules the plant needs and can replace one without touching the rest.

A 4-20 mA transmitter sends its reading as the current in a loop. A working loop never falls to 0 mA, so 0 mA means a fault such as a broken wire. For a linear transmitter with range to , the current's rise above 4 mA is proportional to the quantity's rise above the bottom of its range: . The scaling formula is this line solved for .

SCALING A 4-20 MA SIGNAL

Holds for a linear transmitter with range x_min to x_max and 4 ≤ I ≤ 20. I is the loop current in mA; x is in the transmitter's own unit. A 0-10 V input uses V/10 in place of (I-4)/16.

WORKED EXAMPLE

A linear level transmitter measures 0 to 5 m and sends 12 mA. What level does the PLC report?

Solution
  1. Put x_min = 0 m, x_max = 5 m and I = 12 mA into the scaling formula, since the transmitter is linear.

  2. The fraction of span is (12 - 4)/16 = 0.5, because the live range 4 to 20 mA is 16 mA wide.

  3. Level = 0 + 0.5 × 5 m = 2.5 m: that fraction of the 5 m range above x_min.

Answer: 2.5 m.

The scan cycle

A PLC does not react the instant an input changes. It repeats one loop: read all inputs, run the program once, write all outputs, then housekeeping (communication and self-checks). One trip round the loop is a scan; its duration is the scan time. Some PLCs can also read or write a point mid-scan (interrupt inputs, immediate instructions); this chapter treats the plain scan.

SCAN TIME

Holds when the four phases run one after another with no overlap. T_in is the input read, T_prog the program execution, T_out the output update and T_hk the housekeeping, all in ms.

PROGRAM EXECUTION TIME

Holds when n counts the instructions actually executed in a scan (jumps skip some). t_i is the average time per instruction in µs; dividing by 1000 turns µs into ms, so T_prog is in ms, as in the scan time.

Take the worst case for response. An input changes just after it was read, so the change waits up to one whole scan for the next read. That next scan runs the program on the new value and writes the output in its update phase, before its housekeeping.

LONGEST RESPONSE DELAY

Holds for a constant scan time, an input that stays changed until read, and a program that turns it into the output within one scan; filter and output hardware delays are left out. With a varying scan, 2 T_scan still holds using the longest scan. Times in ms.

Each input module has an input filter: a short delay that rejects electrical noise, so a pulse shorter than the filter time never reaches the CPU. After it, the PLC reads the input once per scan, T_scan apart. A pulse is seen only if it starts no more than t_p before a read. Those start times fill a stretch t_p long in each T_scan gap, so a pulse shorter than a scan can slip between reads.

CHANCE OF SEEING A PULSE

Holds for a constant scan time, an instantaneous input read and a pulse start equally likely at any moment. t_p is the pulse width in ms after the input filter. If t_p ≥ T_scan, the pulse is always seen.

WORKED EXAMPLE

Input read takes 0.5 ms, the program runs 4000 instructions of 0.25 µs each, the output update takes 0.5 ms and housekeeping 3 ms; the scan time is constant. One rung sets an output from an input. Find the scan time, the longest response, and the chance of catching a 3 ms pulse (after the filter) whose start is equally likely at any moment.

Solution
  1. Program time: 4000 × 0.25 µs / 1000 = 1 ms, from n t_i / 1000 with t_i in µs.

  2. Scan time: 0.5 + 1 + 0.5 + 3 = 5 ms, because the four phases run in sequence.

  3. Longest response: 5 + (0.5 + 1 + 0.5) = 7 ms: up to one scan waiting for the read, then the next scan's read, program and update phases. It is below 2 × 5 = 10 ms because housekeeping comes after the write.

  4. The 3 ms pulse is shorter than the 5 ms scan, so it is not certain. P = 3/5 = 0.6, the share of each 5 ms gap in which its start lets a read fall inside it.

Answer: T_scan = 5 ms; the response is at most 7 ms; the 3 ms pulse is seen with probability 0.6.

WATCH OUT FOR

Thinking a faster CPU removes the problem. Test: a faster CPU mainly shortens T_prog; the input read, output update and housekeeping need not shrink. Add all four terms before trusting a short pulse.

Image tables, and PLC against microcontroller board

At the read phase the PLC copies every input into memory, the input image table, and the program reads those copies, not the terminals. A rung that switches an output writes into the output image table, which the output module takes whole at the update phase. So in a plain scan an input keeps one value all scan, and an output reaches its terminal once per scan.

Addresses here are IEC style: %I0.0 is an input bit, %Q0.0 an output bit and %M0.0 a memory bit; some PLC families write them differently. A ladder program is a list of rungs, each read left to right. Contacts test bits, in series as AND and in parallel as OR, and a coil writes the rung's result into its bit. A normally open (NO) contact passes when its bit is 1, a normally closed (NC) contact when it is 0.

Take a motor: start button (normally open) on %I0.0, contactor coil on %Q0.0, and a stop button wired normally closed on %I0.1, so that a broken wire acts like Stop. %I0.1 is then 1 until Stop is pressed, so the rung tests it with an NO contact. Contacts 1 and 2 are in parallel, in series with contact 3, driving coil 4. Contact 2 reads the coil's own bit and holds the motor on after Start is released: the seal-in.

Rung

Element, in order

Type

Address

Meaning

1

1

NO contact

%I0.0

Start pressed

1

2, parallel to 1

NO contact

%Q0.0

Motor on (seal-in)

1

3

NO contact

%I0.1

Stop not pressed

1

4

Coil

%Q0.0

Motor contactor

START-STOP RUNG AS A BOOLEAN EQUATION

Holds when the rung runs once per scan. The %Q0.0 on the right is the coil's bit read as a contact: its value in the output image table, left there by the previous scan.

Scan

%I0.0

%I0.1

Old %Q0.0

New %Q0.0

1

0

1

0

0

2

1

1

0

1

3

0

1

1

1

4

0

0

1

0

Each scan's old %Q0.0 is the previous scan's new value. Start is released in scan 3, yet the seal-in keeps the motor on. In scan 4 Stop is pressed, %I0.1 falls to 0 and the rung breaks.

A microcontroller board can run the same logic; a PLC differs in everything around it. Its isolated 24 V DC and 4-20 mA inputs and relay or transistor outputs are ready to wire, where a board's 3.3 V or 5 V pins need your own isolation and drivers. It is built for heat, vibration, electrical noise and a cabinet. It runs the same read, execute, write order every scan, and a watchdog timer faults the CPU if a scan overruns its set limit. It is programmed in ladder and other standard languages, and serviced by swapping modules.

Check yourself

CHECK YOURSELF 1

Which order does a PLC follow in one scan?

  1. (A)

    Read inputs, execute the program, update outputs, housekeeping

  2. (B)

    Execute the program, read inputs, housekeeping, update outputs

  3. (C)

    Update outputs, read inputs, execute the program, housekeeping

  4. (D)

    Housekeeping, update outputs, execute the program, read inputs

Answer and solution

Answer: (A)

  1. The inputs are copied first so the program has a fixed picture of the plant.

  2. The program then runs against that picture and fills the output image table.

  3. The outputs are written next, and housekeeping closes the scan.

CHECK YOURSELF 2

A PLC takes 1 ms to read inputs, runs 8000 instructions of 0.5 µs each, takes 1 ms to update outputs and spends 4 ms on housekeeping. Find the scan time in ms.

Answer and solution

Answer: (accepted range )

  1. Program time = 8000 × 0.5 µs / 1000 = 4 ms.

  2. Scan time = 1 + 4 + 1 + 4 = 10 ms.

CHECK YOURSELF 3

The scan time is a constant 10 ms. An input pulse 4 ms wide (after the input filter) starts at a moment equally likely to fall anywhere in the scan. What is the chance the PLC reads it?

  1. (A)

    0.25

  2. (B)

    0.4

  3. (C)

    0.6

  4. (D)

    1

Answer and solution

Answer: (B)

  1. The pulse is shorter than the scan time, so detection is not certain.

  2. P = t_p / T_scan = 4/10 = 0.4.

CHECK YOURSELF 4One or more options are correct

A PLC runs a plain scan, reading and writing points only at its read and update phases. Which statements about its image tables are correct?

  1. (A)

    An input keeps the same value everywhere in the program during one scan

  2. (B)

    A coil instruction changes the output terminal at once

  3. (C)

    The program reads the input image table, not the terminals

  4. (D)

    The output module takes the output image table at the update phase

Answer and solution

Answer: (A), (C), (D)

  1. Inputs are copied once at the read phase, so A and C hold.

  2. A coil writes to the output image table only, so B is false.

  3. The output module takes the table at the update phase, so D holds.

Used in these GATE topics