Programming a Momentary Pushbutton?

Hampton

Member
Join Date
Apr 2008
Location
Oregon
Posts
1
What is a "clean" way to program a momentary pushbutton so that when pushed the first time it will turn on and hold an output and when pushed again it releases the output?
Thanks for the help.
 
Search the forum for flip flop and toggle. There are hundreds of threads covering how to do this, from generic applications to PLC specific applications.
 
Also look under latched inputs with the unlatch instruction in RS logix.
CX-programmer uses Set and reset. Other softwares will have something similar. You may also want to bebounce your switch with a 100 msec timer
 
Hampton said:
What is a "clean" way to program a momentary pushbutton so that when pushed the first time it will turn on and hold an output and when pushed again it releases the output?
Thanks for the help.

Easy if you use Mitsubishi:

---|M0|--------------(ALT Y0)---

Cant get cleaner than that !!
 
simple way

Button.........bit 1...........bit 1
-[ ]-----------[/]-------------( )--
................................|
................................|
Button.........bit 1........|
-[/]-----------[ ]-------

{next rung}

Button.............Button
-[ ]-----------------(R)-


bit 1 - is the bit you use for the operation
button - is the push button (I/O or HMI)

Very simple and effctive
 
Last edited:
How about this?


flip-flop.jpg
 
That would work fine. I doesn't need to be a falling one-shot, I would make it a rising one so the output will turn on when you push the button, not when you release it.
The osr works like an anti-tie down. You must release the button to get it to one-shot again.
 
Dirt's example may not work without a slight modification. When the output is Set in the first branch, will the 2nd branch evaluate true? I am not familiar with the PLC he is using to know for sure, but in an AB processor it will, and will Reset again.

In A/B processors, I use the same basic logic he posted with one shot rising and the addition of a memory bit:


pb b3/99 O:0/0 O:0/0 |
-[ ]-------[osr]-----+-[/]--------+------(otl)-+
| | |
| | b3/98 |
| +------( )---+
| |
|b3/98 O:0/0 O:0/0 |
+-[/]------[ ]------(otu)-+




Is is not as clean as the XOR method but easy to understand...
 
Last edited:
@Smoke: Depends on what function you want, rising or falling. What is the flip-flop there for? :)


@OkiePc: Totally right, wouldn't work in ab, I thought about siemens (currently working on now, that's why).
 

Similar Topics

Dear all, I have fx2n plc on my hand but I don't have the programming cable sc-09 and it would not be easy for me to get one. I need the cable...
Replies
3
Views
92
Hi all, i am the new controls guy at the plant and i have inherited a pc from the previous controls guy with Siemens tia portal version 16 and 17...
Replies
20
Views
866
I need to pull the program off of an old 90-30 so I can convert it to Allen Bradley. This is my first time messing with GE and I don't have the...
Replies
2
Views
84
New to vfds. I put in parameters. IP, but I get ethernet flashing and link solid. What did I do wrong?
Replies
9
Views
467
I'm been deciphering a program for a press here. I've gotten most of it deciphered using the manual to understand the instructions (first mitsu...
Replies
11
Views
280
Back
Top Bottom