PLC architecture and I/O modules

PLC hardware, digital and analog I/O modules, sinking/sourcing, analog resolution and scaling, and the scan cycle with response-time calculations.

Drafted with Aria, reviewed by the AiCanCode.org team. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Programmable logic controllers run conveyors, packaging lines, burner management, water plants and most machine-level automation in Indian industry. An engineer who understands what is inside the rack — how inputs are read, how the program is scanned and how outputs are driven — can choose the right modules, wire them correctly and explain why a fast pulse was missed or an analog reading jumps in steps.

Key ideas

What a PLC is. A ruggedised industrial computer that reads field inputs, executes a user program cyclically and drives outputs. It replaced hard-wired relay panels because logic changes become software changes, diagnostics are built in, and it tolerates heat, vibration and electrical noise. Compact (brick) PLCs have fixed I/O; modular PLCs have a rack or DIN-rail backplane with separate modules.

Main parts.

  • Power supply module — converts mains (230 V AC) or 24 V DC to the backplane voltages; field devices are usually powered from a separate 24 V DC supply.
  • CPU — processor, operating system, watchdog timer, real-time clock; executes the program and manages communication.
  • Memory — firmware (ROM/flash), user program (flash/RAM) and data memory: input image table, output image table, internal bits (markers/flags), timers, counters and data registers. Retentive memory keeps values through a power cycle (battery or flash).
  • I/O modules — the interface to the field (below).
  • Communication modules — Ethernet (Modbus TCP, PROFINET, EtherNet/IP), serial Modbus RTU, PROFIBUS DP, links to remote I/O racks, HMIs and SCADA.
  • Programming device — a PC running the vendor's IEC 61131-3 software (ladder diagram, function block diagram, structured text, sequential function chart, instruction list).

Digital (discrete) inputs. Accept on/off signals from push buttons, limit switches, proximity sensors and relay contacts, typically 24 V DC (sometimes 110/230 V AC). Each channel has opto-isolation and an input filter (a few ms) to reject contact bounce and noise. Sinking inputs take current in from a sourcing (PNP) sensor; sourcing inputs supply current to a sinking (NPN) sensor — sensor and card must be matched.

Digital outputs. Relay outputs switch AC or DC loads, are robust but slow and wear out. Transistor outputs switch DC fast and silently. Triac outputs switch AC loads. Each output has a current rating per point and per common; inductive loads need suppression diodes or RC snubbers.

Analog inputs. Accept 4–20 mA, 0–10 V, or direct thermocouple and RTD signals. An ADC converts the signal to a count, e.g. 12-, 14- or 16-bit. The smallest step (resolution) is span/2ⁿ; some manufacturers quote span/(2ⁿ − 1), which gives practically the same number. The program scales counts to engineering units.

Analog outputs. A DAC drives 4–20 mA or 0–10 V to valve positioners, variable-speed drives and recorders.

Special modules. High-speed counters (encoder pulses faster than the scan), PID loop modules, motion/servo modules, weighing modules, and safety I/O for safety PLCs.

Scan cycle. The CPU repeats: (1) read all inputs into the input image table; (2) execute the program from top to bottom using the image table; (3) write the output image table to the output modules; (4) communication and self-diagnostics. Scan time depends mostly on program length and instruction types (milliseconds to tens of ms). An input that changes just after the input read is not seen until the next scan, so the worst-case response is about two scans plus input filter and output delays. A pulse shorter than one scan can be missed altogether — use a high-speed counter or an interrupt input. The watchdog timer stops the CPU and drops outputs if a scan takes too long.

Reliability features. Redundant CPUs and power supplies, hot-swappable modules, remote I/O to save field wiring, and output fail-safe states configured for loss of communication.

Formulas

resolution = (x_max − x_min) / 2ⁿ (some vendors: /(2ⁿ − 1))

  • x_max − x_min: span of the input or output (V, mA or engineering units); n: number of ADC/DAC bits.

