L ADDER L ANGUAGE

L ADDER L ANGUAGE

The programmable controller was developed for ease of programming using existing relay ladder symbols and expressions to represent the program logic needed to control the machine or process. The resulting programming language, which used these original basic relay ladder symbols, was given the name ladder language. Figure 9-1 illustrates a relay ladder logic circuit and the PLC ladder language representation of the same circuit.

Hardwired Ladder Circuit

PLC Ladder Circuit

*Note: The PLC will know the elements PB, LS, FS, and PL by their addresses once the address assignment has been performed.

Figure 9-1. Hardwired logic circuit and its PLC ladder language implementation.

The evolution of the original ladder language has turned ladder programming into a more powerful instruction set. New functions have been added to the basic relay, timing, and counting operations. The term function is used to describe instructions that, as the name implies, perform a function on data— that is, handle and transfer data within the programmable controller. These instructions are still based on the simple principles of basic relay logic, although they allow complex operations to be implemented and performed.

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

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

New additions to the basic ladder logic also include function blocks, which use a set of instructions to operate on a block of data. The use of function blocks increases the power of the basic ladder language, forming what is known as enhanced ladder language. Figure 9-2 shows enhanced functions driven by basic relay ladder instructions. As shown in the figure, a block or

a functional instruction between two contact symbols represents an enhanced functional block.

Function Block MOVE

Register-to-Table A B

Output

Enable

A B Reset

Functional Instruction A B

MOVE register to table

Figure 9-2. Enhanced functional block format.

The format representation of an enhanced ladder function depends on the programmable controller manufacturer; however, regardless of their format, all similar enhanced and basic ladder functions operate the same way. Throughout this chapter, we will refer to enhanced ladder instructions as block format instructions.

As indicated earlier, the ladder languages available in PLCs can be divided into two groups:

• basic ladder language • enhanced ladder language

Each of these groups consists of many PLC instructions that form the language. The classification of which instructions fall into which categories differs among manufacturers and users, since a definite classification does not exist. However, a de facto standard has been created throughout the years that sorts the instructions into either the basic or enhanced ladder language. Table 9-1 shows a typical classification of basic and enhanced instructions. Sometimes, basic ladder instructions are referred to as low-level language, while enhanced ladder functions are referred to as high-level language. The

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

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

M u l t i p il c a t i o n

Table 9-1. PLC instruction set classifications.

line that defines the grouping of PLC ladder instructions, however, is usually drawn between functional instruction categories. These instruction catego- ries include:

• ladder relay • timing • counting • program/flow control • arithmetic • data manipulation • data transfer • special function (sequencers) • network communication

Although these categories are straightforward, the classification of them is subjective. For example, some people believe that basic ladder instructions include ladder relay, timing, counting, program/flow control, arithmetic, and some data manipulation. Others believe that only ladder relay, timing, and counting categories should be considered basic ladder instructions.

Regardless of classification, the effects of instruction categories are simple— the more instruction categories a PLC has, the more powerful its control capability becomes. Usually, small PLCs have only basic instructions with, perhaps, some enhanced instructions. Larger PLCs usually have more

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

www.industrialtext.com

S ECTION PLC Programming C HAPTER 3 Programming

Languages 9

advanced instruction sets. However, recent advances in software develop- ment and I/O hardware have increased the computational power of small PLCs through advanced instructions. This new trend has made small PLCs very desirable in single, as well as distributed control, applications.