When discussing motor operation, we frequently encounter scenarios in programming such as delayed motor startup, delayed shutdown, or motor shutdown after running for a specific duration. However, have we ever delved deeper into the functionality of our programs during the design phase? For instance, how should we design and code a program for a motor that runs for 2 hours, stops for 2 hours, and then continues this cycle indefinitely? If you're unsure, here's your chance. Let's design this program together.
(1) The conveyor belt of a certain piece of equipment needs to operate for 2 hours before automatically shutting down.
(2) After stopping for 2 hours, it automatically resumes operation.
(3) The above actions repeat in a cycle.
First Step: (Achieving the Function of Shutting Down After Running for 2 Hours through a Combination of Self-locking Program, Timer, and Counter)
Design Concept: The PT pin of the timer is set to: 18000*100=1800000ms=1800s=30min. By counting once every 30 minutes, counting four times will reach 120min=2h.
Second Step: (Achieving Continuous Operation After a 2-Hour Shutdown through the Relay of Multiple Counters and the Use of the SM0.5 Instruction)
Design Concept: By using a counter to disconnect and then activate the next counter, combined with the SM0.5 instruction that engages once every second, it effectively adds time in increments of one second. After counting 7200 seconds, which equals 120 minutes or 2 hours (the shutdown duration), the motor is reconnected to resume operation.