fgcastro Posted January 30, 2008 Report Posted January 30, 2008 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 Posted January 31, 2008 Report Posted January 31, 2008 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 Posted January 31, 2008 Author Report Posted January 31, 2008 Yes b_carlton. The intent is to learn and roll my own code. Thank you
PdL Posted January 31, 2008 Report Posted January 31, 2008 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 Posted January 31, 2008 Author Report Posted January 31, 2008 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 Posted January 31, 2008 Report Posted January 31, 2008 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 Posted January 31, 2008 Report Posted January 31, 2008 (edited) 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 January 31, 2008 by b_carlton
Hipoguy Posted March 26, 2008 Report Posted March 26, 2008 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 Posted March 31, 2008 Report Posted March 31, 2008 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 Posted May 5, 2008 Report Posted May 5, 2008 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 Posted May 5, 2008 Report Posted May 5, 2008 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now