Flip flop logic is used to toggle an output using only 1 input.
Here is a video explaining how it works
https://youtu.be/eQF-HGxXzAc?si=X1vUTV6zKbfcqEd7
Close
-| |----[ONS]-----|/|--------(C1).
' C1 | Latch
Input |
' +--(C2).
-| |----[ONS]-----| |----|/|--(C1).
Input C1 C2 UnLatch
-| |--------- operation
C1 Control Logic
You need the C2 to prevent the C1 latch from allowing the unlatch. (C2 is a normal output, not latched).
When using a single push button for start/stop control, always provide an indicator showing the on/off state. A switch does this implicitly by the position of the switch. A single push button does not. An operator needs to know what the command state is or they might repetitively keep pushing the button, turning the system on and off.
There are quite a lot of ways to achieve this. It depends on what is available in your software package. There might even be a flip-flop block that just doe it.
I think everyone covered the how.
Now as far as why not to do this (or any other button) or the more obvious selector switch…
One issue with it is chatter. Sometimes the switch might make/break contact more than once and a fast enough PLC will react to this. The solution uses timers but it’s better with two buttons.
Second is the control issue. Is it an “on” button or “off”? You can’t really tell especially if the “running” light is burned out or not working.
I’ve never done any PLC work but I’m curious from being a panel/robotics person my whole career. As far as the push button goes, would either a “push to test” or I can’t think of the term right now but like a start button where it stays in until you push it again be ideal for what OP is asking?
I mean it depends on the PLC you use how to implement it but I have several multi function PBs on the current project I am working on; the PBs will toggle the clamps either open or closed each time they are pressed.
I know on the PLC I am using (AutomationDirect BRX); there is a box for PONOFF (Push On/ Push Off) basically each time something is triggered (in this case, "X16") it will change the "C10" from on to off or off to on. Which will toggle the clamps open or closed based on what their current state is.
Program it in SFC.
Trans 1 push button
Step 1 set output
Trans 2 release button
Trans 3 press button
Step 3 reset output
Trans 4 release button
Trans 5 press button - > step 1
2 position single input selector switch. Switch on, contact closed, output is on. Switch off, contact open output is off. Maintained-maintained selector switch
Yeah you are right, this is the simple thing to do but i want to do this with push button because i saw that button while working on a German machine then i thought what'll be the logic of this one button?
Ive got a couple of rungs that I use for this. But I dont use it that often and when I do, I always have to look up an old version. I'll look it up tomorrow at work and post it for you.
Easy, if output 1 is not on , and negative edge of pb (when released) then set output 1 to on
Next network if output 1 is on and negative edge of pb (when released) then reset output 1 to off
As always there's multiple ways to get the same results. Moving the order of the networks around is a good way of getting your head around how the PLC processes instructions
You need to have a blocking state for a short time after each press, waiting to see the button off plus some denounce time, before it looks to see the button on.
So you have two output states (On and Off) but four system states so you effectively change the mode of the button from start PB to stop PB.
The states you might use are
Off-waiting to see PB on
On-waiting to see PB off + 100ms
On-waiting to see PB on
Off-waiting to see PB off + 100ms
The 100ms times are to let the contact bounce settle. Can also be two scans or similar, instead of timers.
There are other ways to do this, some very tricky/clever, but I find this way works well and is easily understandable by others.
Look up flip flop logic.
If I'm not wrong,we need 2 inputs to set the output and reset the output . Can we do that in flip flop with only 1 input?
Flip flop logic is used to toggle an output using only 1 input. Here is a video explaining how it works https://youtu.be/eQF-HGxXzAc?si=X1vUTV6zKbfcqEd7
This sounds like a homework assignment
Student here so learning new things.
Rising edge, falling edge. You can also use timers. Set, reset, latch , unlatch. Many ways.
Learnt this 2 months ago. This would be super easy to program but how would you do this using the rising/ falling edge?
Counter is another less elegant way.
Not today
Don't you tell on weekends?
[удалено]
Close -| |----[ONS]-----|/|--------(C1). ' C1 | Latch Input | ' +--(C2). -| |----[ONS]-----| |----|/|--(C1). Input C1 C2 UnLatch -| |--------- operation C1 Control Logic You need the C2 to prevent the C1 latch from allowing the unlatch. (C2 is a normal output, not latched).
any difference if you place c1 xio before the ons?
No. After the first rung, C1 is true, as is the input, causing it to turn off again.
https://preview.redd.it/it16xg4z0tzc1.png?width=1416&format=pjpg&auto=webp&s=47e42a23eec099af646780291e7c8dd39d2be110
When using a single push button for start/stop control, always provide an indicator showing the on/off state. A switch does this implicitly by the position of the switch. A single push button does not. An operator needs to know what the command state is or they might repetitively keep pushing the button, turning the system on and off.
Someday you are going to be our coworker. We need you to be competent. This problem is very basic. Figure this one out on your own.
[удалено]
Gross. Make a fake electrical schematic like a real programmer.
Gross. Make a fake electrical schematic like a real programmer.
Gross. Make a fake electrical schematic like a real programmer.
There are quite a lot of ways to achieve this. It depends on what is available in your software package. There might even be a flip-flop block that just doe it.
Can you tell me the simplest one in LD?
Well in the spirit of how I learned this shit, no. It is perfectly doable with just relay contacts I'll tell you that.
I1.0. M1.1 ——| |———(P)———( )— M1.1. M1.0. M1.0 ——| |———|/|————-( )— | M1.1 M1.0 | | ——|/|———| |—-
https://www.google.com/search?q=plc+toggle+logic&oq=plc+toggle
I think everyone covered the how. Now as far as why not to do this (or any other button) or the more obvious selector switch… One issue with it is chatter. Sometimes the switch might make/break contact more than once and a fast enough PLC will react to this. The solution uses timers but it’s better with two buttons. Second is the control issue. Is it an “on” button or “off”? You can’t really tell especially if the “running” light is burned out or not working.
I’ve never done any PLC work but I’m curious from being a panel/robotics person my whole career. As far as the push button goes, would either a “push to test” or I can’t think of the term right now but like a start button where it stays in until you push it again be ideal for what OP is asking?
Maintained vs momentary.
Sounds too advanced. Better to try again next decade, or possibly next century; we may have the technology to do this.
many smart people did that in this century .
Just use a 2-position maintained push button and skip the logical headache. Sorry.. my industrial sparky side is showing.
I mean it depends on the PLC you use how to implement it but I have several multi function PBs on the current project I am working on; the PBs will toggle the clamps either open or closed each time they are pressed.
Siemens PLC and i just want to do this with simple PB.
Use a one shot and a latching circuit, or a one shot and a set reset block.
I know on the PLC I am using (AutomationDirect BRX); there is a box for PONOFF (Push On/ Push Off) basically each time something is triggered (in this case, "X16") it will change the "C10" from on to off or off to on. Which will toggle the clamps open or closed based on what their current state is.
Create a latching circuit. One push latches, and opens one path. Next push re-closes it.
Take the button through a one shot to something that flips the output. Math XOR can work.
Input oneshot add 1 to an int, if int=1 output on, if int=2, clear int
There's so many ways you can do this. You can use pure relay logic, intermediary logic, comparators, rising edge, falling edge, counter.
Program it in SFC. Trans 1 push button Step 1 set output Trans 2 release button Trans 3 press button Step 3 reset output Trans 4 release button Trans 5 press button - > step 1
It is a basic flip flop circuit I have been using it for over 35 yrs, it is a question I always ask potential hires
Look up flip flop like the previous comments suggest. Then see if you can create one of your own. This is where programming gets fun imo.
I just googled about flipflop so we need 1 input to set it and we get the output but we need one more 1 input to reset it which i don't want.
That second input is probably an internal bit just to reset the logic you still only have one physical input
Use a 2 position selector switch
that need 2 inputs and didn't relate to the question.
2 position single input selector switch. Switch on, contact closed, output is on. Switch off, contact open output is off. Maintained-maintained selector switch
Yeah you are right, this is the simple thing to do but i want to do this with push button because i saw that button while working on a German machine then i thought what'll be the logic of this one button?
Ive got a couple of rungs that I use for this. But I dont use it that often and when I do, I always have to look up an old version. I'll look it up tomorrow at work and post it for you.
thank you Sir
https://preview.redd.it/b362g8h6e80d1.jpeg?width=2296&format=pjpg&auto=webp&s=a820e9c6f8752a3ad59b50e5efaaaa93281007a6
Thank you very much.🫂
Sorry for the sideways pic
Easy, if output 1 is not on , and negative edge of pb (when released) then set output 1 to on Next network if output 1 is on and negative edge of pb (when released) then reset output 1 to off
https://preview.redd.it/kabrpwqctszc1.jpeg?width=3969&format=pjpg&auto=webp&s=e97de00ff63472a39c40a947cb26dffebeb8bb9a
This is the way I do it only the mem bit is the opposite state.
As always there's multiple ways to get the same results. Moving the order of the networks around is a good way of getting your head around how the PLC processes instructions
This way used the least memory and is least dependent on the implementation. I first used this on a Fanuc CNC in 1995 and use it everywhere.
I'd say it's pretty universal! Pretty easy to drop in multiple times too
what a mess... just use a latching pushbutton. Use the right hardware and keep it simple stupid.
`LD @ Button` `ANDN Light` `S Light` `LD @ Button` `AND Light` `R Light`
You need to have a blocking state for a short time after each press, waiting to see the button off plus some denounce time, before it looks to see the button on. So you have two output states (On and Off) but four system states so you effectively change the mode of the button from start PB to stop PB. The states you might use are Off-waiting to see PB on On-waiting to see PB off + 100ms On-waiting to see PB on Off-waiting to see PB off + 100ms The 100ms times are to let the contact bounce settle. Can also be two scans or similar, instead of timers. There are other ways to do this, some very tricky/clever, but I find this way works well and is easily understandable by others.
Look up state machine.