Sign in to follow this  
Followers 0
vanilla_gorilla

Stupid question, PB and scantimes

10 posts in this topic

What's the easiest way to make an input (lets say a Pushbutton) only see "once" each time it is activated, and not "once" for every scan of the code (as the operator could hold it long enough for it to go through multiple program scans)... I'm trying to sequence/step through a machine operation based on the operator "pushing" the cycle/start button. So I only want it to activate "One step" for each "push" of the button. My first instinct was/is to use an OSR. That should only see the input (PB) once, but that "once" seems to be once per scan cycle..... I may have an issue as I am doing online edits (being used to Omron), do SLC 5/03's get a little weird when editing and changing programs online ?? Thanks I know its a basic question, but sometimes the best of us get stuck on the easy stuff !!!

Share this post


Link to post
Share on other sites
I read your question a couple times and there must be something I'm not following. If you One-Shot (OSR) the pushbutton, the rung will only go true for one program scan. After that it evaluates false (even while it is held closed) until the next low-to-high transition of the pushbutton. That's the way we most often do it if we need something to only be true "once". Are you looking for faster notification of the pushbutton's state than in one program scan? Usually something a person actuates (like a pushbutton) is way slower than the PLC's scan. I suppose you could do an Immediate-Input (IIN) if you needed faster results, but I still can't help but think I'm not following you!

Share this post


Link to post
Share on other sites
Maybe I was unclear. Ill try to simplify the explanation. Pushbutton input, drives different outputs in a sequence. First time operator pushes button, I want it to drive "Output1" once. (Using OTL) Second time operator pushes button I want it drive Output2 or turn off Output 1 (as long as Output1 was driven, again using OTL and OTU) Third time operator pushes button I want it to drive Output 3 (as long as Output2 was driven) etc etc... I am finding that if the button is held "long enough" the process steps through the steps without "another push" of the button.... With each Output, I am latching an internal coil, make it a condition of the next rung. (So that it has to "sequence" through..... Hope this clears it up a little, I know its confusing trying to figure out what someone else is trying to accomplish. Thx

Share this post


Link to post
Share on other sites
Gravitar gave you the right answer. If you One-Shot the pushbutton, it doesn't matter how long the button is held down, nothing will happen until its pushed again. The One-Shot won't be reset until the rung-in condition goes false, e.g. the button is let go. Your only problem then is sequencing what happens when the button is pushed each time. $

Share this post


Link to post
Share on other sites
Since the previous output is a condition for steps two and three, you need to have your logic in reverse order, else it will step through all the logic when the button is depressed. If you have output-1 logic first, when the logic for output-2 is evaluated, (on the same scan), then the PB is true, and output-1 is true so output-2 comes on. You need to put output-3 in the first ladder, then output-2, then output-1. This way when output-1 is energized, the scan will complete, and on the next scan, the pb ONS will be false, so output-2 will not come on, etc.... An alternate method would be to use a counter, have the PB increment the counter, counters only count on false to true transitions. Then use compares to turn on the correct outputs.

Share this post


Link to post
Share on other sites
The only problem I see with the counter solution is the potential of the operator pushing the button fast enough that the counter may jump from lets say 2 to 5 on the false to true transition, and in turn jumps over the outputs 3 and 4 (for example)...... (as the machine is relatively slow...) Not sure I really follow the "reverse" logic above.....Not sure if that would work.....

Share this post


Link to post
Share on other sites
vg, I like to use the attached rungs to "De-Bounce" inputs. There is probably a better way, but I haven't found it yet. Use T4:0/DN as your input to cycle a counter,SQO,MOV or whatever. Adjust the timer PRE to get desired action. You can adjust T4:1.PRE to prevent quick releases or T4:0.PRE to prevent quick pushes. BD

Share this post


Link to post
Share on other sites
This thread had a similar theme: http://forums.mrplc.com/index.php?showtopic=7664 It works. output-1 on the bottom rung, then output-2 above that rung, then output-3 in rung above output-2 logic, try it the order of scan is key.

Share this post


Link to post
Share on other sites
So after the input and advice, I am going to try the following..... Input PB on a OSR incrementing a counter. ACC of counter in compare statements for each sequence step. or Input PB on a OSR, last sequence first in decending order through sequences until first sequence. Each sequence step latching for the next. Thanks for the input

Share this post


Link to post
Share on other sites
No need to one shot the counter, the counter only increments on the leading edge of a pulse. Now onto the real world, where many PLC programmers come unstuck. Real people don't just press buttons once, they accidently press it twice quickly, or the PB has a dirty contact that causes a double trigger everytime it is pressed. The end result is you need some kind of debounce timer to prevent these accidental triggers.

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
Sign in to follow this  
Followers 0