REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login

    Solved Pulse Counter with Pulse Duration

    REXYGEN Studio
    3
    5
    387
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MikeyH
      last edited by

      Hi All,

      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.

      Cheers

      Mike

      1 Reply Last reply Reply Quote 0
      • R
        reitinge
        last edited by reitinge

        Hi Mikey,
        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.
        inte.PNG
        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,
        Jan

        1 Reply Last reply Reply Quote 0
        • M
          MikeyH
          last edited by

          Hi Jan,

          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.

          Cheers

          Mike

          R 1 Reply Last reply Reply Quote 0
          • R
            RexPeter @MikeyH
            last edited by

            @MikeyH

            Hi Mike,
            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.
            TotalHours_counter_with_preset.mdl

            Regards,
            Peter

            M 1 Reply Last reply Reply Quote 0
            • M
              MikeyH @RexPeter
              last edited by

              @RexPeter thank you for that, that is actually very useful.

              Cheers

              Mike

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              This is a community forum for REXYGEN users and fans. Detailed information can be found at REXYGEN homepage.

              There is also an outdated REXYGEN community forum.

              Powered by NodeBB.