Previously, I introduced the concept of dual coils due to the PLC scanning cycle. Regarding this scanning cycle, I have found that many friends, when starting to write programs, often see no issues with the program, and the PLC shows no errors or alarms, yet the results are incorrect. This is likely due to the scanning cycle, which is often referred to as the “mystical” aspect of PLCs.Today, we will explore the PLC scanning cycle through a very classic example.
First, take a look at this program and try to understand what it means. Those who have written it before will know that this is a very classic one-button start-stop case.Pressing the start-stop button will turn on the small light, and pressing it again will turn it off.Now, let’s explain how this effect is achieved step by step.Initial state: The start-stop button is not pressed, state is 0; the auxiliary point coil is not energized, state is 0; the auxiliary point normally open contact is not energized, state is 0; the small light is not energized, its normally open contact is open, and its normally closed contact is closed.During the first scanning cycle: The start-stop button is pressed, triggering a rising edge, energizing the auxiliary point coil, and then scanning down the program. Since the auxiliary point coil is energized, the normally open contact of the auxiliary point will close. Next, looking at the normally closed contact of the small light, it is still not energized, so it remains closed. The PLC will then evaluate the parallel branch below; since the auxiliary point coil is energized, its normally closed contact will open, making this path unavailable. Therefore, our second segment of the program will connect from above, energizing the small light. Thus, the first scanning cycle is complete, and the external input has been processed within the PLC, energizing the small light.Next scanning cycle: The rising edge signal exists only for one scanning cycle. During this cycle, the auxiliary point coil will lose power, so when scanning down, the normally open contact of the auxiliary point will open. Since the small light coil was energized in the previous cycle, the normally open contact of the small light is in a closed state, but this path is now unavailable. Looking at the path below, the auxiliary point coil is de-energized, and its normally closed contact should be closed. However, since the small light was energized in the previous cycle, the normally open contact of the small light remains closed, forming a “self-locking” condition, thus keeping the small light on.Starting state:
Now let’s look at the stopping state.First, let’s clarify the starting state: the start-stop button is False, the auxiliary coil is False, and the small light is True.During the scanning cycle when the start-stop button is pressed, the auxiliary point coil is energized, and the normally open contact closes. At this point, the small light is energized, so its normally closed contact is open, making the upper path unavailable. Looking at the lower path, since the auxiliary point coil is energized, its normally closed contact opens, thus the lower path is also unavailable, leading to the small light losing power. This cycle ends here.Then, the next scanning cycle is quite evident: the auxiliary point coil is de-energized, and its normally open contact will not close, forming an open circuit. Since the small light was de-energized in the previous cycle, the normally open contact of the small light will naturally not form a path.This detailed explanation of the PLC’s internal logic during the scanning process should help you better understand the dual coil concept.In conclusion: The execution logic of PLC programs is from top to bottom, from left to right. The energized state of ordinary coils is determined by the last coil (the reason for dual coil errors). The PLC scanning cycle is very fast; within this cycle, the PLC must first read external input signals, perform internal calculations, and output to external signals, completing this entire process to achieve the desired effect.Finally, I wish everyone happiness every day.