Div_by_zero

how do you write your push-push logic?

8 posts in this topic

Lots of ways to do push-push in PLCs that don't have "toggle" functions. The slickest way I've found is to use an XOR (first image below, shown in an A/B 830), but if that's not available and my only option is "brute force", this is what I've been doing (second image). It requires 4 bits and 3 rungs. Feels like a lot of work and I wonder if there's anything more efficient out there? (in the example, C25 is the key and C27 is the toggled coil) Edited by Div_by_zero

Share this post


Link to post
Share on other sites
It depends on whether your PLC supports edge detection. If it does then it's just one simple rung.

Share this post


Link to post
Share on other sites
That is pretty slick, but the PLC I'm using (Koyo Click) does not support the N/C rising edge that appears to be your latch break. It does support rising and falling edges though. Edited by Div_by_zero

Share this post


Link to post
Share on other sites
Excuse my ignorance, but wouldn't the fact that 25.01 is high for one scan effectively block the latch when going from 120.00 low to 120.00 high? I have zero doubt that this works, but I'm trying to understand how it doesn't self-annihilate...

Share this post


Link to post
Share on other sites
Yes, 25.01 is only true for one scan so the logic for 120.00 makes the on/off decision during that scan. The logic is processed before the coil so the fact that the coil changes state doesn't effect it until the following scan. At that point 25.01 is already off so it retains the state.

Share this post


Link to post
Share on other sites
Ah, this makes perfect sense. I wasn't thinking about how on a latched coil, the "latch" isn't hot until the "second" scan, at which point it (usually) takes over holding the coil.

Share this post


Link to post
Share on other sites
now use this to write toggle for more than 2-3 flags. how about 256 or more...

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