Delta ISPSoft — 5.6.2 Example of an Interrupt Subroutine in a DVP Series PLC

Chapter 5 POU and Task 5.6.2 Example of an Interrupt Subroutine in a DVP Series PLC  Example If the ON button is pressed (X0 is turned ON), Y0~Y7 will scanned in order. If the OFF button is pressed (X1 is turned ON), the output will stop, and the present output state will be retained. If the RST button is pressed (X2 is turned ON), the output will be reset, and Y0~Y7 will be scanned again.  Planning a program The model used in this example is a DVP-SV PLC, and four POUs are created. The functions of the POUs are described below. *. Please refer to DVP-PLC Application Manual ─ Programming for more information about the interrupts in a DVP-SV series PLC and the related applied instructions.

5-43 POU name Function Run Stop _ 1. Reset the operation flag M0, transfer the value 1 to the output data register D0, and enable the interrupt. 2. When X0 is turned from OFF to ON, the operation flag M0 is set to ON. 3. When X1 is turned from OFF to ON, the operation flag M0 is set to OFF. LED The states of Y0~Y7 are updated according to the value in the output data register D0. Shift The values of the bits in the output data register D0 is shifted by one bit to the left every 0.5 seconds. If the value in D0 is larger than 128, the value 1 will be transferred to D0. Reset Transfer the value 1 to the output data register D0, that is, set bit 0 in D0 to ON.

The POU will be executed after the external interrupt I201 is triggered. (I201 is triggered when the signal passing through X2 goes from low to high.)