×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Momentary switch on/off feature

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

RE: Momentary switch on/off feature

You can increment a counter on the positive edge of the pushbutton press signal.  Then compare if the counter value is odd/even.

RE: Momentary switch on/off feature

Don't even need to evaluate. Just let bit 0 be your output. It changes state each time the counter steps up.

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

A number of PLC's allow the internal coils to work in an inpulse mode, where the coil state toggles with each rising edge input to the coil.
 

RE: Momentary switch on/off feature

Hi Guys,
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

I just found it on plc net, sorry for silly question guys :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources