Chapter 5 POU and Task *. WPLSoft is programming software for Delta PLCs. The programming architecture adopted by WPLSoft is traditional programming architecture. Please refer to WPLSoft User Manual for more information. 5.6.3 Task Management Example If the START button is pressed (X0.0 is turned ON), the system will begin to count. The STOP button must be pressed (X0.1 must be turned ON) within 30 seconds. Otherwise, the alarm will ring (Y0.0 will be turned ON). Hardware configuration In this example, the CPU module AHCPU530-EN, the digital I/O module AH16AP11R-5A, and the four-slot main backplane AHBP04M1-5A are used.
(The hardware configuration here is the same as the hardware configuration in chapter 4.) Planning a program In this example, a timed interrupt is triggered every 25 milliseconds, and time intervals are measured through a program. In the figure below, Timed Interruption (0) is triggered every 25 milliseconds, and the value in the 32-bit register (D1, D0) increases by one whenever Timed Interruption (0) is triggered. As long as the PLC keeps running, Timed Interruption (0) is triggered every 25 milliseconds, and the value in the 32-bit register (D1, D0) increases by one whenever Timed Interruption (0) is triggered.
Users can calculate the time for which the PLC has run by reading the value in (D1, D0). For example, if the value in (D1, D0) is 10, the time for which the PLC has run is 250 milliseconds (10x25 ms). After the START button is pressed, the present value in (D1, D0) will be transferred to (D3, D2), and the value in (D1, D0) will increase. After the present value in (D1, D0) is transferred to (D3, D2), the value in (D3, D2) will remain unchanged. Users can calculate the time which has elapsed since the START button was pressed by subtracting the value in (D3, D2) from the value in (D1, D0). The value gotten is stored in (D5, D4). 5-49