Chapter VIII

Programmable Logic Controllers and Automation

Red Seal Practice study guide with diagrams.

Programmable Logic Controllers and Automation

Introduction to Programmable Logic Controllers (PLCs)

The programmable logic controller (PLC) is an industrial computer designed to operate in harsh environments and to execute logic, sequential, timing, counting, and analog control functions in real time. For the Red Seal exam, you must understand the PLC not as a simple electronic relay, but as a complete system for acquisition, processing, and control.

A PLC consists of four fundamental elements:

5.The central processing unit (CPU): executes the program, manages memory, and communicates with the input/output (I/O) modules.
6.The memory: contains the user program (ladder logic), data (I/O image tables), and communication parameters.
7.The input modules: convert process signals (sensors, switches, transmitters) into digital signals understandable by the CPU.
8.The output modules: convert CPU commands into power signals for actuators (contactors, valves, drives).

The scan time is the total time required to read the inputs, execute the program, and update the outputs. This time typically varies from 1 to 20 ms depending on program size and processor speed. A frequent exam error is confusing scan time with a sensor's response time — these are two distinct concepts.

PLC Operating Cycles

The operation of a PLC follows a repetitive cycle in three phases:

PhaseDescriptionExample
**Read inputs**The CPU copies the physical state of the input modules into the input image table (memory)A limit switch is open → the image table receives a 0
**Execute program**The CPU processes the program instructions using the values from the image tableThe ladder logic evaluates conditions and determines outputs
**Write outputs**The CPU copies the output image table to the physical output modulesThe output coil is energized → the contactor opens

Critical point for the exam: during program execution, the physical inputs are NOT re-read. If an input changes state during the execution phase, the CPU will only detect it on the next scan cycle. This characteristic explains why outputs are consistent with an instantaneous state of the inputs, but can cause delays in high-speed applications.

I/O Numbering and Addressing

Each manufacturer uses a different addressing system, but the principle remains the same: physically and logically identifying each I/O point. For the exam, you must know the common conventions:

Allen-Bradley (Rockwell): addressing by slot and terminal, e.g., I:1.0/3 (input, slot 1, terminal 0, bit 3).
Siemens: addressing by byte and bit, e.g., I0.3 (input, byte 0, bit 3) or Q1.2 (output, byte 1, bit 2).
Modicon (Schneider): addressing by register, e.g., %I0001 (discrete input) or %M0001 (internal memory bit).

The image table is a memory area that contains a copy of the state of all inputs and outputs. This table is updated at the beginning and end of each scan cycle. Internal bits (or internal relays, markers) are binary memory locations used in the program to store intermediate states — they do not correspond to any physical input or output.

Programming Languages (IEC 61131-3)

The IEC 61131-3 standard defines five programming languages for PLCs. For the Red Seal exam, you must know them and be able to read them:

LanguageTypeTypical Use
**Ladder Diagram (LD)**GraphicalRelay logic, simple control
**Function Block Diagram (FBD)**GraphicalSignal processing, combinational functions
**Instruction List (IL)**TextualCompact programs, memory optimization
**Structured Text (ST)**TextualComplex calculations, data processing
**Sequential Function Chart (SFC)**GraphicalParallel sequences, process steps

Ladder Diagram (LD)

The ladder diagram is the most widely used language in North America. It represents logic in the form of electrical circuits between two virtual power rails. The basic elements are:

Normally open (NO) contact: represented by --| |--, it is true (conducting) if its address is at state 1.
Normally closed (NC) contact: represented by --|/|--, it is true if its address is at state 0.
Coil: represented by --( )--, it assigns the value of its output according to the state of the circuit.
Latching coil (SET/RESET): --(S)-- and --(R)-- maintain the state even if the condition disappears.

Example of equivalent logic: a starter with a stop button (NC) and a holding contact.

| Stop Start Contactor |

--/-------------( )-----
Contactor
---------------

