We will look at the third specification for the program:
"If the Mill has operated for more than 20 seconds, the fan should remain on until reset by a separate fan reset button, and the oil pump should remain on for an additional 10 seconds after the Mill is turned off."
We will program the logic for the oil pump first. We append a rung to the ladder logic and use T4:3 as the 10-second timer. Again, it is easiest to use a Timer Off instruction.
We want the timer to start when the Ball Mill motor stops and the 20-second startup timer has expired.
In Rung 4, the logic for the oil pump, we add the two conditions for which the oil pump should run. We add the logic to run the oil pump if the Ball Mill motor is running or if the Oil Pump delay timer is active.
We need to modify the logic for the Fan Motor so that it will continue to run if the 20-second start-up timer has timed out. Previously, we programmed the case where the start-up timer had not timed out.
We add a branch around the 5-second fan delay time done bit to allow the motor to continue to run.
To complete the program for this specification, we add the Fan Reset button input to the fan logic to turn off the fan motor when pressed.