(1) The logic contacts of external input/output relays, internal relays, timers, counters and other software devices can be reused multiple times without the need for complicated program structures to reduce the number of times the contacts are used.
(2) Each row of the ladder diagram starts from the left busbar, with the coil connected to the rightmost side. Contacts cannot be placed to the right of the coil, whereas in relay contactor control circuits, contacts can be added to the right of the coil, which is not allowed in PLC ladder diagrams. This is illustrated in Figure 1(a). It is easy to see from the figure that the programmer's purpose is to energize coil 10.00 when contacts 0.00, 0.01, and 0.02 are all closed. However, because contacts cannot be connected to the right busbar in a ladder diagram, Figure 1(a) is transformed into the format shown in Figure 1(b), which satisfies the above-mentioned function of the program while conforming to the programming rules of ladder diagrams.
Clarify: (a) Ladder diagrams that do not conform to programming standards; (b) Ladder diagrams that conform to programming standards.
(3) The coils cannot be directly connected to the left busbar. It is not difficult to see from Figure 2(a) that the programmer's purpose is to drive the 10.00 and 10.01 coils as soon as the program runs. To achieve this, the normally closed contact of an internal relay (such as 200.00) that is not called in the program or the normally open contact of a special relay 253.15 (normally open relay) can be used to drive them, which satisfies the programmer's functional requirements and does not violate the ladder diagram programming rules, as shown in Figure 2(b).
Figure 2 shows the transformation of the coil being directly connected to the left busbar.
Clarify: (a) Ladder diagrams that do not conform to programming standards; (b) Ladder diagrams that conform to programming standards.
(4) Using the same numbered coil twice consecutively in the same main program is called the same-name double coil output. Same-name double coil output can easily cause uncertainty in the output results. When programming, the situation of same-name double coil output should be avoided as much as possible. For how to avoid same-name double coil output, please refer to the solution shown in Figure 3.
Explanation: (a) Original ladder diagram; (b) Operational effect;
In ladder diagram programming, outputting two coils with the same name should generally be avoided as much as possible, because this will lead to uncertainty in the output results, as shown in Figure (a). While this ladder diagram does not violate programming syntax, in practical operation, the results can sometimes differ significantly from the programmer's expectations. It is easy to see that the programmer's intention in Figure (a) is that coil 10.00 should be driven when contacts 0.00 and 0.01 in branch 1 are closed, or contacts 0.02 and 0.03 in branch 2 are closed, or all contacts in both branches are closed. However, in practice, when contacts 0.00 and 0.01 in branch 1 are closed, while contacts 0.02 and 0.03 in branch 2 are open, coil 10.00 is not energized, as shown in Figure (b). This is because the PLC uses a cyclic scanning processing method. After input sampling, the central processing unit performs calculations on the ladder diagram from top to bottom. During the first-order circuit operation, coil 10.00 is energized. However, during the second-order circuit operation, coil 10.00 is not energized because contacts 0.02 and 0.03 are open. During I/O refresh, the output is based on the final calculation result, therefore coil 10.00 is de-energized at this time.
(5) Ladder diagram programs must conform to the principle of sequential execution, that is, execution from left to right and from top to bottom. Ladder diagram programs that do not conform to the principle of sequential execution cannot be input into programming software. As shown in the bridge-type ladder diagram in Figure 4(a), it is not difficult to see that the programmer's purpose is that coil 10.00 is driven to be energized when all contacts of branch 1, or all contacts of branch 2, or all contacts of branch 3, or all contacts of branch 4 are closed. However, this type of ladder diagram cannot be input into programming software or handheld programmer because it does not conform to programming rules. Figure 4(a) should be converted into Figure 4(b) before it can be written into the PLC memory using programming software or handheld programmer.
Basic principles of PLC ladder diagram design
1. Arrangement of contact points
The contact points of a ladder diagram should be drawn on horizontal lines, not on vertical branches.
2. Processing of series and parallel connections
When several series circuits are connected in parallel, the series circuit with the most contacts should be placed at the top of the ladder diagram. When several parallel circuits are connected in series, the parallel circuit with the most contacts should be placed at the far left of the ladder diagram.
3. Arrangement of coils
The contact point cannot be drawn to the right of the coil; the coil can only be connected to the right of the contact point.
4. Dual coil output is not allowed.
If the coil of the same component is used two or more times in the same program, it is called a double-coil output. In this case, the previous outputs are invalid, and only the last one is valid, so double-coil output should not occur.
5. Rearrange the circuit
If the circuit structure is complex, you can reuse some contacts to draw its equivalent circuit, and then programming it will be easier.
6. Programming order
For complex programs, you can first divide the program into several simple program segments. Each segment starts from the leftmost contact and is programmed from top to bottom to right. Then connect the program segments one by one.
A ladder diagram consists of multiple rungs. Each coil can form a rung, each rung represents a logic equation, and each rung has multiple branches.
In ladder diagrams, relays, contacts, and coils are not physical entities, but rather bits stored in PLC registers. I've compiled a resource package, which I've included at the end of the video.
When programming, normally open/normally closed contacts can be referenced an unlimited number of times, but coil output can only be performed once.
The flow in the ladder diagram is a "conceptual current," which can only flow from left to right.
The user program's operations are based on the contents of the PLC's input/output image registers, and the results of the logical operations can be immediately used by subsequent programs. Related information has been compiled at the end of the video.
The internal relays of a PLC can only store intermediate states of logic control and cannot be used for control.
The output coil cannot directly drive the actuators in the field; it needs to be driven by power devices on the I/O module.
The basic logic instructions of a PLC are mainly based on bit logic operations. In bit logic instructions, unless otherwise specified, the valid operand range is: I, Q, M, SM, T, C, V, S, L, and the data type is BOOL. Contact and coil instructions are divided into standard instructions, immediate instructions, invert instructions, and positive (negative) toggle instructions.