In this example, if the stop button is pressed (NC contact opens), the circuit is opened and the contactor drops out. The auxiliary contact in parallel with the start button maintains the coil energized after the button is released.

Functions and Function Blocks

Function blocks (FBs) are graphical blocks that execute predefined functions. The most important ones for the exam:

Timer ON-delay (TON): output Q goes to 1 after input IN has remained at 1 for the preset time PT.
Timer OFF-delay (TOF): output Q goes to 0 after input IN has remained at 0 for the preset time PT.
Pulse timer (TP): output Q is active for PT after a pulse on IN.
Up counter (CTU): increments the CV value on each rising edge of input CU.
Down counter (CTD): decrements the CV value on each rising edge of input CD.
Comparator: compares two values (>, <, =, ≥, ≤, ≠) and produces a boolean output.

Timer time calculation formula:

Actual time = PT × time base

If PT = 50 and time base = 100 ms, then the delay is 50 × 0.1 s = 5 seconds. A classic error is forgetting to multiply by the time base.

Sensors and Transducers

Sensors convert a physical quantity into an electrical signal. For the exam, you must know the following types and their characteristics:

Proximity Sensors

TypePrincipleDetectionAdvantagesDisadvantages
**Inductive**Inductance variationFerrous and non-ferrous metalsRobust, non-contactShort sensing distance (1–15 mm)
**Capacitive**Capacitance variationMetals, liquids, plasticsDetects almost anythingSensitive to humidity and dust
**Photoelectric**Light emission/receptionSolid objects, transparent objectsLong range (up to 30 m)Sensitive to dirt, alignment
**Ultrasonic**Sound wave reflectionSolids, liquids, levelsWorks in dusty environmentsLimited range, temperature sensitivity

Temperature Sensors

Thermocouple: two different metals produce a voltage proportional to the temperature difference between the junctions. Types J, K, T, E — type K is the most common (−200 °C to +1250 °C).
RTD (resistance temperature detector): the resistance of a platinum wire varies with temperature. The relationship is nearly linear: R = R₀(1 + α·ΔT), where α ≈ 0.00385 Ω/Ω/°C for platinum.
Thermistor: resistance with a negative temperature coefficient (NTC) or positive temperature coefficient (PTC). High sensitivity but limited range.

Pressure and Level Transmitters

A transmitter converts a sensor signal into a standardized signal, typically 4–20 mA or 0–10 V. The 4–20 mA signal is preferred in industry because it allows detection of a broken wire (0 mA) and is less sensitive to electromagnetic interference.

Conversion calculation: if a pressure transmitter has a range of 0 to 100 kPa and produces 4–20 mA, the pressure for a current of 12 mA is:

P = (I − 4) × (P_max − P_min) / (20 − 4) = (12 − 4) × 100 / 16 = 50 kPa

Actuators and Power Interfaces

Contactors and Relays

The contactor is an electrically controlled switch used to switch power loads. Its essential characteristics:

Rated current (AC-3): allowable current in motor service.
Coil voltage: 24 VDC, 120 VAC, 240 VAC, etc.
Breaking capacity: maximum current it can interrupt without damage.
Utilization category: AC-1 (resistive loads), AC-3 (squirrel-cage motors), AC-4 (starting and braking).

Variable Frequency Drives (VFDs)

The variable frequency drive controls the speed of an induction motor by varying the frequency and voltage of the power supply. The fundamental relationship is:

N = 120 × f / p

where N is the speed in revolutions per minute, f is the frequency in hertz, and p is the number of motor poles.

For a 4-pole motor supplied at 60 Hz: N = 120 × 60 / 4 = 1800 RPM. At 30 Hz, the speed becomes 900 RPM.

V/f characteristic: to maintain constant torque, the voltage-to-frequency ratio must remain constant. If the rated voltage is 480 V at 60 Hz, then at 30 Hz the voltage must be 240 V.

Servomotors and Stepper Motors

