Help - Search - Members - Calendar
Full Version: ON/OFF Button
Forums.MrPLC.com > PLCs and Supporting Devices > Automation Direct
fgcastro
I am new to PLC programming and I am breaking my head trying to program a single button to turn ON and OFF a light.
Can someone give me a clue ?

Thank you

b_carlton
DirectSOFT version 5 has an IBOX (PONOFF) which directly implments this function. Please reply if you are trying to learn and wish to roll your own code.
fgcastro
QUOTE(b_carlton @ Jan 30 2008, 09:24 PM) [snapback]64479[/snapback]
DirectSOFT version 5 has an IBOX (PONOFF) which directly implments this function. Please reply if you are trying to learn and wish to roll your own code.


Yes b_carlton. The intent is to learn and roll my own code.

Thank you
PdL
I don't know your processor or instructionset but over at PLCs.net is a topic about universal flip-flop logic that might help. If you post which processor you use other users might be able to help you.
fgcastro
QUOTE(PdL @ Jan 31 2008, 03:27 AM) [snapback]64484[/snapback]
I don't know your processor or instructionset but over at PLCs.net is a topic about universal flip-flop logic that might help. If you post which processor you use other users might be able to help you.


I am using either a
DL06 or a DL260 CPU and I did take a look at the universal flip-flop thread in PLC.net.

Thank you
PdL
QUOTE(fgcastro @ Jan 31 2008, 03:50 PM) [snapback]64516[/snapback]
QUOTE(PdL @ Jan 31 2008, 03:27 AM) [snapback]64484[/snapback]
I don't know your processor or instructionset but over at PLCs.net is a topic about universal flip-flop logic that might help. If you post which processor you use other users might be able to help you.


I am using either a
DL06 or a DL260 CPU and I did take a look at the universal flip-flop thread in PLC.net.

Thank you


Of course we can post the same examples like shown in the plcs.net thread, but obviously this is not helping you.
Perhaps you can post the code you have got so far according to the examples in the plcs.net thread, and we can help you from there.
If you post a screenshot, users that don't have the software you use are also able to comment.
b_carlton
Having read the thread you may have picked up that this can be implemented in a number of ways.

One of the methods that I prefer uses the following method:

1. Determine if the button has JUST BEEN PRESSED (One - Shot)

Of course it's an even better learning experience if you 'roll your own' one-shot instead of using the built in commands.

2. If it has just been pressed then invert the status of the output
Else keep the current output status.
Hipoguy
If you have the DS 5 software there is an example that comes with the software of how to implement this function and does not involve the use of an I-Box.
scottg
Hi Guys,

I had to come up with logic to solve this very problem quite awhile ago, and I came up with my own
ladder logic method to work through this problem.

You will need:
1 real world input
1 real world output
2 internal relays

You will see that my solution is programmed using Panasonic's FPWIN Pro 5 software, but the logic can be applied to any PLC that has a rising edge input contact. I tested this solution using my FP-X C30 PLC that I use for goofing around, and I know it works.

If you have any questions, just post a message.

roscho
thumbsupsmileyanim.gif thumbsupsmileyanim.gif
QUOTE(fgcastro @ Jan 30 2008, 05:44 PM) [snapback]64466[/snapback]

I am new to PLC programming and I am breaking my head trying to program a single button to turn ON and OFF a light.
Can someone give me a clue ?

Thank you

Here try this, watch the video by doug bell (how to create a one shot toggle in ladder logix )

this well help http://learn.automationdirect.com/PLC_Hard...LCHardware.html
scottg

Thanks for the link Rocho, Doug always does a GREAT job in his videos.

When you click on the link Rocho has provided it may not take you directly to the correct video, you may need to scroll down a bit just right of the video player to find Doug's "Program a one-shot" video.

Doug uses a counter, a compare instruction, and a special instruction (_First Scan SP0) to accomplish the task of creating a one button toggle. This is a neat approach, and I want to thank you Rocho for posting the link.

Like everything else in programming, there is usually more than many way to accomplish a task.

Best regards to all.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.