Some things that must be paid attention to when programming PLC ladder diagram

Some things that must be paid attention to when programming PLC ladder diagram

Since the ladder diagram is a form of program representation, not a control circuit composed of hardware, when drawing a ladder diagram, you should pay attention to the difference with ordinary control circuits. The following basic principles should be followed when PLC programming.

Since the ladder diagram is a form of program representation, it is not a control circuit composed of hardware. Therefore, when drawing a ladder diagram, you should pay attention to the difference with ordinary control circuits. The following basic principles should be followed when PLC programming:

(1) The logical contacts of soft devices such as external input/output relays, internal relays, timers, counters, etc. can be reused many times, without the need for complex program structures to reduce the number of times the contacts are used.

(2) Each row of the ladder diagram starts from the left bus, and the coil is connected to the rightmost. The contact can not be placed on the right side of the coil, and in the relay contactor control circuit, the contact can be added to the right side of the coil, which is not allowed in the PLC ladder diagram. As shown in Figure 1(a). It is not difficult to see from the figure that the programmer’s intention is that when the contacts 0.00, 0.01, and 0.02 are all closed, the coil 10.00 is driven to be energized. However, in the ladder diagram, since the contacts cannot be connected to the right bus, the conversion of Figure 1 (a) into the format shown in Figure 1 (b) not only satisfies the above-mentioned functions of the program, but also conforms to the programming rules of the ladder diagram.

Some things that must be paid attention to when programming PLC ladder diagram

Figure 1 Conversion of the situation where the coil is not connected to the right bus (or the contact is connected to the right bus)

Explanation: (a) Ladder diagram that does not meet the programming specifications; (b) Ladder diagram that meets the programming specifications

(3) The coil cannot be directly connected to the left bus. It is not difficult to see from Figure 2(a) that the programmer’s intention is to drive the 10.00 and 10.01 coils as soon as the program runs. To achieve this goal, you can use the normally closed contacts of an internal relay (such as 200.00) that are not called in the program or the normally open contacts of special relay 253.15 (normally open relay) to drive them, which satisfies the programmer’s requirements. The functional requirements do not violate the ladder programming rules, as shown in Figure 2 (b).

Some things that must be paid attention to when programming PLC ladder diagram

Figure 2 Conversion of the situation where the coil is directly connected to the left busbar

Explanation: (a) Ladder diagram that does not meet the programming specifications; (b) Ladder diagram that meets the programming specifications

(4) The coil with the same number is used twice in the same main program in succession, which is called double coil output with the same name. The double-coil output with the same name is likely to cause uncertainty in the output result. When programming, the double-coil output with the same name should be avoided as much as possible. How to avoid the double-coil output with the same name can refer to the scheme shown in Figure 3.

Some things that must be paid attention to when programming PLC ladder diagram

Figure 3 Double-coil output of the same name and its solution

Description: (a) Original ladder diagram; (b) Operation effect;

In the ladder diagram program, the double-coil output with the same name should generally be avoided as much as possible, because this will cause the uncertainty of the output result. As shown in Figure (a), the double-coil output ladder diagram with the same name is shown. In terms of programming syntax, the ladder diagram does not violate the regulations, but in actual operation, the results sometimes differ greatly from the programmer’s expectations. It is not difficult to see (a) The intention of the programmer in the figure is that when the contacts 0.00 and 0.01 in branch 1 are closed, or the contacts 0.02 and 0.03 in branch 2 are closed, or in both branches When all the contacts are closed, the coil 10.00 can be driven. But in the actual implementation, when the contacts 0.00 and 0.01 in the contact branch 1 are closed, and the contacts 0.02 and 0.03 in the branch 2 are open, the coil 10.00 cannot be energized. The result is shown in Figure (b). . This is because the PLC uses a cyclic scan processing method. After the input is sampled, the central processing unit performs operations on the ladder diagram from top to bottom. When the first-order circuit is calculated, the coil 10.00 is driven and energized, but when the second-order circuit is calculated, the coil 10.00 is not driven because the contacts 0.02 and 0.03 are disconnected. When the I/O is refreshed, the output is based on the final calculation result, so the coil 10.00 at this time is in a power-off state.

(5) Ladder diagram programs must comply with the principle of sequential execution, that is, from left to right, and from top to bottom. Ladder diagram programs that do not conform to the principle of sequential execution cannot be entered into the programming software. The ladder diagram of the bridge structure shown in Figure 4(a), it is not difficult to see that the programmer’s intention is that when all contacts of branch 1 are closed, or all contacts of branch 2 are closed, or branch When all the contacts of circuit 3 are closed, or all the contacts of branch 4 are closed, the coil 10.00 is driven to be energized. However, this type of ladder diagram cannot be entered into the programming software or the handheld programmer because it does not conform to the programming rules. Figure 4 (a) should be converted to the one shown in Figure 4 (b) before the programming software or handheld programmer can be used to write into the PLC memory. .

Some things that must be paid attention to when programming PLC ladder diagram

Figure 4 Conversion of bridge circuit

Description: (a) Bridge circuit diagram; (b) Ladder diagram after conversion

(6) There is no limit to the number of use of series and parallel contacts in the ladder diagram, and it can be used unlimited times, as shown in Figure 5.

Some things that must be paid attention to when programming PLC ladder diagram

Figure 5 Unlimited use of contacts

(7) Two or more coils with different numbers in the same program can be output in parallel, as shown in Figure 6.

Some things that must be paid attention to when programming PLC ladder diagram

Figure 6 Parallel output of multiple coils with different numbers

The Links:   LQ9D340 SKM400GB124D IGBT-MODULE

We will be happy to hear your thoughts

Leave a reply

Health & Medical 315
Logo
Enable registration in settings - general
Shopping cart