HomeWindLDR

Discussion for our PLC programming software.

Single button on / off Messages in this topic - RSS

Steve McLaughlin
Steve McLaughlin
Posts: 17

2/10/2019
I have a simple spring push button input (say I003) that I want to first turn on a lamp, and then on the next push, turn off a lamp. How do I set up ladder logic to use a single button to alternatively turn something of and off? I am using a memory bit and SOTU to set and reset with no luck.
0 link
DaDaDadeo
DaDaDadeo
Posts: 73

2/10/2019
Add another bit and label it “toggle”

The simplified Logic below includes the function type and the address. Each line is a rung. Place the rungs in the same sequence.

—[A I003]—SOTU—[ B Toggle]—(S Q0)

—[A I003]—SOTU—[ A Toggle]—(R Q0)

—[A Q0]————————(Out Toggle)


Technically there only needs to be one rung with the input and SOTU one shot function with the toggle conditions, set, and reset in parallel. Both ways should work.

The toggle and output bit locations can be swapped and it should still perform the same way.

It’s not that easy to write logic in text form with a phone and vertical lines are difficult to illustrate.

-
edited by DaDaDadeo on 2/10/2019
0 link
Steve McLaughlin
Steve McLaughlin
Posts: 17

2/11/2019
Thank you very much. This works! I implemented it with internal bit instead of output, because I only wanted to turn on a lamp in the HMI. I also devised a way using a counter: Counter counts to 2. Compare if counter is 2, then set bit tied to counter reset line. Move counter into lamp display bit. (You can move word into bit.) Counter value is either 0 or 1, in sequence.

I know this has all been done before, but I am new. Now I have good examples. Your code was easy to follow, thanks for taking the time!!
0 link
Phillip
Phillip
Posts: 20

2/16/2019
in data conversion there is an ALT command. It changes the output from on to off or from off to on with one push button
0 link




Powered by Jitbit Forum 8.2.0.0 © 2006-2013 Jitbit Software