If you even wanted to keep track counts such as number of occurrences, run hours; you will require the use to an accumulator logic. The basic anatomy of this logic is that if an event occurs, it simply increase/decrease a count. There are basically two types of counters/accumulator; Up Counter and Down Counter. I will explain an up counter logic, and reversing it to a down counter is simply.
A sample logic in ABB Harmony (using Engineering Workplace) on how to write an accumulator logic to calculate pump/compressor/turbine run hours. It also has a reset capabilities (resetting the counter to zero).
Basically, when a “1” is see by the “ETIMER” it keep counts the time in hours, and feeds the hours into the “AO/L” function block. For resetting the engine run hours accumulator, we do not want operator to reset the counter, there for the reset function is only accessible via the DCS engineer through the “ON/OFF” function block. If you want the plant operator to reset the accumulator/counter, use the “DO/L” function block and link it to the graphics.