randyh Posted June 5, 2006 Report Posted June 5, 2006 Hello, i am new to programming PLCs, and need a program to turn on and off outputs without outside input & Auto recycle if you will. ( once started recycle until stopped) i have the program running one cycle without an issue, what i cant get is it to reset itself without an outside input. Is it possible to do this? can anyone guide me to the programming steps needed. I am using melsec medoc 1.64b to program the plc. i included my program for your help. Thanks, Randy valve.zip Quote
davefinic Posted June 5, 2006 Report Posted June 5, 2006 can anyone help me ive downloaded this file but cant open it in gx developer Quote
Rodney Posted June 5, 2006 Report Posted June 5, 2006 Hi This is a Medoc project so you have to import it into G X Developer and not just try to open it Rodney Quote
Goody Posted June 5, 2006 Report Posted June 5, 2006 And that leads me to a little gripe with GX dev If you did not select 'allow imports from medoc' when you installed GX dev then there is no way of installing that feature after. You need to do a full re-install and select that option. Quote
davefinic Posted June 5, 2006 Report Posted June 5, 2006 I can import a file to gx developer from a memory stick but i cant open this file even if i copy it to my memory stick i get the message a read file has not been selected. i have tried to open it as a windows and dos file but get the same message. Quote
hungvu Posted June 5, 2006 Report Posted June 5, 2006 You can use the internal clock special Ms to start program cycle and repeat the cycle after run through the first cycle. M8012 = 100 mili second clock pulse M8013 = 1 second clock pulse M8014 = 1 minute...... Also you can use the counter C to count every time an output active and RESET the counter to restart the cycle.Ex At startup use C1 inplace of X0, and at the end RESET C1 to start again. Or the cycle will repeat every time a pulse M8014 (1minute = 10sec x 6 outputs) is ON. Quote
bobtalbot Posted June 5, 2006 Report Posted June 5, 2006 You can use STL style programming to "loop" the program. Quote
waynes Posted June 5, 2006 Report Posted June 5, 2006 RandyH, Here is a sample program which I quickly wrote for you. LD M8002 MOV K1 D0 LD M8000 MOV D0 K2Y000 MPS ANI M5 OUT T0 K100 MRD AND T0 MUL D0 K2 D0 PLS M5 MPP CMP D0 K32 M0 AND M0 MOV K1 D0 END Attached is the ladder representation of the above code. Hope this helps, WayneS Quote
Sergei Troizky Posted June 5, 2006 Report Posted June 5, 2006 (edited) Here is your printout: VALVE.TXT Edited June 7, 2006 by Sergei Troizky Quote
davefinic Posted June 6, 2006 Report Posted June 6, 2006 an easy solution would be AND T5 SET T6 K100 T6 PLS M2 AND M2 IN PARALLEL WITH X0 M1 RST T6 T6 COULD THEN BE USED TO SET A SMALL DELAY BEFORE THE NEXT CYCLE i hope this helps as it only uses simple ladder instructions similar to your original programme so should pose no problems for you Quote
randyh Posted June 6, 2006 Author Report Posted June 6, 2006 To All, Thanks for the Information. I am still reading, looking and trying different things. Since last night, my program had to change to add a dwell between the valves on time, a period when all are off, which i seem to have working with the following program. 1. waits three seconds, from time X0 is closed. 2. turns on Y0 for 7 seconds, turns it off 3. 3 seconds of off time then turns on Y1 for 7 seconds then off. 4. 3 seconds later turns on Y2 for 7 seconds, then off. I just cant seem to figure out how to make it reset itself yet. Inst mode: 0 LD X0 1 ANI C1 2 SET M0 3 AND M0 4 OUT T0 K30 7 AND T0 8 OUT T1 K70 11 OUT Y0 12 AND T1 13 RST Y0 14 SET M1 15 RST M0 16 LD M1 17 OUT T2 K30 20 AND T2 21 OUT T3 K70 24 OUT Y1 25 AND T3 26 RST Y1 27 SET M2 28 RST M1 29 RST C1 31 LD M2 32 OUT T4 K30 35 AND T4 36 OUT T5 K70 39 OUT Y2 40 AND T5 41 RST Y2 42 SET M3 43 RST M2 44 END ladder is in file attachment. All help will be welcomed! Thanks Again Randy Quote
bobtalbot Posted June 6, 2006 Report Posted June 6, 2006 I don't have any software that you'll be able to open with Medoc 1.64b, take a look at the manual, here's a link http://www.meau.com/eprise/main/sites/publ...0320&ManualType= look in the STL section Quote
Colin Carpenter Posted June 6, 2006 Report Posted June 6, 2006 You could try this .... simplifies the code a bit. Tip ..... always use a PLS instruction to SET and RST flags. You don't have to, but it solves a lot of headaches. Haven't tested it, but I think it will work. Sets M0 at first instance of X0 closing. LD X0 PLS M100 LD M100 SET M0 Multiple cascading timers First 3 sec wait LD M0 OUT T0 K30 First 7 sec wait LD T0 OUT T1 K70 Second 3 sec wait LD T1 OUT T2 K30 Second 7 sec wait LD T2 OUT T3 K70 Third 3 sec wait LD T3 OUT T4 K30 Third 7 sec Wait LD T4 OUT T5 K70 Output Control - in each case, output comes ON when preceding 3 sec timer has timed out, for as long as it's own 7 second timer LD M0 AND T0 ANI T1 OUT Y0 LD M0 AND T2 ANI T3 OUT Y1 LD M0 AND T4 ANI T5 OUT Y2 Resets the sequence at end of Timer T5 Will restart when X0 ON again. LD T5 PLS M101 LD M101 RST M0 Quote
randyh Posted June 14, 2006 Author Report Posted June 14, 2006 Thanks Guys, I read a lot of things in the manual and tried several things. My biggest problem was figuring out the software works. ( probably still need a lot of help) but i finally got it. Here is the program that works, ( it includes STL, Special thanks to Bob) (Wayne, i am still trying to get your program into my old software.) 0 LD X0 1 SET S0 3 STL S0 4 SET M0 5 LD M0 6 OUT T0 K25 9 AND T0 10 OUT Y0 11 OUT T1 K65 14 AND T1 15 RST Y0 16 SET M1 17 RST M0 18 LD M1 19 OUT T2 K25 22 AND T2 23 OUT Y1 24 OUT T3 K65 27 AND T3 28 RST Y1 29 SET M2 30 RST M1 31 LD M2 32 OUT T4 K25 35 AND T4 36 OUT Y2 37 OUT T5 K65 40 AND T5 41 RST Y2 42 SET M3 43 RST M2 44 LD M3 45 OUT T6 K25 48 AND T6 49 OUT Y3 50 OUT T7 K65 53 AND T7 54 RST Y3 55 SET M4 56 RST M3 57 LD M4 58 OUT T8 K25 61 AND T8 62 OUT Y4 63 OUT T9 K65 66 AND T9 67 RST Y4 68 SET M5 69 RST M4 70 LD M5 71 OUT T10 K25 74 AND T10 75 OUT Y5 76 OUT T11 K65 79 AND T11 80 RST Y5 81 RST M5 82 RST M0 83 RST S0 85 RET 86 END Valves.txt Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.