Programmable logic controller
A PLC (Programmable logic controller) or programmable controller is a small industrial computer used to control how/when machines work.
A PLC (Programmable logic controller) or programmable controller is a small industrial computer used to control how/when machines work.
[1]
[6]
[6] Applications can be for systems of minimal or no manual controls, like on/off control or sophisticated systems based on calculation and sequences. Before PLCs, banks of relays (Fig [6]) were used, each controlling dedicated input/output based on physical wires, some controlling each other to form larger controllers.
[6] E.g. Via 1 AND gate, if 2 inputs (relays, sensors, other relay's outputs) energize, does the output relay energize
[6] Old usage of relays were complex and time consuming due to their complexity, such as finding a fault or changing the wiring for other systems. These can be replaced by software logics, when PLC were introduced, which does decisions based on rules (AND/NOT/THEN) and output commands to output a command.
[6] Relays can also be used with PLCs to do automation tasks and communicate with PLCs to reduce how much programming in the PLCs and storages.
[6] PLCs are also used in conveyor belts like in airports. E.g. A bag enters a conveyor belt and a PLC scans its barcode based on a set of rules for either domestic/international rules, then which city to go, then which gate, and it arrives at the correct gate (airplane in this case).
[6] Input modules of field censors are the physical connections between real life and the PLC, like digital inputs (basic on/off switches, bimetallic strip, sensors, float switch, etc) which can only provide something's info that's either on/off.
[6] To provide something in between on/off, we use an analogue input like a control knob that sends voltage through a transformer to a voltmeter reading 0 V at 0% and 10 V at 100%. The PLC can scale the input to match the sensitivity needed for accurate output control. It also converts the the voltage into current via resistors and Ohm's law. The current amount tells the PLC if something is performing between off/on (thermalcouple, pressure sensor, a strain gauge, etc). The voltage and current are converted to a fitting amount for the CPU to understand.
[6] An input module do 4 main tasks:
They sense when a signal receives.
Convert signal voltage into the correct signal for the CPU.
Isolate the PLC from fluctuations in the input voltage/current signal.
Send a "correct" signalt to the CPU.
[6] A central processor unit is the system's 'brain,' it holds the program deciding what softwares are needed via rules to the input signals.
It often comprises of:
microprocessor does the work of the based on the program's input value
a memory chip to store the program, the output history, faults or alarms, etc
other integrated circuits like modbus, line connection allowing to remotely communicate with reprogram, monitor the device
a battery to keep the PLC alive in case of power failures
a time clock/calender to work a device at the correct time
[6] The output module/field output device provides the signal to the device we control (indicator light, solenoid valve, motor starter, a VFD, etc).
Some PLCs have a screen for user interfaces, a power supply to provide low voltage used by the CPU, and the input and output modules.
[6] A PLC's basic function is to do a preprogrammed output, dependig on th einput signal by following a set of rules.
A PLC fufills these stages in its basic operations:
The input scan detects the inputs' states
The program scan checks what must be done
Executing the program logic implements what the rules state
Updating outputs to operate output devices
Housekeeping, self diagnostics, communications, and reporting.
The scan time (time taken to do all the stages) depends on the sensitivity, resilience. Analog input take longer ot process unlike basic digital on/off inputs. E.g. A fast scan time at ~2 ms to avoid overfilling. A room temperature control can be slower, at ~100 ms.
[6] An example of a basic response A bimetallic stirp temperature sensor attaches to a PLC which attaches to boiler.
The strip bends as it becomes hotter/colder to detect if the room is correct temperature, which here controls the boilder. As the room is at correct temperature, the circuit completes so the PLC receives signals and the boiler is off. As the room temperature drops, the circuit is no longe rcomplete and the PLC detects this change on the input and react by sending an output signal to enable the boiler.
[6] I/O PLC, a relay can also do this but a PLC is better as it has a time function, that checks time before turning on the boiler. E.g. The building may be on at night and weekends, times that we don't the boiler to turn on. The PLC is told the room is too cold and checks the time and date to see if it can turn on/stay off.
[6] E.g. Advanced response A thermistor connects connects to a PLC that connects to an actuator valve. The thermistor gives a temperature scale I/O just on/off signal like the bimetallic strip.
The actuator uses a small motor to control the valve position physically anywhere from 0%-100% for how much hot water is used to heat a room.
An actuator's PID (propotional integral derivative) control loop controls the valve position, to ensure it only opens enough to suit the difference between the room's desired temperature and true temperature. E.g. If a room's temperature drops a bit, we don't want the heating valve to instantly be at 100% and heat too fast which overshoots the desired temperature, which when it turns off, and so on.
Instead, we want the valve to temporarily open proportion to the demand. So at a small temperature contrast, the valve slowly opens at small amounts. At large temperature, it opens further and faster
[6] E.g. Complex response Many commercial buildings' heating/cooling systems use a control method called an optimizer, which learns gradually how fast a building heats up and cools down, then starts the heating/cooling system at the optimal time before the building is occupied. E.g.
if ppl work at 9 AM, the system knows it turns on at 7 AM for the rooms to be at the right temperature.
[6] This PLC controls an actuator valve for a heating system and has 2 pumps, set up in duty-standby-configuration, so only 1 pump runs at a time. The PLC decides which pump turns on based on the lowest number of previous run hours by using flow sensors to detect if the pump turns on, if told to. If it fails to turn on, the PLC receives an alarm and cut the power, and tells other pump to start.
But before the heating system pumps up, the PLC checks the clock if the heating should turn on today. If so, at what time is the building occupied. If the time is at 9 AM, the PLC checks the room's temperature and calculates the difference between this and the desired temperature, as well as the outdoor temperature to calculate how long it takes to heat the building, colder days cause higher heat losses, which takes longer. From this, the PLC calculates what time it must turns the system for the building to be at the desired temperature ready at 9 AM.
Main PLC types are:
Fixed/Compact PLC
All components (CPU, power supply, I/O) are built into 1 unit.
Example: Siemens LOGO!, Allen-Bradley MicroLogix.
Modular PLC
Components are separate modules (CPU, I/O, comms) mounted on a rack.
Easy to expand and customize.
Example: Siemens S7-300, Allen-Bradley ControlLogix.
Rack-Mounted PLC
A larger modular system where each module plugs into a chassis (rack).
Suited for complex, large-scale automation.
Soft PLC
PLC functions are done by software on a PC instead of dedicated hardware.
Distributed PLC
Multiple PLCs connected over a network, handling control tasks across different locations.
Want me to also break down brands/models with examples for each type?
The SIMATIC S7-300 (S7300) is a modular, mid-range PLC made by Siemens, often used in industries for various automation tasks.
A common PLC series by major manufacturers are:
Siemens’ PLCs are branded as “SIMATIC”:
S7-200
S7-300
S7-400
S7-1200
S7-1500
Allen-Bradley (Rockwell Automation):
MicroLogix (1000, 1100, 1200, 1400, 1500)
CompactLogix
ControlLogix
Mitsubishi electric:
FX Series (FX1S, FX1N, FX3U, etc.)
L Series
Q Series
iQ-R Series
Omron:
CP Series
CJ Series
CS/CJ2 Series
NX Series
Schneider Electric:
Modicon M221, M241, M251
Modicon Quantum
Modicon Premium
If you want, I can make a quick comparison table of these series with their typical applications and sizes. Do you want me to do that?
Its key features are:
Modular design has components like CPU modules, power supplies, digital/analog I/O modules, communication modules, and function modules (e.g., for counting or motion control).(botworksautomation.com, spsdirekt.com, allaboutplcs.com)
Space-Efficient & Fanless: Compact and reliable, suitable for control cabinets.(KM AUTOMATION, botworksautomation.com)
Communication flexibility: Supports protocols like PROFIBUS, PROFINET, CAN, and others—via dedicated modules—enabling integration in complex networks.(allaboutplcs.com)
Scalable Performance: Available in different CPU power tiers (standard, compact, fail-safe, technology-specific)—expandable over time.(e-motionsupply.com, spsdirekt.com)
Advanced Diagnostics: Built-in diagnostic features help reduce downtime.(KM AUTOMATION, indmall.in)
Usual usages:
Used in manufacturing, packaging, textiles, water treatment, chemical/pharmaceutical industries—handling both general machine control and complex automation.(plc-siemens.com, KM AUTOMATION, indmall.in)
Lifecycle Notes:
Launched in 1995, the S7-300 series has been very successful and is still widely used globally.(botworksautomation.com, Wikipedia)
Siemens is phasing it out, with support expected until around 2033.(Wikipedia, botworksautomation.com)
Many practitioners on forums note that although it's officially “end-of-life,” it remains in active use—especially in legacy systems—and skills learned on it transfer well to newer models.(Reddit)
“Siemens has officially declared 'end-of-life' for the S7-300 but there are like a million of them in the field still working fine… you aren’t wasting your time by using one.”(Reddit)
Comparison to Newer Models:
S7-1500 is the modern successor, offering better diagnostics, onboard display, faster performance, and ease of integration via TIA Portal.(realpars.com)
Yet, if working with existing systems or training, S7-300 remains relevant and practical.(realpars.com, Reddit)
STEP 7 is Siemens’ software used to program and configure their PLCs (mainly the S7-300, S7-400, and older S7-1200/1500 before TIA Portal).
STEP 7 allows us to:
Write PLC programs (ladder logic, function block diagram, statement list).
Configure hardware (CPU, I/O modules, communication).
Monitor and troubleshoot PLC operations.
Download/upload programs to/from the PLC.
It runs on Windows and was later integrated into TIA Portal (Totally Integrated Automation), which is Siemens’ newer all-in-one platform.
other STEP 7 variants are:
STEP 5 → Old software for Siemens S5 PLCs (now obsolete).
STEP 7 MicroWIN → For Siemens S7-200 PLCs.
STEP 7 Basic / Professional → Editions for S7-300/400/1200/1500.
STEP 7 in TIA Portal → The modern version integrated into Siemens’ TIA Portal platform.
A user program
[1] It consists of logic blocks and data blocks.
Logic blocks are blocks with a code section like organization blocks, function blocks, or functions.
[5] Organization blocks (OBs) form the interface between the operating system and the user program. Different organization blocks have different functions.
To make an LAD user program for a S7 CPU, we select the OBs needed for a specific automation task. Most basic task need:
Startup (OB100, OB101)
Scan cycle (OB1)
Error handling (OB80 to OB87, OB121, OB122), if you do not want your
CPU to switch to STOP if an error occurs.
There are also organization blocks available to handle interrupts in the CPU or other interrupts from the process.
[5] We can program all organization block as a structured program by creating functions (FCs) and function blocks (FBs) and calling them in the code section. As the blocks are called, we supply the data needed for declared parameters.
A function block (FB) is a logic block with “memory”. This memory takes the form of instance data blocks assigned to the FB. The instance DBs store all the actual parameters and static data relating to the function block.
A function (FC) is a logic block without “memory”, in other words without associated instance DBs. After an FC has been processed, the output parameters contain the calculated function values. Once the function has been called, the user decides how the actual parameters are used and stored.
The operating system makes the following data available:
Peripheral I/Os
Process image input/output
Bit memory
Timers
Counters
[5] You can also define your own data:
We can define shared data in data blocks. This data is accessible to the entire user program.
We can define static variables. These are only valid in the function block within which they are defined. Every time an FB is called, an instance data block is specified which includes all parameters and the static data. In the case of multiple instances, the instance and static data are incorporated in the instance data block.
We can define temporary data when you create logic blocks. This data only needs stack memory during the actual processing of the block. Data blocks store the data of the user program. There are 2 data block types: shared data blocks and instance data blocks.
Shared DBs can be accessed by all the blocks in the program. Instance data blocks are assigned to a function block and contain not only the data of the function block but also the data of any defined many instances. Thus, we should only access an instance data block in connection with its own specific function block.
The PLC originated in the late 1960s in the automotive industry in the US and was designed to replace relay logic systems.[2] Before, control logic for manufacturing was mainly composed of relays, cam timers, drum sequencers, and dedicated closed-loop controllers.[3]
The hard-wired nature of these components made it difficult for design engineers to alter the automation process. Changes would require rewiring and careful updating of the documentation. Troubleshooting was a tedious process.[4] When general-purpose computers became available, they were soon applied to control logic in industrial processes. These early computers were unreliable[5] and required specialist programmers and strict control of working conditions, such as temperature, cleanliness, and power quality.[6]
The PLC provided several advantages over earlier automation systems. It was designed to tolerate the industrial environment better than systems intended for office use, and was more reliable, compact, and required less maintenance than relay systems. It was easily expandable with additional I/O modules. While relay systems required tedious and sometimes complicated hardware changes in case of reconfiguration, a PLC can be reconfigured by loading new or modified code. This allowed for easier iteration over manufacturing process design. With a simple programming language focused on logic and switching operations, it was more user-friendly than computers using general-purpose programming languages. Early PLCs were programmed in ladder logic, which strongly resembled a schematic diagram of relay logic. It also permitted its operation to be monitored.
Ladder diagram (LD)/Ladder logic is a graphical language that resembles electrical relay logic diagrams. It uses two vertical rails and horizontal rungs containing contacts (inputs) and coils (outputs) to represent logic. It is widely used due to its visual nature and ease of understanding for those familiar with electrical schematics.
Function block diagram (FBD) is another graphical language, FBD represents program logic using interconnected blocks, each representing a specific function (e.g., timers, counters, PID controllers). This approach is beneficial for visualizing complex control loops and reusable functions.
Sequential function chart (SFC) is a graphical language is designed for programming sequential control processes. It uses steps, transitions, and actions to define the flow of a program, making it suitable for applications with distinct operational phases.
Structured Text (ST) is a high-level, text-based language similar to Pascal or C. ST is powerful for implementing complex algorithms, mathematical calculations, and data manipulation that might be challenging to express in graphical languages.
Instruction list (IL) is a low-level, text-based language resembling assembly language. It uses mnemonic instructions to perform operations on registers and memory locations. While less commonly used for new programs today, it can be found in older systems and for specific low-level control tasks.
Programs for PLCs are based on 1 of the 5 standard programming languages defined by the IEC 61131-3 standard: Ladder Diagram (LD), Function Block Diagram (FBD), Structured Text (ST), Sequential Function Chart (SFC), and Instruction List (IL). These languages are implemented using manufacturer-specific software like Siemens TIA Portal, Rockwell Studio 5000, and Codesys, and can also be supplemented with higher-level languages like C++ for complex tasks.
Each PLC manufacturer has its own programming software supporting the mentioned standard languages:
Siemens TIA Portal is used for programming Siemens PLCs.
Rockwell Studio 5000 Logix Designer is the software for programming Allen Bradley ControlLogix and CompactLogix PLCs.
Codesys is a common platform used by various manufacturers to develop PLC programs.
In more advanced applications, C++ can be used in conjunction with standard PLC languages to perform complex tasks like data logging for predictive maintenance, with the help of an IDE like Eclipse.
[1] Wikipedia
[3] All About PLC's
[4] Ladder Logic (LAD) for S7-300 and S7-400 Programming - Cache Industry Siemens (PDF)
[4.1] saved file (Discord)
[5] Ladder Logic (LAD) for S7-300 and S7-400 Programming - Brescianet (PDF), this file appears to be different version of the Cache Industry Siemens', althought similar
[5.1] saved file (Discord)
[6] Programable Logic Controller Basics Explained - automation - The Engineering Mindset (Youtube)
[7] ACC automation