Single pushbutton latching / unlatching (slc5/05)

amueller

Member
Join Date
Jan 2005
Posts
15
Hello,

I have a SLC5/05 and am having problems writing code for a pushbutton (momentary) to start and stop a process.

The problem is this... Due to a fast scan time, the pushbutton can be energized through the scan several times. Even when putting in a single debounce timer, I cannot figure out how to get it to work correctly because it always comes back around and either keeps the process latched or unlatched, depending on the last rung of logic.

I have a bit that latches (1) and the process will start. When that bit unlatches (0), the process ends.

The pushbutton should both latch and unlatch (start and stop) the process.


This has got to be a simple thing. Anyone out there know a quick answer?
 
Sorry... I think I figured something out based upon information on the site. I didn't search good enough the first time.

I will do the following:


PB
----| |--------------------------------------|CTU -------|----
| C5:0 |
| Preset: 2 |
| Acc: 0 |
----------------

Latch Process
----|EQU ------|----------------------------------(L)--------
| C5.0.ACC |
| |
| 1 |
----------------

UnLatch Process
----|EQU ------|----------------------------------(U)--------
| C5.0.ACC | | C5:0 |
| | ------(RES)------
| 2 |
----------------


I am pretty sure this will work.

Thanks!
 
The first question you should be asking is why you are trying to control something with a single pushbutton.

Let's say that something is broken on the machine, but the operator doesn't know it.

He presses the button. Nothing happens.

Human nature being what it is, he presses it again. And again. And a few more times.

Finally, he figures that the problem isn't his button pushing technique, but something else. A maintentance guy comes in to work on the machine. He does lockout/tagout and fixes it.

Upon restoring power to the machine, it starts up automatically, grabbing the unsuspectig maintenance guy's toolkit, because that was the state that the PLC was last commanded to be in by that single pushbutton.

There was no feedback anywhere that told anyone what the PLC was trying to do. Just a pushbutton.

============

Having said all that, if you really have your heart set on doing it this way, the secret word is flip-flop.

I'll leave it to you to figure out what to do with this information.
 
That doesn't look quite as nice as I thought it would :)


As far as the OSR, I used that and with the scan it didn't quite do the trick either. I have it working with a counter, though.

Thanks.
 
Thanks, and I think the post was flip-flop that I saw which led me to the correct ladder.

As far as the single p.b. I agree and that is the way I have always done things. I came in at the butt of this project to get it moving along and this is what was installed. Unfortunately.

thanks for all the comments.
 
This is all 'orrible ! first ' keep a bit of pride and don't do rubbish like that - if the hardware is that bad , I bet you don't have smoking motor protection or isolators etc , and its your name , not mine ,
Second , by the sound of things , you have a processor in front of you to practice on , you have programing software and a PC , this one is hardly rocket science , and with the greatest respect , if you find it hard work , then take the chance to single step it and find out where you are losing the latch - the answer isn't always asking someone else .
And with even more respect , if you can't sort it after sitting quietly , reading past posts and THINKING , and do this job yourself , then I know what I would do .
 
I have example flip flops here: http://www.patchn.com/flipflop.htm

I read what Allen said and realized either example could stay latched thru a power off situation. I think thats why I have developed the habit of putting a "stop" condition at the front of the rung, this "stop" can be designed for situations like losing power or any of a variety of conditions that could cause a problem.

I need to expand on that section, there are a multitude of ways to create a flip flop.

I use flip flops when I need to alternate something like a timer circuit. Example: I rebuilt an L-sealer machine (places a product in plastic then cut/seals the edges). I pulsed the wire to maintain constant heat on the cut/seal wire, I used a flip flop/alternating timer ckt for this.

I doubt I would ever use one pushbutton in this manner but you never know.
 
Yes, danger. Just change your p.b. to a two position selector switch.

Your initial post does sound scary.

Make labells accordingly. 'On', 'Off'. Or just 'Kill', 'Prepare for Kill'.

You really sound dangerous. Tell us about the E-Stop Circuit, the location of P.B.s and such. Or just do a flip flop, and run it.

