The biggest secret to success for cases like this is to separate your sequence control from your motor control.
The motor control as you wrote it, as Doug-P pointed out, requires that the START button be held continuously for the pump to run. It also currently has no "hooks" to tie in any sort of timing sequence.
You need to step back and better define your processes. There are so many questions that I have about it, that it's very difficult to help you. It's probably because you are rushing into trying to code the thing that you haven't asked them yourself, which is why you are having difficulty helping you.
- You talk about HOA -- Hand-Off-Auto. Where does that "live"? Is there an HOA switch next to each motor, or do you have an HMI that performs that function?
- If the former, does the PLC know about the position of the HOA switch?
- If the latter, then typically one would hard-wire the <START> & <STOP> pushbuttons to the motor starter relay and the Hand contacts of the HOA switch (and exercise for the reader what that circuit diagram looks like)
- You have <START> & <STOP> buttons to control each pump. But what Starts & Stops your SEQUENCE? My GUESS (and it's only a guess and I shouldn't have to guess) is that, if all the pumps are in Auto, and if Midnight rolls around, then the sequence starts.
- What actions do the Pressure Switches and "PM" (?) perform/prevent?
Like I said, the key is to separate your sequence code from your device control code. You device control code might look something like this:
AUTOx OFFx MOTORx
----+----| |---- { here } ----+-----|/|-------( )
| { be } |
| { dragons } |
| |
| |
| HANDx STARTx STOPx |
+----| |---+---| |---+---|?|----+
| |
| MOTORx |
+---| |---+
The -|?|- contact for the STOP buttons depend, as Doug-P and Steve Bailey discussed, on how the Stop button is wired. Normally closed (so that pressing the button interrupts the current flow) is usually best.
The "dragons" section is likely to be a single contact from your sequencer. It's probably a single contact ("Run Pump x"). There are, of course, even more questions to be asked about the sequencer:
- Does it always start with the same pump?
- Do all the pumps have to be in AUTO for the sequencer to work?
- If not, how does the sequencer handle cases where a pump is on HAND or OFF? Does it not run anything for 5 minutes? Does it skip to the "Next"?
And so on. Again, the reason that you're stuck is that you're trying to write code before you've fully described what you are trying to accomplish. You don't know what "success" looks like, so you cannot succeed. This is a common problem in programming and in business.