PLC Basic Architecture?
he basic architecture of a PLC (Programmable Logic Controller) consists of: Central Processing Unit (CPU): performs logical operations and controls system operations. Input/Output (I/O) interface: connects sensors, actuators, and other devices to the CPU. Memory: stores the program and data. Power supply: provides power to the PLC and connected devices. Communication ports: allow the PLC to communicate with other devices and systems. Programming software: used to create and upload the program to the PLC.
PLC Basic Architecture?
PLC stands for Programmable Logic Controller, which is an industrial digital computer that is used to automate industrial processes and control industrial machinery and equipment. The working of a PLC involves three main steps:
The PLC scans its input modules to determine the state of the inputs, such as switch positions, sensors, and other signals. The input data is then stored in the PLC's memory. The Execution of the Program in a PLC system refers to the process where the CPU interprets and executes the instructions stored in the program memory. The program is a set of instructions written in a high-level programming language that define the logic and control operations of the PLC.
During the execution of the program, the CPU reads the inputs, performs logical operations based on the program, and updates the outputs. The program is executed in a continuous loop, with each cycle referred to as a scan. The speed of the program execution is determined by the scan time, which is the time it takes for the CPU to complete one scan.
The program is executed in the following steps:
- Read inputs: The CPU reads the values of the inputs from the I/O modules.
- Execute program: The CPU interprets and executes the instructions in the program, using the input values and data stored in memory.
- Update outputs: The CPU updates the values of the outputs based on the results of the executed program.
- Repeat: The process repeats continuously, with the CPU constantly reading inputs, executing the program, and updating outputs.
The Input Scan is a process in a PLC system where the CPU reads the values of the inputs from the I/O modules. The input scan is performed continuously and at a regular interval determined by the PLC's scan time. The input values are stored in the data memory and are used by the CPU to make decisions and execute the program. During the input scan, the CPU reads the values of all the inputs, processes the data, and then updates the outputs. The input scan is a critical component of the PLC's operation and determines the speed at which the PLC can respond to changes in the inputs. The faster the input scan, the quicker the PLC can respond to changes in the inputs.
Execution of Program: The PLC runs the stored program, which is typically written in ladder logic or a similar programming language. The program uses the input data to perform logical operations, make decisions, and control outputs. Output Scan: The PLC scans its output modules to update the state of the outputs based on the results of the program execution. The outputs may control actuators, drives, relays, and other devices.
The architecture of a PLC includes the following components
Processor: The central processing unit (CPU) that executes the stored program and performs logical operations. The Processor (or Central Processing Unit, CPU) in a PLC system is the main component that controls the operation of the PLC. It is responsible for:
- Reading inputs from I/O modules
- Executing the program stored in memory
- Updating outputs to I/O modules
- Monitoring and controlling internal functions such as memory management and communication
The CPU typically contains a microprocessor and associated hardware to perform these tasks. It communicates with other components of the PLC, such as memory and I/O modules, through a bus system. The type and speed of the CPU depends on the requirements of the specific PLC application.
Memory: The storage area for the program and data, including input and output data, program instructions, and user-defined data. Memory in a PLC system stores the program (instructions) and data used by the CPU. There are two main types of memory in a PLC:
Stores the program that the CPU uses to control the operation of the PLC. The program is typically written in a high-level programming language and is then compiled and downloaded into the program memory. Data Memory: Stores variables, flags, counters, and other data used by the program. Data memory is also used to store the input and output status of the I/O modules.
Ladder logic is a graphical programming language used in programmable logic controllers (PLCs) to create automation programs. It is based on the electrical ladder diagrams used in control panels and mimics the way relays and contacts work. In ladder logic, program instructions are represented as symbols and logic statements are arranged in a ladder-like diagram, hence the name "ladder logic." The symbols represent input and output devices, timers, and other functions. The rungs of the ladder diagram represent the logical connections between the symbols. Ladder logic is commonly used in industrial control systems, such as those in manufacturing, water treatment, and power plants. Its popularity is due to its simplicity, readability, and versatility.
A function block is a self-contained block of code in a programmable logic controller (PLC) that performs a specific task. It encapsulates a set of instructions and data, and can be reused multiple times in a program, reducing the need for repetitive code. Function blocks are a key feature of many PLC programming languages and allow for a more structured and modular approach to programming. They can be used to perform tasks such as mathematical operations, data storage and retrieval, and control functions.
Function blocks are usually created and defined by the programmer, and can be executed by calling them from other parts of the program. They can also be used as building blocks to create larger and more complex control systems. Using function blocks enhances the readability, maintainability, and reusability of PLC programs, making them a valuable tool for PLC programmers.
Structured text (ST) is a high-level programming language used in programmable logic controllers (PLCs) to write automation programs. It is similar to the syntax of structured programming languages like Pascal or C, and provides a text-based approach to programming, compared to graphical programming languages like ladder logic. Structured text is a powerful tool for PLC programming and allows for more complex and sophisticated control strategies. It provides features like conditional statements, loops, and user-defined functions, allowing the creation of more advanced programs.
ST is widely used in the industry, particularly in applications requiring complex mathematical calculations, real-time data processing, and communication with other systems. Its popularity is due to its versatility, readability, and ability to handle complex control logic.
Software refers to a set of instructions and data that tells a computer or other electronic device what to do and how to perform certain tasks. It is an essential component of most electronic devices, including computers, smartphones, and programmable logic controllers (PLCs).
There are various types of software, including:
- System software: includes the operating system, device drivers, and other software that support the basic functions of a device.
- Application software: includes programs that perform specific tasks, such as word processing, graphic design, and video editing.
- Programming software: used by developers to write, test, and debug software programs.
- Firmware: a type of software that is built into a device, providing basic functionality and enabling it to perform specific tasks.
- Software plays a critical role in the functionality and efficiency of electronic devices, and its selection and implementation can have a significant impact on their performance.
Examples of memory types in a PLC include:
- RAM (Random Access Memory): Volatile memory that is used to store data and program during the execution of the program.
- ROM (Read-Only Memory): Non-volatile memory that is used to store the program and is not lost when the power is turned off.
- EEPROM (Electrically Erasable Programmable Read-Only Memory): Non-volatile memory that can be reprogrammed and is used to store data and parameters that need to persist even if the power is turned off.
Input/Output (I/O) Modules:
The interface between the PLC and the input and output devices, such as sensors, switches, actuators, and other devices. I/O (Input/Output) modules in a PLC system provide interface between the CPU and the field devices such as sensors and actuators. They are responsible for reading signals from input devices, converting them to digital signals that can be processed by the CPU, and for converting digital signals from the CPU into signals that can be sent to output devices. Examples of I/O modules are:
- Digital Input Modules
- Digital Output Modules
- Analog Input Modules
- Analog Output Modules
The specific type of I/O module used depends on the type of signals to be processed (digital or analog) and the number of inputs and outputs required for the application.
The source of power for the PLC and its associated components. A power supply provides electrical power to the components of a PLC system. It converts AC power from a wall outlet to DC power required by the PLC components. An example of a PLC power supply is a switching power supply that uses a transformer to step down the AC voltage and then rectifies and filters it to produce a stable DC voltage.
The connection between the PLC and other devices, such as computers, HMI (Human Machine Interface), and other PLCs. A Communication Interface in a PLC system allows the PLC to exchange data with other devices such as HMIs (Human Machine Interfaces), SCADA (Supervisory Control and Data Acquisition) systems, and other PLCs. Examples of communication interfaces are:
- Fieldbus (e.g. Profibus, CANbus)
- Wireless (e.g. Wi-Fi, Bluetooth)
Each communication interface has different specifications such as data transfer rate, cable length, number of devices supported, and type of data that can be transferred. The choice of communication interface depends on the requirements of the specific PLC application. PLCs are widely used in industrial automation and control applications, including process control, machine control, and building automation. They offer high reliability, flexibility, and easy programmability, making them a preferred choice for automation tasks.
What's Your Reaction?