Write a PLC program that if you pressed the push button (PB) for the first time then the motor should…