From OpenSCADAWiki
Jump to: navigation, search

The first method consists in decrement of the counter, set in the time interval value, in each cycle, and at the periodicity of the cycle to the value of <= 0, for example, in OpenSCADA this is implemented as follows:

if((tm_cnt-=1/f_frq) <= 0)  //Decrement
    tm_cnt = 10; //Setting the counter to 10 seconds
    //Perform other actions with the 10 seconds period