The Birth and Working Principles of PLC: Basics

Today, in this article, we will discuss some fundamental aspects of PLC. Fundamentals are indeed crucial. For those who are just starting out or are interested in entering the field, this article will provide a comprehensive overview of PLC. For those who are already familiar, it will serve as a refresher on the working principles of PLC, allowing you to revisit and enhance your existing knowledge with your experience.






In our previous articles, we often mentioned the term "PLC." So, what does "PLC" stand for? PLC stands for "Programmable Logic Controller"" Before the advent of PLC, industrial automation control relied heavily on numerous intermediate relays, time relays, counters, and other components. The extensive use of these components resulted in bulky control cabinets, intricate wiring, complexity, and susceptibility to errors.



On January 1, 1968, a man named Dick Morley, on the first day of the new year, drafted a memorandum that eventually led to the invention of the PLC. The memorandum was written as follows: "This thing (which hadn't been named yet) should have the following characteristics: no process interruptions; direct mapping into memory; no software handling of repetitive tasks; slow operation (Morley later realized this characteristic was a mistake); designed robustly to actually work; and have its own programming language (a ladder logic diagram emerged a few months later)."

Dick Morley showed this memorandum to a team in Bedford, including Mike Greenberg, Jonas Landau, and Tom Bovaisewan. They continued to design this device together and gave it the codename "084." The goal of "084" was to be modular, robust, and capable of continuous operation. Dick Morley's team completed the design and built 084, which served as the precursor to what we now know as the "Programmable Logic Controller."



The emergence of PLC revolutionized the landscape of industrial automation. It replaced a plethora of components in relay control systems with software programming. Designers only need to consider the system's inputs and outputs, while the intermediate logic operations are implemented by software. This simplifies the design, installation, and wiring of control cabinets, thereby advancing industrial automation.

Today's PLC functionalities extend beyond logic operations to include analog data acquisition, motion control, communication, and self-diagnosis. PLCs exhibit high reliability, capable of functioning normally in harsh environments, reducing downtime, lowering the workload of maintenance personnel, and enhancing production efficiency.

The myriad advantages of PLCs make them indispensable in modern industrial control. Industrial automation manufacturers worldwide introduce their own PLC products, aiming to carve out their niche in this field.

Major PLC manufacturers worldwide include Siemens from Germany, Rockwell from the United States, Schneider from France, Mitsubishi, and Omron from Japan.

While PLCs from different companies share similar working principles, here we'll elucidate the working process (principle) of Siemens' SIMATIC PLC products as an example:

Inside the CPU of a PLC are two types of programs: the operating system and user programs. The operating system, written by the PLC manufacturer and embedded in the CPU chip, cannot be modified by users but can be updated through firmware upgrades. It manages the PLC's storage resources, calls user programs, refreshes input/output memory areas, detects interrupts, executes interrupt handling functions, detects and handles errors, and performs hot restarts of the PLC. User programs, which fulfill the project's actual requirements, are written by programmers and downloaded into the CPU for execution. Various functions within user programs rely on support from the operating system.

The CPU operates in two modes: RUN mode and STOP mode.

In STOP mode, the CPU does not execute user programs or refresh input/output process image areas but handles communication requests, executes diagnostic functions, and allows program downloads. For safety reasons, there are two options for output module values: maintaining the last value or using a substitute value. These options can be modified through hardware configuration, as shown in the diagram below:



In general, when the CPU stops, we prefer the output module values to be 0. In this case, you can select "Substitute a value" under "Reaction to CPU STOP" and ensure that "Apply substitute value 1" is not checked. However, if you indeed need to activate a specific output channel when the CPU stops, then you should check "Apply substitute value 1," as shown in the diagram below:




In the RUN mode, the CPU operates in a cyclic scanning manner, following these steps:

  1. Writes the values from the output process image area to the physical addresses of the peripherals.
  2. Reads the input values from the peripherals into the input process image area.
  3. Executes the main program organization block (OB1).
  4. Handles communication requests and performs self-diagnosis.
  5. Handles interrupts if any event occurs.

The time taken by the PLC to complete one cycle of scanning is known as the scan cycle. During each scan cycle, the values of peripherals (inputs/outputs) are updated only once, ensuring that the PLC's execution of programs remains unaffected by changes in external signals.

In summary, this article introduced the birth of PLCs and their internal programs (operating system and user programs), explaining the two operating modes (RUN and STOP) and how PLCs operate in these modes.

For further reading on CPU expansion, you may refer to the article "Understanding CPU in S7-1200 Hardware."