2 . Pr ogr am m i ng Conc e pts2- 4 1Y0X1P2CALLX0Y1P**20P2FENDY1SRET24(subroutineP2) subroutineCall subroutine P**subroutine returnInterrupt pointer I: used with application instruction API 04 EI, API 05 DI, API 03 IRET. There arefour types of interruption pointers. To insert an interruption, users need to combine EI (enableinterruption), DI (disable interruption) and IRET (interruption return) instructions.When the instruction EI is enabled, the PLC will check if there is any interrupt that need to be doneeverytime an instruction is executed. If an interrupt is found, the PLC will stop executing theinstruction and execute the interrupt first. If no interrupt is found, the PLC will keep executing theinstruction. From the explanation, we can conclude that the maximum waiting time for an interruptto be executed is the execution time of an instruction.1. External interrupt When input signal of input terminal X0~X7 is triggered on rising-edge or falling-edge, it willinterrupt current program execution and jump to the designated interrupt subroutine pointerI000/I001(X0), I100/I101(X1), I200/I201(X2), I300/I301(X3), I400/I401(X4), I500/I501(X5),I600/I601(X6), I700/I701(X7). When IRET instruction is executed, program executionreturns to the address before interrupt occurs. When X0 (C243) works with I100/I101 (X1), X0/X1 (C246, C248, C252) works withI400/I401, the value of C243, C246, C248, C252 will be stored in (D1240, D1241) When X2 (C244) works with I300/I301 (X3), X2/X3 (C250, C254) works with I500/I501, thevalue of C244, C250, C254 will be stored in (D1242, D1243).2. Timer interruptPLC automatically interrupts the currently executed program every a fixed period of time(2ms~99ms or 0.5ms~9.9ms) and jumps to the execution of a designated interruptionsubroutine3. Counter interruptThe high-speed counter comparison instruction API 53 DHSCS can designate that when thecomparison reaches the target, the currently executed program will be interrupted and jump tothe designated interruption subrountine executing the interruption pointers I010, I020, I030,I040, I050 ,I060, I070, I080.4. Communication interruptI140:Communication instruction RS (COM1 RS-232) can be designated to send interrupt requestwhen specific charcters are received. Interrupt I140 and specific characters is set to low byte ofD1167.This function can be adopted when the PLC receives data of different length during thecommunication. Set up the specific end word in D1167 and write the interruption subroutineI140. When PLC receives the end word, the program will execute I140.I150:Communication instruction RS (COM2 RS-485) can be designated to send interrupt requestwhen specific charcters are received. Interrupt I150 and specific characters is set to low byte ofD1168.This function can be adopted when the PLC receives data of different length during the