9 -3 L ADDER D IAGRAM F O R M AT

9 -3 L ADDER D IAGRAM F O R M AT

The ladder diagram language is a symbolic instruction set that is used to create PLC programs. The ladder instruction symbols can be formatted to obtain the desired control logic, which is then entered into memory. Since this type of instruction set consists of contact symbols, it is also referred to as contact symbology.

A thorough understanding of ladder diagram programming, including func- tional blocks, is extremely beneficial, even when using a PLC with IEC 1131 programming language capabilities. Because ladder diagrams are easy to use and implement, they provide a powerful programming tool when used in the IEC 1131 environment.

The main functions of a ladder diagram program are to control outputs and perform functional operations based on input conditions. Ladder diagrams use rungs to accomplish this control. Figure 9-6 shows the basic structure of

a ladder rung. In general, a rung consists of a set of input conditions (represented by contact instructions) and an output instruction at the end of the rung (represented by a coil symbol). The contact instructions for a rung may be referred to as input conditions, rung conditions, or the control logic.

L1

Input

Output L2

Conditions

Instructions

A continuous path is required for logic continuity

Figure 9-6. Ladder rung structure.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

A ladder rung is TRUE (i.e., energizing an output or functional instruction block) when it has logic continuity. Logic continuity exists when power flows through the rung from left to right. The execution of logic events that enable the output provide this continuity. In a ladder rung, the left-most side (left power line) simulates the L1 line of a relay ladder diagram, while the right-most side (right power line) simulates the L2 line of the electromechani- cal representation. Continuity occurs when a path between these two lines contains contact elements in a closed condition, allowing power to flow from left to right. These contact elements either close or remain closed according to the status of their reference inputs. Figure 9-7 illustrates several continuous paths that provide continuity and energize the output of the rung. Power continuity is normally represented on a PLC’s monitoring device (e.g., a PC) by bold or emphasized lines, as shown in Figure 9-8a. Figure 9-8b illustrates power continuity through only one energized contact element; note that the output is not ON. We will explain how these contact symbols are interpreted to be ON or OFF in the next section.

Power (continuity)

Figure 9-7. Illustration of several different continuity paths in a ladder rung.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Figure 9-8. Monitoring device showing (a) power continuity through the rung—inputs 11 and 12 are ON, turning output 40 ON—and (b) power continuity through only input

12, thus output 40 is not ON.

When a ladder diagram contains a functional block, contact instructions are used to represent the input conditions that drive (or enable) the block’s logic.

A functional block can have one or more enable inputs that control its operation. In addition, it can have one or more output coils, which signify the status of the function being performed. For example, the block shown in Figure 9-9a has an enable block line, which when energized (i.e., continuity exists), will activate the block to perform the instruction. Thus, this instruc- tion says: IF the enable is ON because the desired logic has continuity, THEN execute the block instruction. Depending on the instruction, other enable lines (see Figure 9-9b) may drive the block using reset or other control functions.

Input Conditions

Functional Blocks and Outputs

Time Enable

Time = Preset

Reset

Figure 9-9. Functional block instructions with (a) one enable line and one output and (b) one enable line, a start timing command, and two outputs.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

To make a block active at all times without any driving logic, the user can omit all contact logic and place a continuity line in the block during programming (see Figure 9-10).

L1

L2

Functional Block Intruction

Power Flow Enable Output

Figure 9-10.

A functional block instruction that is always enabled.

The ladder rung matrix determines the maximum number of ladder contact elements that can be used to program a rung (see Figure 9-11). The size of this matrix differs among both PLC manufacturers and the program- ming devices used (CRT screens versus miniprogrammers). For functional block operations, a ladder matrix may have less available ladder contact elements because the functional block instruction display takes up room in

Input Conditions

Output

Figure 9-11. Ladder rung matrix.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

the matrix (see Figure 9-12a). In PLCs with enhanced ladder format functional instructions instead of block-type instructions, the ladder matrix may use one or more contact symbol spaces to represent the instruction in the programming device (see Figure 9-12b).

Input Conditions

Block Instruction Output

Input Conditions Functional Instruction

Output

Move R10 to R20

(b)

Figure 9-12. Ladder matrix with (a) functional block instructions and (b) enhanced

ladder format functional instructions.

A ladder matrix represents all the possible locations where a contact symbol instruction can be placed. The programming device usually displays all of these possible locations on the screen, allowing the user to place contact symbols in the desired locations. However, according to the maker of the PLC, certain rules apply to contact placement. One rule, which is present in almost all PLCs, prevents reverse (i.e., right-to-left) power flow in a ladder rung (see Figure 9-13). PLC logic does not allow reverse power to avoid sneak paths . Sneak paths occur when power flows in a reverse direction through an undesired field device, thus completing a continuity path. If a PLC’s logic requires reverse power flow, the user must reprogram the rung with forward power flow to all contact elements. The next example illus- trates the solution to the reverse power flow rung in Figure 9-13.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

Figure 9-13. Reverse power flow at contact D.

E X AM PLE 9 -1

Solve the logic rung shown in Figure 9-13 so that no reverse power flow condition exists. The reverse condition is not part of the required logic for the output to be energized.

S OLU T I ON

The forward power flow of the logic determines output Y . Let’s implement it using logic concepts. The output Y is defined, using forward paths only, as:

6 4 1st line 7 4 8 6 4 2nd line 7 4 8 678 3rd line Y = ( ABC •• )( + ADE •• )( + FE • )

which can be minimized, using Boolean algebra’s distributed rule, to (see Chapter 3):

Y =••+• A ( BCDE )( + FE • ) Figure 9-14 shows the implementation of this logic gate, while Figure

9-15 gives the ladder-equivalent solution. A

Figure 9-14. Logic solution for Example 9-1.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

Figure 9-15. Ladder diagram implementation for Example 9-1.

E X AM PLE 9 -2

Solve the ladder logic shown in Figure 9-13 so that no reverse power flow exists. Assume that the reverse path logic through contact D and then forward through contacts B and C is required in the PLC logic solution to energize the output.

S OLU T I ON

Following the same procedure as in Example 9-1, we can obtain the desired logic for output Y using Boolean logic expressions. Therefore, output Y , including the reverse power flow logic, is represented by:

6 4 1st line 7 4 8 6 4 2nd line 7 4 8 678 3rd line 6 Reverse path 4 4 7 44 8 Y = ( ABC •• )( + ADE •• )( + FE • )( + FDBC ••• )

=••+• A ( BCDE ) + FEDBC ( +•• )

The term F • D • B • C implements the reverse power flow sequence that output Y requires. Figure 9-16 shows the ladder diagram of this solution.

Figure 9-16. Ladder diagram implementation for Example 9-2.

Industrial Text & Video Company 1-800-752-8398

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9