Introduction to PLCs

The programmable logic controller (PLC) is a microprocessor-based system that accepts input data from switches and sensors, processes that data by making decisions in accordance with a stored program, and then generates output signals to devices that perform a particular function based on the application.

An important review

It is important to review previous articles that dealt with magnetic motor starters, input and output devices, and ladder logic as they provide some necessary background for PLC operation. As you recall, the magnetic motor starter is the controller that operates the connected motor load. Two-wire and three-wire control circuits use various types of input devices to energize the coil of a magnetic motor starter. These input devices are pushbuttons, proximity sensors, liquid level sensors, photoelectric sensors, selector switches, and pressure transducers. Typical output devices are contactors, magnetic motor starters, solenoids, pilot lights, and intelligent display panels. These output devices will behave according to the connection of the input devices.

It is also important to review some background on logic functions and binary number states as they relate to PLCs. The binary number system has two numbers, namely 0 and 1. The 0 refers to a logic state low (off), and the 1 refers to a logic state high (on). Ladder logic is the symbolic language of motor control.

Two logic functions most common in motor control circuits are the “and” operation and the “or” operation. The “and” operation occurs when two contact devices are connected in series. For example, if two switches are connected in series, switch #1 “and” switch #2 must both be in the on position for the load to be energized. In terms of logic, this means switch #1 (input #1) and switch #2 (input #2) can either be in the on or off position. When both switches are on (logic state 1), the load is energized. When both switches are off (logic state 0), the load is de-energized.

The “or” operation occurs when two contact devices are connected in parallel. For example, if two switches are connected in parallel, either switch #1 “or” switch #2 can be in the on position for the load to be energized. In terms of logic, this means switch #1 (input #1) and switch #2 (input #2) can either be in the on or off position. When one of the switches is on (logic state 1), the load is energized. A truth table is a graphical way of showing how inputs and outputs behave according to logic function. The “ones” and “zeros” in the table are binary numbers that represent on and off states. Figure 3 illustrates PLC logic functions.

Figure 1. A 3-wire central circuit listing input and output fuctions

Figure 1. A 3-wire central circuit listing input and output fuctions

Figure 2. Ladder diagram as entered into PLC programing

Figure 2. Ladder diagram as entered into PLC programing

Figure 3. PLC Logic functions

Figure 3. PLC Logic functions

Necessity for a programming language

A traditional motor control circuit is normally a hardwired system; therefore, any required circuit design change is a rather involved process in terms of material and labor. The manufacturing and automotive industries were interested in automating the motor control process in a way that offered flexibility to make circuit design changes easier. The interesting challenge was to design a programming language that would allow the industrial electrician a familiar way to communicate with the electronics of the PLC. This programming language would utilize symbols encountered in conventional ladder diagrams of the hardwired variety.

The original purpose of the PLC was to allow electro-mechanical and electronic input devices to communicate with a computer that would perform logical operations on the input data and output a corresponding signal to some form of output device (see figure 2).

Understanding inputs and outputs

To properly understand PLCs, it is very important to break down functions into inputs and outputs. If we revisit the standard three-wire control circuit as shown in figure 1, you will notice there are a normally closed momentary stop pushbutton and a normally open momentary start pushbutton. These contact devices represent the input function. The coil of the magnetic motor starter represents the output function. The normally open start pushbutton energizes the coil of the magnetic motor starter and the normally closed stop pushbutton de-energizes the coil of the magnetic motor starter. In this example, the PLC would recognize two input functions; the stop and start pushbuttons, and one output function the coil of the magnetic motor starter.

In very simple terms, a PLC is designed to perform three tasks: (1) check the input status, (2) execute the program, and (3) update the output status. The PLC checks the input status by scanning each input to determine if the connected device is on or off and then records that information in memory. Next, the PLC has to execute the user program one line at a time to make decisions. For example, maybe the user program tells the PLC to turn on an output device if input #1 is on, and then turn off another output device if input #2 is off. The PLC will analyze these conditions and execute the appropriate action and then store that information in memory. Lastly, the PLC has to update the output status. This means it will send data to an output device such as the coil of a magnetic motor starter to enable some type of manufacturing process to begin. The time it takes the PLC to go through this cycle is called the scan time.

The PLC uses a programming language that is based upon readily identifiable symbols common to motor control. Handheld programmers or PCs are the most common methods for programming the PLC. Figure 2 is an example of programming code setup to perform an “and” operation. Switch #1 and switch #2 are connected in series to the coil of a relay. The first rung of the ladder diagram shows two inputs; namely, switch #1 and switch #2 and an output, namely the relay. Each rung of the ladder diagram should contain input(s) and output(s). The input(s) should be the first listed instruction and the output(s), the last listed instruction. Usually programming code requires the END command to be listed as the last instruction on the last rung of the ladder diagram.

The following specifications are for a GE Fanuc PLC. This list will give you a sense of the type of information that is important in the selection and application of the PLC.

80188 CPU 8MHZ Clock Speed

Input Points – 16

Output Points – 12

High Speed Counter – 10KHZ

Maximum User program – 1K

Registers – 256 Words

Internal Coils – 2560

Memory backup w/Lithium battery – 5 years

LED Status Indicators for I/O and CPU Status

Scan Rate – 18mS/1K of Logic

The programmable logic controller gives the end user a very flexible means to automate the control circuit process in a manufacturing environment.

Stephen J. Vidal
Stephen J. Vidal, P. E. is president of Joseph J. Vidal & Sons, Inc. in Throop, Pennsylvania. He has a B.S.E.E. with a minor in physics from Wilkes College in Wilkes Barre, Pennsylvania and a MBA from City University in Seattle, Washington. He is a registered professional engineer with the Commonwealth of Pennsylvania and holds a master contractor’s license in Wilkes Barre. He is also a general class amateur radio operator KA3KEM.