Key Points of PLC Automatic Control Programming

At the end of this article, there are 55 practical case materials.

Introduction:In automation equipment, each device has its actions, such as what to do first and what to do next, which are logically related. Just like in our daily lives, we need to have a sequence of actions to maintain order. For example, we wash our hands before eating, eat after washing hands, and wash dishes after eating.In previous articles, I shared how to write PLC automatic control programs, and the main programming ideas are as follows:

  1. Start-Stop Control Method

  2. Set-Reset Method

  3. Register Assignment Method

  4. Shift Register Method

  5. CASE Statement Comparison in SCL

Among these automatic control programming methods, devices often need to have different modes, such as stopping after completing one cycle or continuing to work in a loop after completing one cycle of actions. As shown in the figure below, the robotic arm can stop after moving one item or continue to move items in a loop. So how can we implement a program that has both single-cycle and loop functions?

Key Points of PLC Automatic Control Programming

Control Requirements:

The diagram shows the liquid mixing control schematic. The liquid mixing controller has three solenoid valves (YV1-YV3) and a mixer (M) for control. The detailed control requirements are as follows:

(1) After pressing the start button, open valveA to inject liquid A, stop injecting liquid A when the low liquid level sensor is reached, stabilize the liquid level for30S and then open valveB to inject liquid B;

(2) When the high liquid level is reached, close valveB, start the mixer to automatically stir the mixed liquid for2 minutes, and after stirring is complete, let the mixed liquid flow out from the discharge port;

(3) Wait for1 minute after the mixed liquid flows out, and close the discharge port.

(4) After pressing the stop button, to prevent the liquid from solidifying, the process must complete one cycle before stopping.

Key Points of PLC Automatic Control Programming

In this case, the “Register Assignment” method can be used to achieve start-stop control of different devices at different time intervals, as shown in the figure below:

Key Points of PLC Automatic Control Programming

The following is the program written using the 200SMART PLC:

Program segments 1 and 2 are: power-on reset related flags and registers, if the stop button is not pressed, after pressing the device start button, set the start flag.

Key Points of PLC Automatic Control Programming

Program segment 3 is when the start button is pressed, the value of the “state step” is modified to 1, which indicates the start of the device cycle. If the “device stop” button is pressed at this time, the stop flag is set, and after the entire device action is completed, it switches to state step 0, thus resetting the start and stop flags.

Key Points of PLC Automatic Control Programming

Program segment 4 checks if the state step equals 1, then starts valve A. After the sensor is activated, it delays, and after the time is up, it switches the state step. The methods for the following program segments are similar!

Key Points of PLC Automatic Control ProgrammingKey Points of PLC Automatic Control ProgrammingKey Points of PLC Automatic Control ProgrammingKey Points of PLC Automatic Control Programming

Program segment 3 checks if the start flag is activated, then checks if the state step equals 5, indicating that the entire cycle is completed. Next, it checks if the stop flag is activated. If the stop button is pressed during operation, the stop flag is activated, and the state step switches to step 0. If the stop button is not pressed, it switches to step 1.

After pressing the stop button, the values of the registers and output points are reset.

Key Points of PLC Automatic Control Programming

Recently, many friends have asked for case books, saying that reading articles on mobile phones is not very convenient. I took some time to organize all 55 practical cases, which are quite typical, including cylinder control programs, alarm programs, program frameworks, motion control program encapsulation, analog control of frequency converters, communication, and other practical cases.If you need them, you can add me on WeChat: 15571252598. If you can’t add me, you can send me a private message.

Key Points of PLC Automatic Control Programming

Key Points of PLC Automatic Control Programming

Leave a Comment