-------------------------------------------- CONPROSYS Script sample programs No. 015 -------------------------------------------- Process name: Pulses count and storage (1 minute interval) Date of creation: April 18, 2016 Processing content: Measure increment of counter value at 1 minute interval. [Signals] CNT0 (DI2) - Counter input 1 (the ON state of CNT0 is counted.) [Operation] 1. Every 1 minute read counter value. 2. Calculte the increment of count value from the one of last minute. (overflow is considered) 3. Set the calculated result to TAG00. [Description] The sample program has a time measurement task (TASK8) and a main task (TASK9) and a counter value difference measurement subroutine (SUB9). To use this sample program, restores this sample program to the M2M controller and names the task number and the subroutine number. If the subroutine is renamed to a number that is not SUB9, change the calling number to the new one. TASK8: Set 1 second flag to TAG 90 and 1 minute flag to TAG 91. TASK9: Every minute call subroutine SUB9 and calculate the result. (Set the calculated result of this minute's increment to LTAG99.) * Internal counter value is calculated as unsigned 16-bit data.