theshadowscome2

CX Programmer. Button for turning on and off one light

22 posts in this topic

Hi guys. Can u help me to make 1 program using CX programer? The task is following: Make button which can turn off and on the light (it should work like button on computers) If u press once it tun on the light and when u press it again itt turn off the light. It would be good if some1 could post the scheme of the program like picture (i attached the picture its empty but the program should go there :)) using elements like: open contact, closed contact, new coil, new plc instruction . . Hope u can help me. Thx.

Share this post


Link to post
Share on other sites
Here's one written for a CP1L processor:

Share this post


Link to post
Share on other sites
That doesn't work!!! This does!!

Share this post


Link to post
Share on other sites
Of course, you are correct. I should have tested it. As soon as I set it, the logic resets it in the same scan....doh!

Share this post


Link to post
Share on other sites
Here is the corrected version using the SET and RESET functions. Of course, the KEEP example is simpler.

Share this post


Link to post
Share on other sites
Don't beat yourself. I knew what you meant.

Share this post


Link to post
Share on other sites
Guys these programs don't work they way they should, i mean i just transferred them to PLC and: 1. Pressed button the light turned [ON] pressed again it turned [OFF] But it should work like: 1. Press button [ON] [OFF] - light on 2. Press button [ON] [OFF] - light off I think its because the program is compiling the code from: 1. LEFT to RIGHT 2. TOP to BOTTOM

Share this post


Link to post
Share on other sites
Do you want the light to turn On / Off when you release the pushbutton? I think that is what you are saying. Then just change the PB switch from a Differentiated UP contact to a Differentiated DOWN contact (in the KEEP and SET examples) as shown below:

Share this post


Link to post
Share on other sites
Guys! Are you sure he's not using a C Series Plc? It was Mendon who offered a CP1L solution. If he is, he'll need to use a DIFU. . Check the first screenshot It's a CPM1A...
1 person likes this

Share this post


Link to post
Share on other sites
Or a DIFD. Good question... theshadowscome2, what kind of PLC are we talking about?

Share this post


Link to post
Share on other sites
Its a CPM1(CPM1A). One of my friend made the program. As soon as i get it from him i will post it :)

Share this post


Link to post
Share on other sites
I am new to programming PLCs and have been working through different scenarios to develop problem solving and programming skills. I have tried the different options shown here and they do not work as I would expect: I must depress the limit switch 1-3 times to get the light to turn on or off. I am looking for a solution that would reset the light on or off and hold it in that condition with each push of the limit switch. I am using cx programmer ver 9 and a cpm2c PLC. What am I missing?

Share this post


Link to post
Share on other sites
It is not very clear for me, but i assume you meant : you have to push 3 times the limit switch #1 to change state of the light. So this should work: (If it is not what you expected please clarify this: hold it in that condition with each push of the limit switch.) Edited by pfort

Share this post


Link to post
Share on other sites
That did exactly what I wanted. I will be reading up on differentiate function to better understand why this worked. Thankyou.

Share this post


Link to post
Share on other sites
It is simpler now with "new" series of PLC, the rising or falling edge can be specified directly on contact. Edited by pfort

Share this post


Link to post
Share on other sites
On 10/23/2012 at 8:06 PM, Michael Walsh said:

Of course, you are correct. I should have tested it. As soon as I set it, the logic resets it in the same scan....doh!

Hi guys. i have some doubt. what is the purpose of P_Off in the ladder program. i know it means ALWAYS OFF but what is its purpose?

Share this post


Link to post
Share on other sites

The P_Off is used to temporarily disable a part of the ladder logic.  Usually this is done when someone is not sure if they want to make the change permanent.  After testing, the P_Off should be removed, or the ladder should be removed.  However, you will often find P_Off contacts that have been left in the code permanently.

1 person likes this

Share this post


Link to post
Share on other sites

I use P-On in front of every rung - easy to disable the rung if you want to. Also easier if you have to put a contact in front of a pile of logic - no need to redraw it then.

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