Same question asked two times ?
I'd agree with Ialit, your best solutions are in your other thread at: How to calculate Pump running hours from the status of pump start & stop bit status which is being fetched from OPC server.
You could run a totalizer on top of other calculated values to give a running total, but it's a bit overkill.
Please avoid to post the same / similar question twice, instead if you want to "revive" your question, you just need to update it, and add a new reply to your original post.
Hope this helps
ps: no worries here, this is for next time.
Have a nice day