Beginner plc ladder programming, should follow certain rules and develop good habits. This article takes Mitsubishi FX series PLC as an example to briefly introduce the rules to be followed when programming Mitsubishi plc ladder diagram, so that users can better understand how to learn to watch Mitsubishi PLC ladder diagram programming, I hope to help everyone. One thing to note is that although this article uses Mitsubishi PLC as an example, these rules must be observed in other plc programming.
First, the PLC ladder ladder starts from the left busbar and finally the right busbar (usually it can be omitted, only the left busbar is drawn). On the left side of each line is a combination of contacts, indicating the conditions for driving the logic coil, and the logic coil representing the result can only be connected to the busbar on the right. The contact cannot appear on the right side of the coil. As shown in the following figure (a) should be changed to (b):
Second, the contact should be drawn on the horizontal line and should not be drawn on the vertical line. The relationship between the contact X005 and other contacts in the following figure (a) cannot be identified. For such bridge circuits, all the ways should be drawn separately from left to right and from top to bottom. As shown in Figure (b):
Third, when the parallel blocks are connected in series, the more contact points should be placed on the left side of the ladder diagram (the principle of left and right light); when the series blocks are connected in parallel, the parallel connection of multiple contacts should be placed above the ladder diagram (up and down light) the rules). In doing so, the program is simple, which reduces the scan time of the instructions, which is especially important for some large programs. As shown below:
Fourth, it is not advisable to use a double coil output. If the coil of the same component is used twice or more in the same ladder diagram, it is called double coil output or coil reuse. The double coil output is one of the most common problems that beginners are likely to make. In the case of a double coil output, only the last coil is valid, while the front coil is inactive. This is determined by the scanning characteristics of the PLC.
The CPU of the PLC uses a cyclic scan mode of operation. It typically consists of five phases (as shown): internal diagnostics and processing, communication with peripherals, input sampling, user program execution, and output refresh. When the mode switch is in STOP, only the first two phases are performed: internal diagnostics and processing, and communication with peripherals.
1, input sampling stage
The PLC reads the state of each input in sequence and stores it in the internal unit we call the input image register. When entering the program execution phase, if the input state changes, the corresponding cell information of the input image area will not change. Only in the input sampling phase of the next scan cycle, the corresponding cell information of the input image area will change. Therefore, the PLC ignores the pulse change of the switching amount that is less than the input of the scan cycle.
2, the program execution stage
The PLC starts from step 0 of the program and scans the user program in the order of first up, then down, first left and right, and performs logical operations. The PLC performs logical operations on the contents of the input image area and writes the operation results to the output image area instead of directly outputting them to the terminals.
3, the output refresh phase
The PLC changes the state of the output terminal according to the contents of the output image area. This is the actual output of the PLC.
The above briefly explains the working principle of the PLC. Below we will explain why the ladder program is written by an example. It is not advisable to reuse the coil. As shown in the figure below, when input sampling is performed, X001=ON, X002=OFF, Y003-ON, and Y004=ON in the input image area are actually written to the output image area. However, when it continues to execute, because X002=OFF, Y003=OFF, the result of this subsequent input is written to the output image area, and the state of the original Y003 is changed. So in the output refresh phase, the actual external output Y003 = OFF, Y004 = ON. Many newcomers have encountered such a problem, why X001 is closed, and Y003 has no output? The logical relationship is wrong. In fact, it is caused by the use of double coils.
Note: What we are saying is not suitable (preferably not) using double coils. The use of double coils is not absolutely forbidden. In some special cases, double coils can also be used. In this case, you need to have more programming. Experience and skill. We will talk about this below. But for beginners, don't take the risk. In fact, as can be seen from the above examples, the reason why the reuse of the coil causes the output of Y003 is confusing is because the program is executed sequentially from top to bottom. But if we can change the order in which the program is executed, and ensure that only one drive logic occurs in the two coils at any time, the double coil can be used. Among them, the most common method is to use jump instructions. As shown below:
Program analysis: M0 is closed, the program jumps to P0 (does not execute X001 statement), M0 is normally closed, CJ P1 does not occur, and the next statement is executed. At this time, Y003 drives the X002 state. When M0 is disconnected, the program executes sequentially and drives T003 according to the state of X001. M0 is normally closed, and jumps to P1 to drive Y004 according to X003 state, that is, the statement of X002 drive Y003 is skipped. It can be seen that at the same time, only one of the Y003 drivers can occur. At this time, double coil utilization is possible.
However, in ladder programming, we still try to avoid using double coils, and the introduction of auxiliary relays is a common method. As shown below:
In Figure (b), X001 and X002 contact control auxiliary relay M000, X003~X005 contact control auxiliary relay M001, and then parallel combination of two relays M000, M001 contacts to control coil Y000. This logical relationship has not changed, but the double coil becomes a single coil.
Arts And Crafts Casting,Hpdc Die Casting,Aluminum Die Casting Air,Die Casting Aluminium Alloys
Dongguan Metalwork Technology Co., LTD. , https://www.diecast-pro.com