From OpenSCADAWiki
Revision as of 12:40, 21 March 2024 by FuzzyBot (Talk | contribs) (Importing a new version from external source)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
}