Re-state the control scheme prose as logical statements e.g.
- the 18" Hg vacuum switch informs the system to start operating at 1st. pump, ... if the system spends more than 10 minutes above [18"Hg], the 1st pump is turned off, only returning to operation when there is a change in the system's vacuum level
- => the first pump is on if either
- the 18"Hg switch is open
- OR
- the first pump is on
- AND
- the 18"Hg switch has been continuously closed for less than 10min
- if [18"Hg switch is] open for more than 15 seconds, the second pump starts operating. ... 1 minute after the closing of the 18" Hg vacuum switch, the 2nd pump is turned off
- => the second pump is on if either
- the 18"Hg switch has been continuously open for more than 15s
- OR
- second pump is on
- AND
- the 18"Hg switch has been continuously closed for less than 1min
- the 15" Hg vacuum switch requests the input of the 3rd pump. after closing the 15" Hg vacuum switch, an internal PLC contactor is activated, and 1 minute after this condition, the 3rd. pump is turned off,
- => the third pump is on if either
- the 15"Hg switch is open
- OR
- third pump is on
- AND
- the 15"Hg switch has been continuously closed for less than 1min
All three of those descriptions can be implemented with the Start/Stop circuit; (see
this link):
- Start is the initial condition e.g. "switch opens," or "switch has been continuously open for more than 15s"
- Run is the pump on condition
- Stop is the not-expired state of a "continuously closed for X minutes" timer.
The states of conceptual sequence of pumps
- First_pump_on
- Second_pump_on
- Third_pump_on
will be internal bits (booleans) that are independent of the contactor outputs for the physical pumps:
- PUMP CONTACTOR 1
- PUMP CONTACTOR 2
- PUMP CONTACTOR 3
There will be nine other bits indicating which physical pump is which sequenced pump:
- Pump_1_is_first
- Pump_1_is_second
- Pump_1_is_third
- Pump_2_is_first
- Pump_2_is_second
- Pump_2_is_first
- Pump_3_is_first
- Pump_3_is_second
- Pump_3_is_third
The most complex section will be the code that assigns the values of these nine bits. Only three of those bits will be 1 at any time; the other 6 will be 0. Only one of the Pump_1_is_... bits will be 1 at any time; only one of the ..._first bits will be 1 at any time; etc. This section will also have to implement some metric for "equivalent use," such as number of starts or total run time, as well as whether a pump is in manual or not, and assign 1s and 0s to the Pump_N_is_Mth bits accordingly.
Obviously that functionality could also be performed with three INTs, but it does not matter in the end.
The final section of the program will determine which contactors to the physical pumps will be on e.g. for Pump 1
MANUAL PUMP 1 PUMP CONTACTOR 1
----+-------] [---------------------------------------------+--------( )-----
| |
| AUTOMATIC PUMP 1 Pump_1_is_first First_is_on |
+-------] [----------+--------] [-------------] [-------+
| |
| Pump_1_is_second Second_is_on |
+--------] [-------------] [-------+
| |
| Pump_1_is_third Third_is_on |
+--------] [-------------] [-------+
This is only one approach; this could also be done with bits in INTs and bit-wise OR and AND instructions.