SOLVED Pulse Counter with Pulse Duration
I'm struggling to think of a way to combine a pulse count with a pulse duration.
I need to log/count the total amount of times a door is opened, I'm using a reed switch as the input/trigger for this, circuit open when door is open. The COUNT block would work fine for this I think. But what I'd also like to do though is count the duration of each door opening. So basically counting a pulse and it's duration. Then logging the duration against each door open count.
Any help would be appreciated.
you can use the INTE block (documentation here: https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/INTE.html#x81-800005 ). The basic principle is on the attached picture.
If you set value of the running period of your task into CNR1 (this is 0.5 sec for me), the output y of the INTE block will be computing duration of "open door" time. You can easily reset this value by logic ON value on input R1.
Hope this will be helpful,
Thank you very much for the help. I will let you know how I get on. I think with what I need to do I'll create a sub system so will share it once I'm done in case it's useful to anyone.
I'm using the Total Hours counter with formatting to number of digits, and preset to a specific counter value.
Please find attached the subsystem used.
@RexPeter thank you for that, that is actually very useful.