Jump to content

Recommended Posts

Posted
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.
Posted (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 by MrAutomation
Posted (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 by TConnolly

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...