Servomotor: a DC or AC motor with position feedback (encoder or resolver). Used for precise and dynamic positioning.
Stepper motor: advances in discrete increments (steps). A motor with 200 steps/revolution moves 1.8° per step. For a 90° displacement, 50 steps are required.

Industrial Communication

Industrial networks allow communication between PLCs, drives, smart sensors, and supervisory systems (SCADA). For the exam, you must know the following protocols:

ProtocolTypeSpeedTopologyUse
**EtherNet/IP**Industrial Ethernet10/100/1000 Mb/sStar, ringGeneral communication, remote I/O
**Modbus RTU**Serial (RS-232/485)9.6–115.2 kb/sBusSensors, drives, meters
**DeviceNet**CAN125–500 kb/sBusDecentralized I/O, sensors
**PROFIBUS DP**Serial9.6 kb/s – 12 Mb/sBusSiemens PLCs, remote I/O
**PROFINET**Ethernet100 Mb/sStar, lineIntegrated automation

Modbus addressing: addresses are of type 0xxxx (discrete outputs), 1xxxx (discrete inputs), 3xxxx (input registers), 4xxxx (holding registers). Register 40001 corresponds to address 0 in the protocol.

Functional Safety and Emergency Stops

Functional safety aims to reduce risks to an acceptable level. For the exam, you must understand:

Performance level (PL) according to ISO 13849-1: levels a to e, where e is the safest.
Safety integrity level (SIL) according to IEC 61508: levels 1 to 4.
Stop category according to IEC 60204-1:
Category 0: immediate stop by cutting off power (uncontrolled stop).
Category 1: controlled stop with power maintained for braking, then power cut-off.
Category 2: controlled stop with power maintained (operational stop).

Golden rule: an emergency stop circuit must be hardwired and not dependent solely on the PLC program. Safety relays and light curtains must comply with applicable standards.

PLC Wiring and Installation

Canadian Electrical Code Requirements

The Canadian Electrical Code (CE Code) applies to the installation of PLCs and their circuits. Relevant rules include:

Rule 2-024: conductors and equipment must comply with CSA standards.
Rule 2-100: conductors must have sufficient ampacity for the load.
Rule 4-004: conductors must be protected against overcurrent.
Rule 6-102: control circuits must be identified.
Rule 10-204: equipment enclosures must be grounded.
Rule 14-010: protective devices must comply with standards.

Circuit separation: power circuits (120 VAC and above) must be separated from low-voltage control circuits (24 VDC) to avoid electromagnetic interference. Use separate conduits or partitions in wireways.

Grounding and Shielding

Grounding of the PLC and its modules must be done according to manufacturer specifications.
Communication cables must be shielded and the shield grounded at ONE end only to avoid ground loops.
Analog cables must be twisted and shielded, with the shield connected to ground at the receiver end.

Troubleshooting and Diagnostics

Troubleshooting a PLC system follows a systematic method:

101.Observe: check the PLC status indicators (RUN, FAULT, I/O).
102.Verify power supply: measure input voltages (24 VDC, 120 VAC).
103.Check inputs: use programming mode to view the state of inputs in the image table.
104.Check outputs: force outputs (with caution) to verify wiring.
105.Analyze the program: use monitor mode to follow execution in real time.

Diagnostic tools:

Multimeter: measuring voltages, continuity, resistance.
Clamp meter: measuring current without interrupting the circuit.
Programming software: online monitoring, forcing, modification.
Network analyzer: verifying communication frames.

Common Troubleshooting Errors

SymptomProbable CauseVerification
PLC in fault (FAULT indicator)Communication loss, program errorRead the error code, check wiring
Input does not change stateDefective sensor, broken cable, wrong addressMeasure voltage at the sensor, check wiring
Output active but actuator does not workDefective contactor, blown fuse, broken cableMeasure voltage at the output, check the fuse
Intermittent communicationPoor shield grounding, missing terminationCheck termination resistors, shielding

Calculations and Conversions for the Exam

Analog-to-Digital Conversion

An analog input module converts a 4–20 mA or 0–10 V signal into a digital value. The resolution is determined by the number of bits:

