Momentary switch on/off feature
Momentary switch on/off feature
(OP)
Hi everyone!
I've started to learn PLC programming (Simatic manager with plcsim). I red an interesting lesson on the internet: write a plc program which can toggle on and off an output (LED, motor, etc.) with and ON and OFF momentary push button. I could solve it with an SR flip-flop, but the next lesson is harder for me. It's the same with only 1 button.
So, at beginning i push the button (then release it) and the output turns on, till i push the button again, when the output turns off (and then if i push again, it will turn on, then push again, it will turn off, and so on).
I know how to program it in C language, here it is:
if ((in1==1) && (temp1 == 0)
{
temp1 = 1
outTemp = !outTemp
}
if (in1 == 0)
{
temp1 = 0
}
out1 = outTemp
The problem, that it's complex for me to program it in STL/FBD/LAD. Can someone help me with that? I know, I should make a latch circuit (with one or more flip-flops maybe), but I don't really know how :S
And my other question: is there and easier/better way to solve the first circuuit (i solved it with 1 SR-FF, and i think it's the best/fastest solution)
Thanks,
szfAmman
I've started to learn PLC programming (Simatic manager with plcsim). I red an interesting lesson on the internet: write a plc program which can toggle on and off an output (LED, motor, etc.) with and ON and OFF momentary push button. I could solve it with an SR flip-flop, but the next lesson is harder for me. It's the same with only 1 button.
So, at beginning i push the button (then release it) and the output turns on, till i push the button again, when the output turns off (and then if i push again, it will turn on, then push again, it will turn off, and so on).
I know how to program it in C language, here it is:
if ((in1==1) && (temp1 == 0)
{
temp1 = 1
outTemp = !outTemp
}
if (in1 == 0)
{
temp1 = 0
}
out1 = outTemp
The problem, that it's complex for me to program it in STL/FBD/LAD. Can someone help me with that? I know, I should make a latch circuit (with one or more flip-flops maybe), but I don't really know how :S
And my other question: is there and easier/better way to solve the first circuuit (i solved it with 1 SR-FF, and i think it's the best/fastest solution)
Thanks,
szfAmman





RE: Momentary switch on/off feature
TTFN
FAQ731-376: Eng-Tips.com Forum Policies
Chinese prisoner wins Nobel Peace Prize
RE: Momentary switch on/off feature
http://www.plctalk.net/qanda/
these guys are PLC-crazy.
TygerDawg
Blue Technik LLC
Virtuoso Robotics Engineering
www.bluetechnik.com
RE: Momentary switch on/off feature
RE: Momentary switch on/off feature
Gunnar Englund
www.gke.org
--------------------------------------
Half full - Half empty? I don't mind. It's what in it that counts.
RE: Momentary switch on/off feature
RE: Momentary switch on/off feature
I have the same problem as the original poster. I fully agree that the solution with the counter and 0 bit is smart. However, I was asked to solve it just with contacts and simple outputs. Could somebody post a solution of this task in Ladder please?
RE: Momentary switch on/off feature
RE: Momentary switch on/off feature