Knowing the basics of PLCs

Oct. 1, 1995
Programmable logic controllers provide dependable, high-speed control and monitoring demanded by a wide variety of automated applications.

Programmable logic controllers(PLCs) have gained a substantial hold in the industrial manufacturing arena, and we would be remiss if this technology were not given the due attention it has earned. As such, we are featuring a series of articles based on the fundamentals of PLCs in this new EC&M department covering the technology of solid-state industrial automation. Throughout this series on PLC fundamentals, we'll cover PLC hardware modules; software capabilities; current applications; installation parameters; testing and troubleshooting; and hardware/software maintenance.

What is a PLC?

The National Electrical Manufacturers Association (NEMA) defines a PLC as a "digitally operating electronic apparatus which uses a programmable memory for the internal storage of instructions by implementing specific functions, such as logic, sequencing, timing, counting, and arithmetic to control through digital or analog I/O modules various types of machines or processes."

One PLC manufacturer defines it as a "solid-state industrial control device which receives signals from user supplied controlled devices, such as senors and switches, implements them in a precise pattern determined by ladder-diagram-based application progress stored in user memory, and provides outputs for control of processes or user-supplied devices, such as relays or motor starters."

Basically, it's a solid-state, programmable electrical/electronic interface that can manipulate, execute, and/or monitor, at a very fast rate, the state of a process or communication system. It operates on the basis of programmable data contained in an integral microprocessor-based system.

A PLC is able to receive (input) and transmit (output) various types of electrical and electronic signals and can control and monitor practically any kind of mechanical and/or electrical system. Therefore, it has enormous flexibility in interfacing with computers, machines, and many other peripheral systems or devices.

It's usually programmed in relay ladder logic and is designed to operate in an industrial environment.

What's it look like?

PLCs come in various sizes. Generally, the space or size that a PLC occupies is in direct relation to the user systems and input/output requirements as well as the chosen manufacturer's design/packaging capabilities.

The chassis of a PLC may be of the open or enclosed type. The individual modules plug into the back plane of the chassis.

The electronic components are mounted on printed circuit boards (PCBs) that are contained within a module.

Where did it come from?

The first PLC was introduced in the late 1960s and was an outgrowth of the programmable controller or PC (not to be confused with the notation as used for the personal computer). PCs have been around the industry since the early 60s.

The need for better and faster control relays that fit into less space as well as the frustration over program inflexibility (hard-wired relays, stepping switches, and drum programmers) gave birth to the PC.

Although the PC and PLC have been interchanged in speech, the difference between them is that a PC is dedicated to control functions in a fixed program, similar in a sense to the past problem of limited ability. A PLC, on the other hand, only requires that its software logic be rewritten to meet any new demands of the system being controlled. Thus, a PLC can adapt to changes in many processes or monitoring application requirements.

How does a PLC work?

To know how the PLC works, it is essential that we have an understanding of its central processing unit's (CPU's) scan sequence. The methodology basically is the same for all PLCs. However, as special hardware modules are added into the system, additional scanning cycles are required.

Here's one simple scanning process that involves every PLC. First, the I/O hardware modules are scanned by the ladder logic software program as follows.

Upon power-up, the processor scans the input module and transfers the data contents to the input's image table or register. Data from the output image table is transferred to the output module.

Next, the software program is scanned, and each statement is checked to see if the condition has been met. If the conditions are met, the processor writes a digital bit "1" into the output image table, and a peripheral device will be energized. If the conditions are not met, the processor writes a "0" into the output image table, and a peripheral device (using "positive logic") remains deenergized.

A PLC interfaces numerous types of external electrical and electronic signals. These signals can be AC or DC currents or voltages. Typically, they range from 4 to 20 milliamperes (mA) or 0 to 120VAC, and 0 to 48VDC. These signals are referred to as I/O (input/output) points. Their total is called the PLC's I/O capability. From an electronic point-of-view, this number is based on how many points the PLC's CPU is able to look at, or scan, in a specified amount of time. This performance characteristic is called scan time. From the practical perspective of the user, however, the number of I/O modules needed as well as the number of I/O points contained on each I/O module will drive what the system's I/O capability should be.

It's important to have sufficient I/O capability in your PLC system. It's better to have more than less so that, when more I/O points are required at a future time, it's easier to write the existing spare I/O points into the software (since the hardware is already there). There's no harm to the operating system in having spare I/O points; the software can be programmed to ignore them, and these points will have a negligible effect on the PLC's scan time.

The PLC's software program

The software program is the heart of a PLC and is written by a programmer who uses elements, functions, and instructions to design the system that the PLC is to control or monitor. These elements are placed on individually numbered rungs in the relay ladder logic (RLL). The software's RLL is executed by the processor in the CPU module or controller module (same module, different name).

