Sign in to follow this  
Followers 0
Kristian

CPM2A - Counter RESET

6 posts in this topic

Hi I am trying to build a sequential program for a cable cutting machine. After calculating the number of revs needed, the output of the encoder goes into a counter which counts the number of pulses, it then allows a clamp and a cutter cylinder to set and also counts the wire quantity. My problem is that the counters are already satisfied once I start the program, and so nothing happens, the process is not triggered. Anyone can help? Thanks, Program is attached CCM.cxp

Share this post


Link to post
Share on other sites
You could try differentiating your limit switch and encoder inputs this would stop the counters counting every cycle that the switch is made See example CCM__2_.cxp

Share this post


Link to post
Share on other sites
Hello Kristian, What value is displayed for "PulsesNeded" (address 224) in the Counter itself? Be aware, in Section "Starting" rung 5, the addition will treat the result as a UDINT_BCD. This will mean that if the result is (e.g.) 123456, 'Pulses needed' may actually contain a negative value. Benbrad, the counter only decrements once on a false to true transition, so differentiating the contact shouldn't make any difference.

Share this post


Link to post
Share on other sites
Hello Kristian, Think I can see where your problem lay... Before 'PulsesNeeded' can aquire a value, i.e. If 'LengthNeeded' is 0, the Counter will already see it at a value of 0, and will set itself ON. The set value for CNT001 will also always be 0 ('WireQuantity' is not used elsewhere in the program!), therefore the NC CNT001 contact is then permanently open, and will never allow Counter 0 to reset. Hope this helps

Share this post


Link to post
Share on other sites
Aye, you're right anonymous........ what can I say, it was early and I was decrementing a word in my own code. Confusion reigned

Share this post


Link to post
Share on other sites
Hello benbrad, Early working... Never a good idea

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0