Jump to content

Recommended Posts

Posted
I have a program with a counter in it. Sometimes, I might have to count two different events that can both go high on the same scan. When this happens, the counter only increases by one, not two. I band-aided this by adding a 5 millisecond delay timer to the second event. I am not particularly fond of coding like this. Is there a way to delay the second event going by exactly one scan so that it properly advances the counter? For what it's worth, using P3K. As always, thanks for any help.

Posted (edited)
Use your second event as a NOT then drive a PLS. Use the PLS contact to drive your counter. EDIT: Depending upon your second event timing this may not be what you want. Have your second event drive a PLS 'A' then use PLS 'A' NOT drive PLS 'B'. Use PLS 'B' to drive your counter. Edited by IO_Rack
Posted
In case it is helpful, the PLS I'm referring to is a Pulse or 'On for One Scan' instruction used in most AD PLCs. If you can make this happen with the P3K then consider this...
Posted
What I'm going to do (I think this suggestion has actually been implied) is ditch the counter and the baggage associated with it and just use integer math to index my sequencer.

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
×
×
  • Create New...