There are many types of PLC software design packages available. One frequently selected software package is of the RLL format and includes contacts, coils, timers, counters, registers, digital comparison blocks, and other types of special data handling functions. Using these elements, the programmer designs the control system. The external devices and components are then wired into the system identical to that of the programmer's software ladder logic. Not all of the software elements will have a hard-wired, physical counterpart, however.

As the PLC's processor scans (topdown) through the software program (rung-by-rung), each rung of RLL is executed. The hard-wired device that the software is mirroring then becomes active. The software is thus the controlling device and provides the programmer or technician the flexibility to either "force a state" or "block a device" from the system operation. For example, a coil or contact can be made to operate directly from the software (independent of the control cabinet's hard-wiring to source or field input devices). Or, a device can be made to appear invisible (removed from the system's operation), even though it's electrically hard-wired and physically in place.

Individual PLC sections

Common to all PLCs are four sections, each of which can be subdivided into smaller but equally important sections. These primary sections include the power supply section, which provides the operating DC power to the PLC and I/O base modules and includes battery backup; the program software section; the CPU module, which contains the processor and holds the memory; and the I/O section, which controls peripheral devices and contains the input and output modules.

Power supply section. The power supply (PS) section gets its input power from an external 120VAC or 240VAC source (line voltage), which is usually fused and fed through a control relay and filter external to the PS. In addition, the PS has its own integral AC input fuse.

This line voltage is then stepped-down, rectified, filtered, regulated, voltage- and current-protected, and status-monitored, with status indication displayed on the front of the PS in the form of several LEDs (light-emitting diodes). The PS can have a key switch for protecting the memory or selecting a particular programming mode.

The output of the PS provides low DC voltage(s) to the PLC's various modules (typically, with a total current capability of 20A or 50A) as well as to its integral lithium battery, which is used for the memory backup. Should the PS fail or its input line voltage drop below a specific value, the memory contents will not change from what they were prior to the failure.

The PS output provides power to every module in the PLC; however, it does not provide the DC voltages to the PLC's peripheral I/O devices.

CPU module. "CPU," "controller," or "processor" are all terms used by different manufacturers to denote the same module that performs basically the same functions. The CPU module can be divided into two sections: the processor section and the memory section.

The processor section makes the decisions needed by the PLC so that it can operate and communicate with other modules. It communicates along either a serial or parallel data-bus. An I/O base interface module or individual on-board interface I/O circuitry provides the signal conditioning required to communicate with the processor. The processor section also executes the programmer's RLL software program.

The memory section stores (electronically) retrievable digital information in three dedicated locations of the memory. These memory locations are routinely scanned by the processor. The memory will receive ("write" mode) digital information or have digital information accessed ("read" mode) by the processor. This read/write (R/W) capability provides an easy way to make program changes.

The memory contains data for several types of information. Usually, the data tables, or image registers, and the software program RLL are in the CPU module's memory. The program messages may or may not be resident with the other memory data.

A battery backup is used by some manufacturers to protect the memory contents from being lost should there be a power or memory module failure. Still others use various integrated circuit (IC) memory technologies and design schemes that will protect the memory contents without the use of a battery backup.

A typical memory section of the CPU module has a memory size of 96,000 (96K) bytes. This size tells us how many locations are available in the memory for storage. Additional memory modules can be added to your PLC system as the need arises for greater memory size. These expansion modules are added to the PLC system as the quantity of I/O modules are added or the software program becomes larger. When this is done, the memory size can be as high as 1,024,000 (1024K) bytes.

Manufacturers will state memory size in either "bytes" or "words." A byte is eight bits, and a bit is the smallest digit in the binary code. It's either a logic "1" or a logic "0." A word is equal in length to two bytes or 16 bits. Not all manufacturers use 16-bit words, so be aware of what your PLC manufacturer has defined as its memory word bit size.

Software program. The PLC not only requires electronic components to operate, it also needs a software program. The PLC programmer is not limited to writing software in one format. There are many types available, each lending itself more readily to one application over and above another. Typical is the RLL type previously discussed. Other S/W programs include "C," State Language, and SFC (Sequential Function Charts).

Regardless of which software is chosen, it will be executed by the PLC's CPU module. The software can be written and executed with the processor in an online state (while the PLC is actually running) or in the off-line state (whereby the S/W execution does not affect current operation of the I/O base).

In the RLL software program, we find several types of programming elements and functions to control processes both internal to the PLC (memory and register) as well as external (field) devices. Listed below are some of the more common types of elements, functions, and instructions:

* Contacts (can be either normally opened or closed; highlighted on the monitor means they are active).

* Coils (can be normal or latched; highlighted means they are energized).

* Timers (coil can either be ON or OFF for the specified delay).

* Counters (can count by increments either up or down).

* Bit shift registers (can shift data by one bit when active).

* One-shot (meaning active for one scan time; useful for pulse timer).

* Drums (can be sequenced based on a time or event).

* Data manipulation instructions (enable movement, comparison of digital values).

* Arithmetic instructions (enable addition, subtraction, multiplication, and division of digital values).

Peripheral devices

Peripheral devices to the PLC and its I/O base(s) can be anything from a host computer and control console to a motor drive unit or field limit switch. Printers and industrial terminals used for programming are also peripheral devices.

Peripheral devices can generate or receive AC or DC voltages and currents as well as digital pulse trains or single pulses of quick length (pulse width).

These external operating devices, with their sometimes harsh and/or fast signal characteristics, must be able to interface with the PLC's sensitive microprocessor. Various types of I/O modules (using the proper shielded cabling) are available to do this job.

Input module

The input module has two functions: reception of an external signal and status display of that input point. In other words, it receives the peripheral sensing unit's signal and provides signal conditioning, termination, isolation and/or indication for that signal's state.

The input to an input module is in either a discrete or analog form. If the input is an ON-OFF type, such as with a push button or limit switch, the signal is considered to be of a discrete nature. If, on the other hand, the input varies, such as with temperature, pressure, or level, the signal is analog in nature.

Peripheral devices sending signals to input modules that describe external conditions can be switches (limit, proximity, pressure, or temperature), push buttons, or logic, binary coded decimal (BCD) or analog-to-digital (A/D) circuits. These input signal points are scanned, and their status is communicated through the interface module or circuitry within each individual PLC and I/O base. Some typical types of input modules are listed below.

* DC voltage (110, 220, 14, 24, 48, 15-30V) or current (4-20 mA).

* AC voltage (110, 240, 24, 48V) or current (4-20 mA).

* TTL (transistor transistor logic) input (3-15VDC).

* Analog input (12-bit).

* Word input (16-bit/parallel).

* Thermocouple input.

* Resistance temperature detector.

* High current relay.

* Low current relay.

* Latching input (24VDC/110VAC).

* Isolated input (24VDC/85-132VAC).

* Intelligent input (contains a microprocessor).

* Positioning input.

* PID (proportional, intregal, differentiation) input.

* High-speed pulse.

Output module

The output module transmits discrete or analog signals to activate various devices such as hydraulic actuators, solenoids, motor starters, and displays the status (through the use of LEDs) of the connected output points. Signal conditioning, termination, and isolation are also part of the output module's functions. The output module is treated in the same manner as the input module by the processor.

Some typical output modules available today include the following:

* DC voltage (24, 48,110V) or current (4-20 mA).

* AC voltage (110, 240v) or current (4-20 mA).

* Isolated (24VDC).

* Analog output (12-bit).

* Word output (16-bit/parallel).

* Intelligent output.

* ASCII output.

* Dual communication port.

TERMS TO KNOW

A/D: A device or module that transforms an analog signal into a digital word.

Address: A numbered location (storage number) in the PLC's memory to store information.

Analog input: A varying signal supplying process change information to the analog input module.

Analog output: A varying signal transmitting process change information from the analog output module.

Baud rate: The number of bits per second that is either transmitted or received; also the speed of digital transmission acceptable by a device.

BCD: Binary coded decimal. A method used to express the 0-thru-9 (base 10) numbering system as a binary (base 2) equivalent.

Bit: A single binary digit.

Byte: Eight bits.

Central Processing Unit (CPU): An integrated circuit (IC) that interprets, decides, and executes instructions.

D/A: A device or module that transforms a digital word into an analog signal

Electrically Erasable Programmable Read-Only Memory (EEPROM): Same as EPROM but can be erased electrically.

Erasable Programmable Read-Only Memory (EPROM): A memory that a user can erase and load with new data many times, but when used in application, it functions as a ROM. EPROMs will not lose data during the loss of electrical power. They are nanvolatile memories.

Image register/image table: A dedicated memory location reserved for I/O bit status.

Input module: Processes digital or analog signals from field devices.

I/O points: Terminal points on I/O modules that connect the input and output field devices.

Millisecond: One thousandth of a second (1/1000 sec, 0.001 sec).

Modem: Modem is an acronym for modulator/demodulator. This is a device that modulates (mixes) and demodulates (separates) signals.

Operator interface: Devices that allow the system operators to have access to PLC and I/O base conditions.

Output module: Controls field devices.

Parallel data: Data whose bytes or words are transmitted or received with all their bits present at the same time.

Program: One or more instructions or statements that accomplish a task.

Programming device: A device used to tell a PLC what to do and when it should be done.

Random Access Memory (RAM): A memory where data can be accessed at any address without having to read a number of sequential addresses. Data can be read from and written to storage locations. RAM has volatile memory, meaning a loss of power will cause the contents in the RAM to be lost.

Read-Only Memory (ROM): A memory from which data can be read but not written. ROMs are often used to keep programs or data from being destroyed due to user intervention.

Software: One or more programs that control a process.

Robert B. Hee is an electronic/electrical engineer in private practice in Virginia Beach, Va.

Voice your opinion!

To join the conversation, and become an exclusive member of EC&M, create an account today!

Sponsored Recommendations