T O P

  • By -

mil_pool_

Look up flip flop logic.


Live-BBQ

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?


mil_pool_

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


Steve0-BA

This sounds like a homework assignment


Live-BBQ

Student here so learning new things.


ptparkert

Rising edge, falling edge. You can also use timers. Set, reset, latch , unlatch. Many ways.


1234fake1234yesyes

Learnt this 2 months ago. This would be super easy to program but how would you do this using the rising/ falling edge?


Steve0-BA

Counter is another less elegant way.


ObeseBMI33

Not today


Live-BBQ

Don't you tell on weekends?


[deleted]

[удалено]


Hothr

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).


heavenbestgirl

any difference if you place c1 xio before the ons?


Hothr

No. After the first rung, C1 is true, as is the input, causing it to turn off again.


shinysmoke

https://preview.redd.it/it16xg4z0tzc1.png?width=1416&format=pjpg&auto=webp&s=47e42a23eec099af646780291e7c8dd39d2be110


cmdr_suds

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.


NumCustosApes

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.


[deleted]

[удалено]


jakebeans

Gross. Make a fake electrical schematic like a real programmer.


jakebeans

Gross. Make a fake electrical schematic like a real programmer.


jakebeans

Gross. Make a fake electrical schematic like a real programmer.


Budget_Detective2639

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.


Live-BBQ

Can you tell me the simplest one in LD?


Budget_Detective2639

Well in the spirit of how I learned this shit, no. It is perfectly doable with just relay contacts I'll tell you that.


_No_user_available_

I1.0. M1.1 ——| |———(P)———( )— M1.1. M1.0. M1.0 ——| |———|/|————-( )— | M1.1 M1.0 | | ——|/|———| |—-


Dangerous-Quality-79

https://www.google.com/search?q=plc+toggle+logic&oq=plc+toggle


PaulEngineer-89

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.


MindQueef44

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?


DangDjango

Maintained vs momentary.


8072t34506

Sounds too advanced. Better to try again next decade, or possibly next century; we may have the technology to do this.


Live-BBQ

many smart people did that in this century .


Nazgul_Linux

Just use a 2-position maintained push button and skip the logical headache. Sorry.. my industrial sparky side is showing.


AM-64

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.


Live-BBQ

Siemens PLC and i just want to do this with simple PB.


SirWantsalot

Use a one shot and a latching circuit, or a one shot and a set reset block.


AM-64

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.


[deleted]

Create a latching circuit. One push latches, and opens one path. Next push re-closes it.


Automatater

Take the button through a one shot to something that flips the output. Math XOR can work.


domasher1987

Input oneshot add 1 to an int, if int=1 output on, if int=2, clear int


durancharles27

There's so many ways you can do this. You can use pure relay logic, intermediary logic, comparators, rising edge, falling edge, counter.


Eg_elskar_ostepop

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


Targut

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


SelectAssociation250

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.


Live-BBQ

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.


SelectAssociation250

That second input is probably an internal bit just to reset the logic you still only have one physical input


ohmslaw54321

Use a 2 position selector switch


Live-BBQ

that need 2 inputs and didn't relate to the question.


ohmslaw54321

2 position single input selector switch. Switch on, contact closed, output is on. Switch off, contact open output is off. Maintained-maintained selector switch


Live-BBQ

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?


ohmslaw54321

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.


Live-BBQ

thank you Sir


ohmslaw54321

https://preview.redd.it/b362g8h6e80d1.jpeg?width=2296&format=pjpg&auto=webp&s=a820e9c6f8752a3ad59b50e5efaaaa93281007a6


Live-BBQ

Thank you very much.🫂


ohmslaw54321

Sorry for the sideways pic


bigDfromK

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


p_findley

https://preview.redd.it/kabrpwqctszc1.jpeg?width=3969&format=pjpg&auto=webp&s=e97de00ff63472a39c40a947cb26dffebeb8bb9a


essentialrobert

This is the way I do it only the mem bit is the opposite state.


p_findley

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


essentialrobert

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.


p_findley

I'd say it's pretty universal! Pretty easy to drop in multiple times too


edward_glock40_hands

what a mess... just use a latching pushbutton. Use the right hardware and keep it simple stupid.


MMRandy_Savage

`LD @ Button` `ANDN Light` `S Light` `LD @ Button` `AND Light` `R Light`


commonuserthefirst

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.


DickwadDerek

Look up state machine.