Sign in to follow this  
Followers 0
waltsu

SK20 as light controller

19 posts in this topic

I would like to use the Omron Sysmac Mini SK20 as a light controller in my house. Is there any way of controlling a internal relay so that an input to contact 0000 would turn on output to contact 0100 ON and the when there is input to contact 0000 again it would turn 0100 to OFF? Sort of an flip-flop function. I know how to program the PLC with MiniLSS and can get this to work using two inputs (and two push buttons) but I would like to have the light to go on and off with just one button. Also, how do I program an input to turn off multiple outputs with just one input regardless of their current status. This would let me have a master OFF button to turn off all the lights in certain area without having to push multiple buttons. Thank You, - Waltsu Edited by waltsu

Share this post


Link to post
Share on other sites
Hi, here you have a sample code to use a single button as a flip-flop, provided by Sleepy Wombat. http://forums.mrplc.com/index.php?act=Downl...&CODE=02&id=160 About the master OFF button you just have to put it serial with the other inputs..

Share this post


Link to post
Share on other sites
Yes this is just what I have been looking for, but I could not make this work on my SK20. Can you guide on how to change the program to run on SK20? I keep getting "Syntax Error" and then "Network format error" pointing to the KEEP function on MiniLSS when compiling. Also, I cannot input 200.01 or 200.02 on MiniLSS. Can I use other bits? What are the 200.XX's for in later Omron PLC's? Thank you a lot for the help, - Waltsu

Share this post


Link to post
Share on other sites
Use 201 for 200.01 and 202 for 200.02. You need to download this manual for the correct operation of the SK20. SK20 Operation Manual @MrPLC.com

Share this post


Link to post
Share on other sites
Yes I have that. Even printed the whole manual for reference. It was almost too good to be true that I founf it from the web. A big thanks to this site (still haven't found it from anywhere else on the web). What I am lookin for however is the actual ladder code, the symbols that make an input behave the way I wrote in the beginning of this thread. I found two picture files of the code but those do not work on SK20. The PLC is so old and everywhere there is code for the newer boxes. I think I need a simple sort of an explanation on how to do it. Unless someone has a surely working code for the SK/SP- series. BR, - Waltsu

Share this post


Link to post
Share on other sites
Download this, study it and come back with questions. MiniLSS QuickStart @ MrPLC.com

Share this post


Link to post
Share on other sites
Excellent guide. Thank you. I do know the basics of the MiniLSS SW by now. It's the programming I need help at. I got this toggle example at another site, but cannot get this one working either. Detect the Rising Edge of PB1 | PB1 C1 |---|P|------( ) | Use XOR logic to "toggle" output (C2) with rising-edge of (PB1) based on the state of the output (C2). | C1 C2 C2 |---| |------|/|---+--( ) | | | C1 C2 | |---|/|------| |---| Which bits should be used in place of C1 and C2? I think it would e a good idea to use DR bits bacause they hold their value in power failure. BR, - Waltsu Edited by waltsu

Share this post


Link to post
Share on other sites
I cannot paste the txt into the board right. The tabs and spaces keep jumping of the wall. Anyways, this is what I would like to have. A diagram or objects etc. that I can input to MiniLSS and dowload to the SK20. Thanks, - Waltsu

Share this post


Link to post
Share on other sites
I found this, but cannot make it work on SK20. Please, if you know how SK20 will work with this, tell me. When download this code into the PLC, it will open the contact Y1 as long as contact X1 is open but will drop out when X1 goes off. BR, - Waltsu

Share this post


Link to post
Share on other sites
The above circuit will only work if X1 is differentiated (one-shotted.) You need the an additional rung above the above logic. |    X1          [DIFU] |---| |----------[ 215] Substitute 215 for x1 in the above logic.

Share this post


Link to post
Share on other sites
You did it ! Thank you so much. Now it works OK. It has been fun learning this ladder programming and everything that I've picked up that's related to PLC's. It's a very interesting world. Thank you again, - Waltsu (from Finland)

Share this post


Link to post
Share on other sites
1. is there a reason you cannot use a diff up or diff down.? iff not then can u use the following 2. again can you use a counter. 3. and the compare function. edit: oops too late Edited by KinK

Share this post


Link to post
Share on other sites
No KinK it's all good info still. I did now get this working a bit simplier by using a XOR. Previously I had problems with DIFU because it will reset itself at the next pass so it is not a real toggle or flip-flop. By usinf the XOR on it (for some reason) does not matter. Now I still have a problem with forcing all the outputs OFF that were ON at the time and if they were OFF then to do nothing. I have tried to reset the 0200 and 0201 bits, but then the toggel stops functionong. Is there any chance the counter or compare would help on this? BR, - Waltsu

Share this post


Link to post
Share on other sites
To force all outputs off, try the following: |    X3         [  MOV] |---| |---------[#0000] |               [  002]

Share this post


Link to post
Share on other sites
Hey I dont know if that would work Jay as I think that as soon as you X3 goes low you the lights will turn on, as the program will override it. This will work however if you are using a lot of inputs then you may want something else. when you want to turn off all the lights you can just set the counter value to 2 and all lights on counter value to 1. oh I forgot to mention AMem is the output... Edited by KinK

Share this post


Link to post
Share on other sites
This is just another variation on the many different toggle circuits that people have dreamed up. The issue was how to turn off multiple lights that had been toggled on or off in many different states. If he uses the circuit he has right now, the MOV statement should turn all outputs on I/O word 002 off. Trust me!

Share this post


Link to post
Share on other sites
KinK, Do you mean that your circuit can replace my current circuit with the XOR statement to toggle states? Would be nice if it did as it is simplier. I do wan't to use all the output that I can (8 total) for the lights. Then there still is 2 input's left which will be the master OFF's. BR, - Waltsu

Share this post


Link to post
Share on other sites
Sorry Jay you are right. I wasnt thinking of the latch circuit that is in there. ps Yes the circuit that I drew up is a replacement for all the other stuff. it works well but it is not the best way as it uses up more cycle time. however if it is just for light switches then it wont matter.

Share this post


Link to post
Share on other sites
Kink: Your input is extremely valuable and we want to encourage alternate ideas. It's just this thread is heading toward page 3 and he still is a little confused.

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