UNIHIVE

Study Hub UNIPORT MEG 403

MEG 403 · Computer-Aided Design & Manufacturing

Programmable logic controllers and their programming

PLC parts and scan cycle, ladder logic, timers and counters, and a start-stop motor circuit.

Our notes

2 min read

What a PLC is

A rugged industrial computer that controls machines and processes by reading inputs (switches, sensors) and switching outputs (motors, valves, lamps) according to a stored program. PLCs replaced banks of relays from the late 1960s (first used in the US car industry).

Parts

  • CPU with memory.
  • Input modules (digital: push buttons, limit switches, proximity sensors; analogue: temperature, pressure 4-20 mA).
  • Output modules (relays, transistors, analogue outputs).
  • Power supply, programming device (laptop software), communication ports (Ethernet, fieldbus), and often an HMI touch panel.

The scan cycle

  1. Read all inputs into memory.
  2. Execute the program from top to bottom.
  3. Write all outputs.
  4. Housekeeping and communication.

Repeated continuously, typically every few milliseconds. A signal shorter than one scan may be missed.

Programming languages (IEC 61131-3)

Ladder diagram (LD), function block diagram (FBD), structured text (ST), instruction list (IL, now deprecated), sequential function chart (SFC). Ladder logic looks like relay circuits and is the most common.

Ladder symbols

SymbolMeaning
] [ normally open contacttrue when the input is ON
]/[ normally closed contacttrue when the input is OFF
( ) coiloutput turns ON when the rung is true

Contacts in series make AND; contacts in parallel make OR.

Worked example: start-stop with seal-in

Push buttons: START (normally open), STOP (wired normally closed). Motor M.
Rung: [START] in parallel with [M] (the seal-in contact), in series with [STOP], driving coil (M).
Logic: M = (START OR M) AND STOP-healthy.

  • Press START: M turns ON; the M contact "seals in", so M stays ON after START is released.
  • Press STOP: the rung breaks, M turns OFF.

STOP is wired normally closed for safety: a broken wire stops the motor instead of preventing a stop. Emergency stops must also cut power in hardware, not only through the PLC.

Timers and counters

  • TON (on-delay): output turns ON after the input has been ON for a preset time (start a conveyor 5 s after a warning horn).
  • TOF (off-delay), TP (pulse).
  • Counters (CTU, CTD): count events (12 bottles then move the carton).

Worked example: Boolean to ladder

A press may run (P) only if both guard switches G1 and G2 are closed and either the two-hand buttons B1 and B2 are both pressed or the setter's key K is on: P = G1 · G2 · (B1 · B2 + K). Ladder: G1 and G2 in series, followed by a parallel branch of (B1 in series with B2) and K, driving coil P.

Exams usually ask

  • Describe the parts and scan cycle of a PLC.
  • Draw ladder diagrams for start-stop, interlocks and timed sequences.
  • Convert Boolean expressions to ladder logic.

Common mistake

Using a normally open contact for the STOP button input logic without thinking about wiring. Stop circuits must fail safe: a broken wire should stop the machine.

Written by the UniHive team in our own words. Spotted a mistake? Tell us on WhatsApp.

Read

Watch

We link to free material and never copy it. Every link was opened by our team before it went up; video data is a rough guide at 360p.

All MEG 403 topics

Report

Sign in to report this. It is free.

Is this your work (a lecturer, author or publisher)? Ask us to take it down.