Digital value = (Signal − Signal_min) × (2^n − 1) / (Signal_max − Signal_min)

For a 12-bit module (0–4095) with a 4–20 mA signal and a reading of 12 mA:

Value = (12 − 4) × 4095 / (20 − 4) = 8 × 4095 / 16 = 2047

Scaling Conversion

To convert a digital value into a physical quantity:

Quantity = (Digital_value − Value_min) × (Quantity_max − Quantity_min) / (Value_max − Value_min) + Quantity_min

Output Circuit Load Calculation

To determine how many outputs a module can drive, calculate the total current:

I_total = Σ I_actuator

Verify that I_total ≤ I_max of the module and that each individual output respects its rated current.

Applicable Standards and Codes

For the Red Seal exam, you must know the following standards:

StandardTitleApplication
**IEC 61131-3**Programmable controllers — LanguagesPLC programming
**IEC 60204-1**Safety of machinery — Electrical equipmentControl circuits, emergency stops
**ISO 13849-1**Safety of machinery — Control system partsPerformance levels
**IEC 61508**Functional safety of electrical systemsSIL, safety lifecycles
**CSA C22.1**Canadian Electrical CodeElectrical installation
**CSA B149.1**Natural gas and propane installation codeInterfaces with gas systems

Important note: the Canadian Electrical Code, Part I applies to electrical installations in hazardous locations (classified areas). If a PLC is installed in a hazardous area, it must be certified for that area or installed in a pressurized enclosure.

Pitfalls to Avoid

131.Confusing NO and NC contacts: an NC contact is closed at rest and opens when actuated. In the program, an NC contact is true (conducting) when its address is at 0.
132.Forgetting the timer time base: PT = 50 with a 100 ms base gives 5 s, not 50 ms.
133.Neglecting scan time: inputs are only read once per scan cycle. A pulse shorter than the scan time can be missed.
134.Forcing outputs without caution: forcing can cause dangerous machine movements. Always follow safety procedures.
135.Confusing communication protocols: Modbus RTU is serial, EtherNet/IP is Ethernet — addresses and speeds are different.
136.Ignoring circuit separation: power and control cables must be separated to avoid interference.
137.Forgetting shield grounding: a shield grounded at both ends creates a ground loop.
138.Using the wrong sensor type: an inductive sensor does not detect plastic, a capacitive sensor can be fooled by humidity.
139.Not verifying the emergency stop category: category 0 is immediate cut-off, category 1 allows a controlled stop.
140.Calculating motor speed with the wrong formula: N = 120 × f / p, not 60 × f / p.

Summary

The PLC is a complete system with CPU, memory, inputs, and outputs, operating on a scan cycle.
Scan time determines system responsiveness; inputs are read once per cycle.
IEC 61131-3 languages include LD, FBD, IL, ST, and SFC — ladder diagram is the most common.
Timers (TON, TOF, TP) and counters (CTU, CTD) are essential blocks with precise calculation formulas.
Sensors (inductive, capacitive, photoelectric, ultrasonic) and transmitters (4–20 mA) convert physical quantities into electrical signals.
Variable frequency drives control motor speed according to the relationship N = 120 × f / p.
Industrial networks (EtherNet/IP, Modbus, DeviceNet, PROFIBUS) ensure communication between equipment.
Functional safety requires hardwired emergency stop circuits, compliant with IEC 60204-1 and ISO 13849-1.
The Canadian Electrical Code applies to PLC installation, notably Rules 2-024, 4-004, 10-204, and 14-010.
Troubleshooting follows a systematic method: observation, power supply verification, I/O checks, program analysis.
Analog-to-digital conversions and scaling calculations are frequent exam questions.

To pass the exam, practice reading ladder diagrams, calculating timers and conversions, and identifying the applicable standards for each situation. Practice with concrete examples is the best preparation.

Ready to test this chapter?

Practice with exam-aligned questions and timed simulations.

Start Practicing Free