Write a PLC program so that when a selector switch is ON, the timer starts to count for 5 seconds and switch motor to ON, when the selector switch is OFF before the 5 seconds the timer stops counting and when the selector switch is ON again then the timer starts to count from the last value the timer stopped counting. And so on.
Note: the best practice to learn the PLC programming is to start writing the PLC program, take your time before you review the answer.
Inputs & Outputs
Pause the Timer Logic
PLC Ladder Logic
When the selector is ON, the timer start to count from the preset value stored in MW2 and stores the remaining time in MW4 while the motor is ON.
When the selector is OFF before 5 seconds elapsed, the motor stops and the negative edge detector energizes the move instruction to move the remaining time to the initial time value MW0.
So when the selector is ON again the timer starts to count from the preset value which is remaining time from the last run.
When the remaining time is equal to zero, 5 seconds is moved to MW0 to start counting for the next time.
Author: Karim Ali Anwar