Announcement

Collapse
No announcement yet.

Ladder Logic - Accumulated 'bit on' count over 1 minute

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • Ladder Logic - Accumulated 'bit on' count over 1 minute

    Hi all,

    Hoping someone might be able to help out here and suggest a relatively simple way to achieve this. My programming skills are very fresh sorry, so hopefully I'm doing roughly the right thing here!

    Using CLICK, I'm trying to get a total for the number of times a bit is turned on over a 1 minute period. This is a 'cans per minute' value passing through the production line. I then want to be able to use that accumulated value on the HMI. The part I'm not clear on is how to only capture the final accumulated count value just before the reset (after 1 minute). So far I have this, which might be totally the incorrect way to be doing it!

    Click image for larger version

Name:	Capture.PNG
Views:	106
Size:	19.8 KB
ID:	120788
    So the CTD3 current value is going to continually change as it counts up over the minute since last reset, which isn't really what I want to display on the HMI. I'm wanting to effectively display the total number over the last minute so I can see how fast the line is running if that makes sense.

    It would be great to get an average also over the whole session, but one thing at a time!

    Any help greatly appreciated.

    Cheers
    Attached Files


  • #2
    i have never worked with click but this should work

    add a line below the 1 min timer with a XIC (normal open) contact in front of a move instruction to move the counter value to a holding register and display that holding register

    when the timer counts out it will move the timer value to the holding register and when the scan cycle gets back to the counter it will reset then the timer will reset so the contact on the move instruction line will open and it will not move the counter value again till the timer counts out

    Comment



    • #3
      Follow z28z34man's suggestion but place the rung just BEFORE the counter rung. That way you capture the count just before the counter is reset.
      thePLCguy

      Bernie

      Comment



      • #4
        I like to measure the elapsed time between parts, keep a stack of the last 10 times or how every many is appropriate to the machine run rate, then compute the average parts/hr over that interval. That way, it's reasonably sensitive, but not so much so that the run rate display value jumps abruptly. For the shift average, I'd probably have a total part counter for the shift displayed anyway, so you can easily compute the shift average run rate by dividing by the elapsed time into the current shift. You can do that one continuously without it jumping, or if it's in a task, you can do it once a minute or something to save on unnecessary computation.

        Comment



        • #5
          Thanks for the suggestions folks. Much appreciated. The average over a number of minutes would be good to get a 'session average', but still ideally wanting a 'current' rate as we make slight adjustments when canning (beer this is, so adjustments to source tank pressure primarily and what effect it is having on rate). With regards to the XIC, would I be better off using that method over this one, which I came up with after posting the question? Just not sure if I'm understanding this correctly, and if the CTD3 will be zero'd out before it copies? Basically what I thought might work was: As TD28 = 60 seconds, copy the accumulated count CTD3 value out to DS3. Would this work, or am I better off basing the copy with a XIC as suggested? Cheers

          Click image for larger version

Name:	Capture.PNG
Views:	61
Size:	61.3 KB
ID:	120846

          Comment



          • #6
            I've also moved the Copy up prior to the Counter as suggested by bcarlton thanks.

            I guess just after confirmation that my Copy trigger is logical, or am I better off using the suggested XIC?

            Cheers

            Comment



            • #7
              Your counter reset contact should be normally open instead of normally closed.
              Why worry? If you've done the best you can, worrying won't make it any better

              - Walt Disney

              Comment



              • #8
                Originally posted by Todd Dice View Post
                Your counter reset contact should be normally open instead of normally closed.
                Ah yes! Thanks.

                Comment

                Working...
                X