x = x_min + (C − C_min)·(x_max − x_min)/(C_max − C_min)

  • C: raw count; C_min, C_max: counts at the ends of the range; x: scaled value in engineering units.

t_response,max ≈ t_filter + 2·t_scan + t_output and t_response,min ≈ t_filter + t_scan + t_output

  • t_scan: PLC scan time (s); t_filter: input filter delay (s); t_output: output switching delay (s).

t_pulse > t_scan + t_filter

  • Minimum width of a discrete input pulse that is guaranteed to be seen without a high-speed or interrupt input.

Worked examples

Example 1 (standard) — analog scaling. A 12-bit analog input maps 4–20 mA to counts 0–4095 and is connected to a pressure transmitter ranged 0–10 bar. The program reads a count of 2867. Find the pressure, the loop current and the resolution in mA and in bar.

  1. Pressure = 0 + (2867 − 0) × (10 − 0)/(4095 − 0) = 2867 × 10/4095 = 7.00 bar.
  2. Current = 4 + 16 × 2867/4095 = 4 + 11.20 = 15.2 mA.
  3. Resolution (using 4095 steps, as this card's scaling does) = 16 mA/4095 = 3.9 µA, i.e. 10 bar/4095 = 2.44 mbar per count.

Example 2 (GATE level) — scan time and response. A PLC has a scan time of 20 ms, an input filter of 5 ms and relay outputs that take 10 ms to switch. A reject gate must act on a carton moving at 2 m/s when a photo-eye sees it. (a) Find the best- and worst-case response times. (b) How far can the carton travel in the worst case? (c) What is the shortest photo-eye pulse that is guaranteed to be detected?

  1. (a) Worst case: t = 5 + 2 × 20 + 10 = 55 ms. Best case: t = 5 + 20 + 10 = 35 ms.
  2. (b) Distance = v × t = 2 m/s × 0.055 s = 0.11 m (110 mm), so the gate must be at least this far downstream, plus margin; the spread 70–110 mm is the positioning uncertainty.
  3. (c) t_pulse > t_scan + t_filter = 20 + 5 = 25 ms. A carton gap that blocks the beam for less than this may be missed; use a faster task, an interrupt input or a high-speed counter.

Common mistakes

  • Thinking the PLC responds the instant an input changes; it only sees inputs at the start of the next scan.
  • Mixing up sinking and sourcing; a PNP sensor on a sourcing input card will never switch it.
  • Using relay outputs for fast cycling loads (short life) or transistor outputs for AC loads (they cannot switch them).
  • Forgetting surge suppression on solenoid coils driven by DC outputs.
  • Scaling analog counts with the wrong end-points — e.g. treating count 0 as 0 mA when it represents 4 mA.
  • Powering field sensors from the PLC's internal supply beyond its rating.

For GATE IN

Expect: ADC/DAC resolution and quantisation step for a given number of bits and range; converting a count or voltage into engineering units; the order of operations in a scan cycle and its effect on response time; and the differences between relay, transistor and triac outputs. Practise linear scaling with live-zero signals.

Quick check

  1. What is the resolution of a 10-bit input with a 0–10 V range (span/2ⁿ)?
  2. List the four steps of a PLC scan in order.
  3. Which output type would you choose to switch a 230 V AC contactor coil many times a minute without contact wear?
  4. A 16-bit card maps 0–10 bar to 0–65535 counts. What count corresponds to 2.5 bar?

Answers: 1. About 9.77 mV. 2. Input read, program execution, output update, communication and diagnostics. 3. A triac (solid-state AC) output. 4. About 16384.

PLC Analog I/O Module Resolution

Adjust the number of bits and voltage range to see how they affect the resolution of an analog I/O module.

Equations used
  • Resolution = (V_max - V_min) / (2^n - 1) — Resolution: smallest change detectable by an analog I/O module (V), V_max: maximum voltage (V), V_min: minimum voltage (V), n: number of bits

Try answering each one aloud before you open it.

  1. 1.What is a PLC and what are its main components?Concept

    A Programmable Logic Controller (PLC) is an industrial digital computer designed for the control of manufacturing processes. Its main components include the CPU (Central Processing Unit), memory, power supply, input/output (I/O) modules, and communication interfaces. The CPU executes control instructions stored in the memory, while I/O modules interface with external devices to receive inputs and send outputs.

  2. 2.Explain the role of I/O modules in a PLC system.Concept

    I/O modules in a PLC system serve as the interface between the PLC and the external environment. Input modules receive signals from sensors and convert them into a form that the PLC can process. Output modules take control signals from the PLC and convert them into actions, such as turning on a motor or opening a valve. This allows the PLC to monitor and control physical processes.

  3. 3.Why are PLCs preferred over traditional relay-based control systems?Application

    PLCs are preferred over traditional relay-based control systems because they offer greater flexibility, reliability, and ease of programming. PLCs can be easily reprogrammed to accommodate changes in the control process, whereas relay-based systems require physical rewiring. Additionally, PLCs can handle complex control tasks and provide diagnostic information, which enhances system reliability and maintenance.

  4. 4.What happens if a PLC's input module fails?Application

    If a PLC's input module fails, the PLC may not receive accurate signals from sensors, leading to incorrect processing and control actions. This can result in system malfunctions, such as incorrect operation of machinery or failure to respond to critical conditions. It is important to have redundancy and diagnostic features to detect and mitigate such failures.

  5. 5.How does a PLC communicate with other devices in an industrial network?Concept

    A PLC communicates with other devices in an industrial network using communication protocols such as Modbus, Profibus, Ethernet/IP, or DeviceNet. These protocols allow the PLC to exchange data with other PLCs, computers, and field devices, enabling coordinated control and monitoring across the network. The choice of protocol depends on the specific requirements of the application.

  6. 6.Explain the difference between analog and digital I/O modules in a PLC.Concept

    Analog I/O modules handle continuous signals, such as temperature or pressure, and convert them into digital values for the PLC to process. Digital I/O modules, on the other hand, handle discrete signals, such as on/off states, and are used for binary inputs and outputs. The choice between analog and digital modules depends on the type of signals being monitored or controlled.

  7. 7.Why is it important to have a backup power supply for a PLC system?Application

    A backup power supply is important for a PLC system to ensure continuous operation during power outages. This is critical in industrial environments where process interruptions can lead to safety hazards, equipment damage, or financial losses. A backup power supply, such as an uninterruptible power supply (UPS), provides temporary power to allow for safe shutdown or continued operation until normal power is restored.

  8. 8.What is the impact of scan time on PLC performance?Application

    Scan time is the time for one cycle of reading inputs, executing the program, updating outputs and doing communication and housekeeping. It sets the response time: an input change can take up to about two scans plus filter and output delays to reach an output, and a pulse shorter than one scan may be missed entirely. Scan time grows with program size and instruction type, so long programs are split into tasks of different priority, and fast events use high-speed counters or interrupt inputs; the watchdog timer faults the CPU if a scan exceeds its limit.

  9. 9.Estimate the I/O points required for a PLC controlling 10 motors (start/stop) and monitoring 5 temperature transmitters.Numerical

    A bare minimum is one digital output per motor (run command) and one analog input per transmitter: 10 DO + 5 AI = 15 points. In practice each motor also needs at least one digital input for run feedback from the contactor auxiliary contact, and often a trip/overload input, giving 10 DO + 10–20 DI + 5 AI = 25–35 points. Designers then add about 20 % spare per signal type before choosing module sizes.

  10. 10.A PLC system has a scan time of 100 ms. How many scans will it complete in one minute?Numerical

    To find the number of scans completed in one minute, divide the total time in milliseconds by the scan time. One minute is 60,000 milliseconds. Therefore, the number of scans is 60,000 ms / 100 ms per scan = 600 scans.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?