What is the function of PLC interrupt?

Publisher:SereneSerenityLatest update time:2023-02-06 Source: elecfansKeywords:plc Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

PLC understands the interrupt function in this way. When understanding the interrupt, we must first understand the PLC operation cycle or scan cycle. It is necessary to talk about the process of PLC sequential control cycle execution. This is the premise for understanding the interrupt and must be mastered. It is divided into three parts: input processing, program processing, and output processing.


1. Input processing: Before executing a program, the programmable controller reads the ON/OFF status of all input terminals of the programmable controller into the input image area. Even if the input changes during program execution, the content of the input image area will not change. The change is read when executing the input processing of the next cycle.

2. Program processing, PLC reads the ON/OFF status of each soft element from the input image area and the image area of ​​other soft elements according to the instruction content in the program memory, and then starts the calculation from step 0 in sequence, and writes the results obtained each time into the image area. Therefore, the image area of ​​each soft element gradually changes its content as the program is executed. In addition, the internal contacts of the output relay perform actions according to the content of the output image area.

3. Output processing: After all instructions are executed, the ON/OFF status in the output Y image area will be transmitted to the output latch memory, which will serve as the actual output of the programmable controller.

The time required to execute an action is the operation cycle, also called scan time. So what is the connection between interrupts and scan cycles? Interrupts are not executed in a complete order from top to bottom. Instead, the interrupt program takes priority and runs the program processing alone and outputs immediately without participating in the entire cycle operation.


What is the role of interrupt? We know that the scan cycle of PLC is very short, so it is difficult for us to see the sequential control execution process of PLC. Here we may as well assume that the scan cycle is 10s, that is, it takes 10s to execute the entire program. There is a very simple program LD X0, OUT Y0. According to the above figure, when X0 is ON, Y0 does not output immediately, but waits until 10s before outputting. After disconnecting X0, Y0 is also not closed immediately. Both need to be scanned before there is a result. In this way, in our actual application, PLC is useless and the device cannot work. At this time, interrupt processing is required. Use the input interrupt function to execute the input immediately. In fact, the operation time of PLC is very short, only a few milliseconds, which can fully meet the needs, but some things such as high-frequency pulse input and pulse capture, which are in microseconds, will definitely be affected by periodic operations.


Therefore, if you need to complete many ON/OFF state processing in one cycle, you must use the interrupt function. In general, we rarely use interrupts. Even if we need them, the high-speed instructions of the PLC have interrupt functions, so there is no need to write interrupt subroutines. For example, the high-speed counter uses interrupts to process the high-speed pulses from a specific input relay, so it can count regardless of the operation time. The counting result is either output immediately using a comparison instruction dedicated to the high-speed counter, or the high-speed counter interrupt method is used to execute specific program processing on the count value of the high-speed counter.


High-speed counters are not used to count high-frequency pulses. We use the interrupt function to count high-speed inputs. The example is as follows: from EI to FEND is the main program, from pointer I101 (interrupt pointer of input X0) to IRET is the interrupt subroutine. Whenever the rising edge of X1 is sensed, the subroutine is executed to transfer the value to D10 immediately, thus avoiding the influence of the PLC operation cycle.


Keywords:plc Reference address:What is the function of PLC interrupt?

Previous article:Initialization of SEW-movifit inverter
Next article:How to easily solve the problem of inverter interference

Recommended ReadingLatest update time:2024-11-16 10:38

Several solutions in the debugging process of PLC control system
In the actual debugging process, sometimes such a situation occurs that a software system can fully meet the technological requirements of mechanical equipment in theory, but it cannot be put into normal operation during operation. In the system debugging process, in addition to considering the software design metho
[Embedded]
Logical errors in PLC programming
When programming PLC programs, no matter you are a novice or an experienced programmer, you will make the following low-level mistakes. Because this error is non-grammatical, the error cannot be detected by programming software. Once this error occurs, it is sometimes difficult to find it yourself. It is not until t
[Embedded]
Logical errors in PLC programming
12 Tips on PLC Programming
Programming suggestions 1. When PLC and host computer (or touch screen) form a monitoring system, there are often control modes such as "manual" and "automatic" on the screen (generally, only one can be selected when there are multiple). You can use the "MOV" instruction in the program. For example, when "manua
[Embedded]
Automatic screw locking machine data acquisition system solution
Programmable logic controllers (PLCs) control various types of equipment through input and output signals, and can execute user-oriented instructions such as logical operations, sequential control, timing, counting and arithmetic operations, so that multiple devices can be connected together for centralized control
[Embedded]
Automatic screw locking machine data acquisition system solution
How to convert PLC ladder diagram and circuit diagram
PLC ladder diagram language is a graphical programming language used to program programmable logic controllers (PLCs). It is similar to a circuit diagram, in which different graphic symbols are used to represent different logic elements, such as contacts, coils, counters, timers, etc. Logic elements can be connected
[Embedded]
8 Common Types of PLC Errors
PLCs of all brands have a self-diagnosis function, but the trick to PLC repair is to make full use of this function to analyze and then accurately find the problem. We have sorted out 8 common error types that PLC repair personnel need to know when the PLC presents an abnormal alarm. 1. CPU abnormality
[Embedded]
8 Common Types of PLC Errors
Illustrated explanation of PLC and inverter communication wiring, quickly learn to use PLC to control inverter!
PLC and frequency converter have a relationship of inclusion and being included. Both PLC and frequency converter can complete some specific instructions to control motors. PLC is a program input execution hardware, and frequency converter is one of them. However, the PLC covers a wider range than the fre
[Embedded]
Illustrated explanation of PLC and inverter communication wiring, quickly learn to use PLC to control inverter!
PLC automatic program programming method
The function of PLC automatic sequence is to control the equipment to work according to the pre-designed process flow. There are also several methods for writing the process of PLC automatic program. Let's make a detailed explanation below. The first method: the reset method of the auxiliary relay
[Embedded]
PLC automatic program programming method
Latest Embedded Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号