Can't wait to hear results.

John
 
There could be many applications and situations where only one pushbutton could be used but a switch would be easier to use. I am thinking about non start/stop, or power on situations. Wasnt long ago someone wanted to extend a ram to collect samples, a situation like that one PB would suffice. Push once to extend then push again to retract but a plc offers more options that could be used.

As I mentioned before I would never use one PB as the Start/Stop control for a system.

If the original poster is a student then there are a few things you should know. The Emergency STOP should be hardwired (there are exceptions but it requires special equipment). The ESTOP should never rely on communications.

There are categories of stops involved with any machine. Every machine should have a category 0 stop. In no case should the reset of an ESTOP initiate start of the system.

If this is just a school assignment its ok to use this to learn about flip-flops or toggles with a plc but its NOT by any means a viable option to actually start stop a machine.

You may want to obtain a copy of the NEC code book and NFPA 79 to learn about standards and codes involved with control and motor circuits.

If you arent a student then DEFINITELY obtain the above and rethink your process. With a 5/05 you should have plenty of input capabilities so there is no need to use one PB for start/stop. I wouldnt recommend using a selector switch for start/stop either.

I would also use normally closed contacts for any stop button...power loss/open contact stops machine, if a normally open PB is used for stop its possible it wont make a connection and send a signal to the plc....how do you stop it then?
 
Single switch to start stop

Been thinking on this single switch to stop and start. Also searched for flip flop to learn more about it and what application it has.

It just occurred to me that many moons ago doing a master thesis involving taking measurements while welding I used a single foot activated switch to do several things. I was measuring the light output (UV and Blue) and weld circuit current and volts to enable predictions of the amount of UV and Blue when welding. I was doing this all by myself and using a data logger to record readings. So I had to have a hands free single foot switch and it had to do my timing for me. What it did was

1. Turn off room lights
2. Wait 5 seconds (in this time I struck the arc and started the weld)
3. At five seconds sound a bell (door bell) AND trigger the data logger to record.
4. At 15 seconds turn off the data logger trigger and sound another bell.
5. Stop welding
6. Press switch to turn on room lites.

This was only to control instruments and audible alarms and a room lite. I used a couple of time delay relays to do all the switching.

I do not think I would ever use this to stop and start a machine and RELY on JUST THIS for safety. What happens if the switch gets stuck in the on position?? I think I would rely on the good old START and STOP switches and an E STOP to protect employees if needed and then use the foot switch if needed.

There still needs to be a disconnect means over current protection motor protection also.

Dan Bentler
 
I had to re-read this several times before working out that the original poster wanted to use the same push button to start AND stop the machine. This (in my humble opinion!) is bad practise for all the reasons stated above. Individual start and stop buttons are definately the way to go with the start button being push to make and the stop button being push to break. This has always been the best method of latching a circuit and has been in use before PLC's.

The only acceptable use of a single button for starting and stopping a machine using one pushbutton is in a "Jog" mode (dead man's switch??), where the button must be kept pressed in to run the machine and releasing the button stops it.

Cheers,

Lee
 
Last edited:

Similar Topics

Using PLC5 logic. Awhile ago I came accross a circuit that utilized 1 push button and 2 rungs of logic with one TON in each that simulated a...
Replies
8
Views
9,934
Why does the controllogix redundancy modules use a single mode fiber vs multimode fiber?
Replies
1
Views
51
I am converting a SLC 500 to a Compact Logix. I plan on using a Compact Logix 5380 with conversion Kit. The problem is that the analog input cards...
Replies
1
Views
142
Hello, friends, I am trying to upgrade a system that uses an Onrom incremental encoder (E6B2-CWZ6C) connected to a Danfoss VFD (FC360), but now...
Replies
4
Views
266
Hello, I am using Unity pro V15. I have Quantum CPU 671 and Ethernet NOE 77101 configured. I have configured IO scanning on NOE. I have attached...
Replies
5
Views
166
Back
Top Bottom