Jump to content

Single Push Button On/Off


Antal

Recommended Posts

Not sure why you need the timer(s), but if you don't need the delay, you could use the Toggle Coil instruction, triggered by a rising edge on your push-button input.

If you do need the delay, then just use one timer and trigger the Toggle Coil instruction on the rising edge of the timer.out bit....makes for less rungs and easier to follow logic.

  • Like 1
Link to comment
Share on other sites

  • MVP 2023

I don't understand what "M0", "M1", "Output", or the timer are for, but a single pushbutton on/off requires NO ladder logic at all. The button itself (unless it's a physical pushbutton connected to a digital input instead of an on-screen button) can be programmed to toggle an output, and other things, without any ladder logic.

If it is a physical button, be aware that there is a Toggle Coil available to simplify things.

Link to comment
Share on other sites

  • MVP 2023

One piece of advice: DO NOT place multiple separate logic threads in a single ladder rung. Move that second line in rung 10 to the next rung. The whole point of ladder rungs in ladder logic is to separate logic threads for the compiler.

By the way, what's the purpose of adding and subtracting 5?

Link to comment
Share on other sites

  • 2 weeks later...
  • MVP 2023
7 hours ago, Antal said:

How many items can be maximum in one Rung? Input conditions.

image.thumb.png.cac5288af1f4202cc0822d2ab8791706.png

I don't know the answer to this question, but I guarantee it is WAY more than you have in this example. I wouldn't worry about it. I'm sure it would give you a compile error if you exceed the limit, and even if you did, it is very simple to break things up to get under the limit.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...