Div_by_zero Posted August 23, 2014 Report Posted August 23, 2014 Say I want to start 10 motors. I want there to be a X second (HMI input parameter) delay between the starts. There are a million ways of coding this, I've probably done about half of that million, but what's the best, smiliest, and most concise? Thanks. Quote
MrAutomation Posted August 23, 2014 Report Posted August 23, 2014 (edited) Like you mentioned, you've done it a million times, so create logic that can be recycled without any modification. An incrementing index integer that reuses the same timer over and over again, incrementing each time the timer finishes. Once the index number reaches the max value (preconfigured in a different integer), stop the cycle. If you need a different time preset for each step, create an array of integers with the time values. Write the value into the timer preset every step, using the index number as a reference. This little bit of logic can be recycled a hundred times. All you need to do is change the max step number and the timer preset(s). To actually start your motors, just give each motor a number. When the index matches the motor's number, fire it up. I original wrote this post to be AB specific, but realized that this is the general forum, so I'm just using general references. Hope this helps, best of luck! Edited August 23, 2014 by MrAutomation Quote
Chris Elston Posted August 23, 2014 Report Posted August 23, 2014 I have a sample article here that might help. http://www.mrplc.com/kb/Programming-Application-3-Phase-Motor-Startup_14.html Quote
TConnolly Posted September 5, 2014 Report Posted September 5, 2014 (edited) A sequencer (AB SQO) is a nice generic tool to do what you want. The sequencer can be any length and you can set up the source words to accomplish any sequence of start up you desire. Advance the sequencer with a timer to move the next word from the source array to the destination word. The disadvantage of the sequencer is that Otis might call you at 3:00 AM because he is looking at the program and doesn't have a clue how the motors are being switched on when the real problem is something else. This example starts the motors in the order 10, 9, 8, 7, 6, 5, 1, 2, 3, 4. Edited September 5, 2014 by TConnolly 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.