PLC Basics: Introduction and Working Principles

 





In today's article, we'll discuss some fundamental aspects of PLCs. Fundamentals are, in fact, crucial knowledge. For those who are just starting or looking to enter the field, this article will provide a comprehensive understanding of PLCs. For those already familiar with PLCs, it will serve as a refresher on the working principles, allowing you to combine this knowledge with your existing experience for continuous learning.

In our previous articles, we frequently mentioned the term "PLC." So, what does "PLC" stand for? PLC is the abbreviation for "Programmable Logic Controller" in English. In the era before the advent of PLCs, industrial automation control relied heavily on numerous components such as intermediate relays, time relays, counters, and more. The extensive use of these components resulted in bulky control cabinets, intricate wiring, and a higher risk of errors.






On January 1, 1968, a man named Dick Morley drafted a memorandum on the first day of the new year, leading to the invention of PLC later. The memorandum stated: "This thing (not yet named at the time) should have the following characteristics: no process interruptions; direct mapping into memory; no software processing of repetitive transactions; slow operation speed (Morley later realized that this characteristic was a mistake); robust design for genuine functionality; and its own programming language (the ladder logic emerged a few months later)."

Dick Morley showed this memorandum to Bedford's team, including Mike Greenberg, Jonas Landau, and Tom Boissevain. Together, they continued to design the device and gave it the code name "084." The goal of "084" was to create a modular, robust, and continuously operable device. The team led by Dick Morley completed the design and construction of 084, which is the precursor to today's "Programmable Logic Controller" (PLC). The image below shows the world's first PLC and its design team:



PLC's advent revolutionized the landscape of industrial automation. It replaced numerous components in relay control systems with software programming, where design engineers only need to consider system inputs and outputs. The intermediate logic operations are implemented by software, simplifying the design, installation, and wiring of control cabinets, thereby propelling advancements in industrial automation.

The functionalities of today's PLCs go beyond logic operations, encompassing features such as analog signal acquisition, motion control, communication, and self-diagnosis. PLCs exhibit high reliability, enabling them to function normally in harsh field environments. This reduces downtime, decreases the workload of maintenance personnel, and enhances production efficiency.

The various advantages of PLCs make them an indispensable component in modern industrial control. Automation manufacturers worldwide introduce their own PLC products, aiming to establish a prominent presence in this field.

Major PLC manufacturers globally include Siemens from Germany, Rockwell from the United States, Schneider from France, Mitsubishi, and Omron from Japan. While there are domestic manufacturers in our country producing PLCs, their influence is relatively limited. Let's strive for progress.

The working principles of PLCs from different companies are fundamentally similar. Here, we take Siemens SIMATIC PLC products as an example to explain the working process (working principles) of PLCs:

The CPU of a PLC consists of two types of programs: the operating system and the user program. The operating system, written and fixed by the PLC manufacturer inside the CPU chip, cannot be modified but can be updated through firmware upgrades. The operating system manages PLC's storage resources, calls user programs, refreshes input/output memory areas, detects interrupts and invokes interrupt handling functions, checks for errors and processes them, and performs a hot restart of the PLC, among other tasks. The user program meets the actual requirements of the project, written by programmers and downloaded into the CPU for execution. Various functions of the user program require support from the operating system.

The CPU operates in two modes: Run (RUN) mode and Stop (STOP) mode.

In Stop (STOP) mode, the CPU does not execute the user program, does not refresh the input/output process image area, but processes communication requests and executes diagnostic functions. It can also download programs. For safety reasons, regarding the output values of output modules, there are two options: keep the last value or use a substitute value. These two alternatives can be modified through hardware configuration, as shown in the figure below:














Generally, when the CPU is in the stopped state, it is desired that the output module's values are set to 0. In this case, you can choose "Substitute a value" in "Reaction to CPU STOP" and ensure that "Apply substiute value 1" is not selected. If you indeed need to activate a specific output channel when the CPU is stopped, then check "Apply substiute value 1," as shown in the following figure:





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

  1. Write the values from the output process image area to the physical addresses of the peripherals.

  2. Read the input values from the peripherals into the input process image area.

  3. Call the main program organization block (OB1).

  4. Handle communication requests and perform self-diagnosis.

  5. Process interrupts whenever an interrupt event occurs.

The time taken by the PLC to execute one cycle of scanning is known as the scan cycle. Within each scan cycle, the values of peripherals (input/output) are updated only once, ensuring that the PLC is not affected by changes in external signals while executing the program.

In summary, this article introduced the birth of PLC, the internal programs of PLC (operating system and user program), and explained how PLC operates in two modes (RUN and STOP) and what happens in each mode.