Sign in to follow this  
Followers 0
fgcastro

ON/OFF Button

11 posts in this topic

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Yes b_carlton. The intent is to learn and roll my own code. Thank you

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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. Edited by b_carlton

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0