PLCs

Basic Programming for PLCs 241

Basic Programming for PLCs provides an overview of the basic principles, structure, and instructions of PLC programming. Most PLC programs use instructions written in ladder logic, which is a graphical programming language. During programming, PLC programmers enter instructions and save them to the PLC’s CPU. Most program instructions are either input or output instructions. Other common instructions include sealing and latching, one-shot, timer, counter, and sequencer instructions. Program instructions are entered with programming devices while the PLC is in program mode.

PLCs are widely used throughout industry and PLC-based automation is continually growing. PLC operators and programmers must understand how PLCs work in order to function effectively and efficiently in this growing field. After taking this class, users will have a foundational knowledge of PLC programming concepts, instructions, and functions.

  • Difficulty Intermediate

  • Format Online

  • Number of Lessons 16

  • Language English

TO GET STARTED SPEAK WITH A SPECIALIST AT 1.866.706.8665

Or fill out this form and a specialist will contact you shortly

Course Outline
  • PLC Programs
  • Programming with Ladder Logic
  • Programming with Function Block Diagram
  • Operating Modes
  • Programming Devices
  • Data Files and Addresses
  • Review: PLC Programming
  • Input Instructions
  • Output Instructions
  • Sealing and Latching Instructions
  • One-Shot Instructions
  • Other Instructions
  • Review: Programming Instructions
  • PLC Operating Cycle
  • PLC Program Operation
  • Final Review
Objectives
  • Describe PLC programs.
  • Describe ladder logic PLC programs.
  • Describe function block diagram PLC programs.
  • Distinguish between program mode and run mode.
  • Describe PLC programming devices.
  • Describe data files and addresses.
  • Describe input instructions.
  • Describe output instructions.
  • Distinguish between sealing and latching instructions.
  • Describe one-shot instructions.
  • Describe other program instructions.
  • Describe the operating cycle of a PLC.
  • Describe the operating cycle of a PLC.
Glossary
Vocabulary Term
Definition

accumulated value

A number programmed into a PLC counter or timer instruction that lists the current units of time or actions that have accrued during a process. When the accumulated value equals the preset value, the counter or timer must reset before it begins counting or timing again.

address

The unique label that identifies the location of the data for an input device, output device, or other saved data in the CPU's memory. Addresses are listed alongside associated devices or data in a PLC ladder diagram.

automation

The use of self-regulated equipment, processes, or systems that meet manufacturing requirements with limited human intervention. Many automation operations use PLCs for control.

binary digits

The smallest unit of information on a computer. Binary digits, or bits, are either 1s or 0s.

branch

A logical and parallel path coming off a rung of a PLC ladder program or diagram. Branches contain additional program instructions for a PLC.

central processing unit

CPU. The microprocessor device inside a computer that controls system activities. The central processing unit executes a PLC program and performs all logic activities for the system.

coil

A bundle of wire that is wrapped continuously around a magnetic core. Coil symbols represent output instructions in a ladder logic program.

communication links

A channel that connects two or more devices on a network. A communication link may be a physical medium or a logical connection.

conditions

The true or false logic status of an input or output instruction. The conditions present on a rung directly determine the presence or absence of logical continuity.

contact

A conductive device that connects to other conductive components to allow electricity to flow between them. Contact symbols represent input instructions in a ladder logic program.

count down

CTD. A counter instruction that decreases the current value by a specific increment every time an input transitions from false to true. Count down instructions begin counting at the set accumulated value and decrease by one until they reach the preset value.

count up

CTU. A counter instruction that increases the current value by a specific increment every time an input transitions from false to true. Count up instructions start from zero and continue counting until the accumulated value matches the preset value.

counter

A set of program instructions that allows a PLC to keep track of actions or events in a process and to respond when a specific count is reached. Counters can be programmed to count up to or down from a preset value.

counters

A set of program instructions that allows a PLC to keep track of actions or events in a process and to respond when a specific count is reached. Counters can be programmed to count up to a preset value or down from an accumulated value.

CPU

Central processing unit. The microprocessor device inside a computer that controls system activities. The CPU executes a PLC program and performs all logic activities for the system.

CTU

Counter up. A counter instruction that increases the current value by a specific increment every time an input transitions from false to true. Count up instructions start from zero and continue counting until the accumulated value matches the preset value.

current

The flow of electricity through a circuit. Current creates the logical continuity in ladder logic.

data

Digital information about an application or process. Data is transmitted and processed in a PLC as 1s or 0s.

data files

The area of a CPU's memory that contains status bit and numerical information. Data files store all relevant information for each instruction entered into a program.

diagnostics

A set of computer instructions for investigating or analyzing the cause or nature of errors or failures in the PLC. Diagnostics will keep a PLC and its program running correctly.

done bit

DN. A status bit that either sets or turns off when the accumulated value is equal to the preset value. Done bits function differently for counter instructions and timer instructions.

examine if closed

XIC. An input instruction that prompts a CPU to look for an on, or true, condition in a referenced input device. The examine if closed, or normally open, instruction is logically true if the associated input device is on.

examine if open

XIO. An input instruction that prompts a CPU to look for an off, or false, condition in a referenced input device. The examine if open, or normally closed, instruction is logically true if the associated input device is off.

function block

A box-shaped element that contains program instructions. Function block instructions can make decisions or calculations and generate outputs.

function block diagram

FBD. A graphical programming language that uses a box format to display instructions. Function block diagrams can describe the relationship between inputs and outputs.

graphical languages

A type of programming language that uses symbols and figures to develop a program. Graphical languages include ladder logic and function block diagrams.

handheld programmer

HHP. A device with a screen and keypad that programmers use to enter sets of operating instructions for a PLC. Handheld programmers can also be used for troubleshooting the PLC system.

hardwired

A fixed connection between electrical and electronic components and devices by means of wires. Hardwired relays have largely been replaced by PLCs.

input file

The memory area in the CPU that stores the on/off status of input connections. Input files contain the input signals of the program scan in the CPU's operating cycle.

input instructions

A command in a ladder logic program that communicates with the PLC's processor to examine a contact. Input instructions that are true allow the logical continuity of a rung.

input module

The portion of a PLC that contains connection points for input devices and circuitry to convert electrical current. An input module sends input signals to the CPU.

internal relay output

An output instruction attached to an internal address rather than an output device. Internal relay outputs typically activate subsequent input instructions in a ladder logic program.

internal relays

Software instructions used within a PLC program that simulate the physical connections of relay circuits. Internal relays have an address in the program memory.

inverts

Reverses. An XIO instruction inverts logic conditions from 0 to 1 and vice versa.

ladder diagrams

A representation of a ladder logic program that uses symbols to represent the on and off status of input/output devices. Ladder diagrams also contain internal program instructions, such as counter, timer, or sequencer instructions.

ladder edit toolbar

A set of ladder logic instruction icons or buttons that are part of a PLC software program's interface. The ladder edit toolbar contains instructions such as inputs, outputs, counters, and timers.

ladder logic

A graphical PLC programming language that uses simple symbols to indicate the status of input and output devices. Ladder logic displays program instructions in a ladder diagram.

latching

Maintaining an output instruction's on or off condition until it receives its next command. Latching is achieved with output latch and output unlatch instructions.

leading edge

The off-to-on transition of an input instruction. A leading edge activates a one-shot rising instruction.

logic gates

A basic building block of a PLC program that instructs the CPU to perform a logical operation on a true or false input to produce a true or false output. Logic gates create paths for how the PLC should operate the rung.

logical continuity

The flow of logic on a rung based on true conditions. Logical continuity mimics the flow of electricity from left to right.

memory

The portion of a computer where data is stored. Memory storage can be built into the central processing unit of a PLC or can be in the form of a removable device.

memory address table

A diagram displaying the logical 0s and 1s of a system's memory address. A memory address table records the input and output statuses.

mnemonics

An instruction presented in a short, easy-to-remember form. Mnemonics allow a programmer to input instructions without using symbols.

normally closed instruction

An input instruction that prompts a CPU to look for an off, or false, condition in a referenced input device. The normally closed, or examine if open, instruction is logically true if the associated input device is off.

normally open instruction

An input instruction that prompts a CPU to look for an on, or true, condition in a referenced input device. The normally open, or examine if closed, instruction is logically true if the associated input device is on.

offline programming

Writing and storing a program in a programming device that is not connected to a PLC. Offline programming allows the program to be developed first and then later downloaded to a PLC.

one-shot instruction

A program instruction that energizes an output instruction for only one program scan. A one-shot instruction is often used with counters in a PLC program.

one-shot rising

OSR. A program instruction triggered by a leading edge that energizes an output instruction for only one program scan. One-shot rising is the most common one-shot instruction.

online programming

Writing or editing a program on a programming device connected to a running PLC. Online programming can potentially affect the operation of a PLC when modifications are made.

operating cycle

A series of steps that the central processing unit of a PLC performs during run mode. The operating cycle repeats as many times as necessary to complete the program.

OR gate

A basic logic gate that excludes one of two or more entities among a group of entities based on the conditions of the logical statement. An OR gate requires one or more inputs to be true in order for the output to be true.

output devices

A physical device connected to a PLC that performs a desired action after receiving an electrical signal from the output module. Output devices include components such as motors, lamps, and solenoids.

output energize

OTE. An output instruction that is true if all input instructions on a rung are true and is false if any input instructions on the rung are false. An output energize instruction that is true energizes the associated output device.

output file

The memory area in the CPU that stores the on/off status of output connections. The output file contains the output results of the program scan in the CPU's operating cycle.

output instructions

A command in a ladder logic program that communicates with the PLC's processor to energize an output. Output instructions cause a PLC to operate corresponding output devices.

output latch

OTL. An output instruction that turns on an output device and allows the device to remain on even if the rung changes to false. The output latch instruction cannot turn a device off and must always appear with an output unlatch instruction.

output module

The portion of a PLC that contains connection points for output devices and circuitry to convert electrical current. An output module sends signals to output devices.

output unlatch

OTU. An output instruction that turns off the device that was turned on by an output latch instruction. The output unlatch instruction cannot turn a device on and must always appear with an output latch instruction.

PCs

Personal computer. A processor-driven device for an individual user and commercial software. A PC may be used as a programming device for a PLC.

personal computer

PC. A processor-driven device for an individual user and commercial software. A personal computer may be used as a programming device for a PLC.

PLC

Programmable logic controller. A processor-driven device that uses logic-based software to provide electrical control to machines. PLCs are used in factory automation.

PLC program

The instructions entered into a central processing unit that direct the PLC to control input/output devices. A PLC program contains lines of instruction.

PLC programmers

A person responsible for programming a PLC. PLC programmers develop program instructions that tell a PLC what functions to perform.

points

A connection point on an input/output module for a field device wire. Points correspond to the input/output bit address.

preset value

A number programmed into a PLC counter or timer instruction that lists a target number. Preset values for counters list a specific number of actions or events to be counted, while preset values for timers list a specific unit of time that must elapse.

processor status

Controller operation information used to troubleshoot controller and program operation. Processor status allows a program to check the PLC operation and make changes.

program mode

An operating mode on the CPU that is active when loading new program instructions, monitoring a program, or making changes to a program. During program mode, the CPU does not perform the operating cycle.

program scan

A step in the operating cycle of a central processing unit during which it reads and executes a PLC program. The program scan requires the CPU to save the on/off condition of the output points.

programmable logic controller

PLC. A processor-driven device that uses logic-based software to provide electrical control to machines. Programmable logic controllers are used in factory automation.

programming device

The physical component used to enter a program into a PLC's memory. Programming devices include personal computers and handheld programmers.

programming language

A standard set of rules used to present information to a processor. Programming languages are used to create programs for a PLC.

proprietary

Designed by a specific company for use only with its own systems or devices. Proprietary components include physical hardware, such as programming devices, and software components, such as programming software.

proximity sensor

A device that detects a change in a physical condition and turns it into an electrical signal. Proximity sensors are common input devices.

pulse

A momentary true signal received by a program instruction. A pulse activates an instruction for only one program scan.

rails

A vertical line in a PLC ladder logic program that represents a power supply line in the circuit. Rails are on the left and right sides of rungs.

references

A tag that contains an input, output, or data address stored in the memory. References function similarly to ladder logic instructions.

retentive timer

RTO. A timer instruction that keeps track of how much time has passed and stores the value even if the timer stops timing. A retentive timer stores values until the timer is reset.

run mode

An operating mode on the CPU that allows the PLC to execute the steps of a program and complete an operating cycle. During run mode, no changes can be made to a program.

rungs

A horizontal line in a PLC ladder logic program that contains instructions for the PLC. Rungs are read from left to right.

scans

Reads or examines systematically. The PLC CPU scans the ladder program before executing commands.

seal-in

An input instruction that allows an output instruction to maintain its on condition. Seal-in instructions are placed in parallel with an input instruction and given the same address as the corresponding output instruction.

sealing

Maintaining an output instruction's on condition with an auxiliary input instruction after a momentary input instruction returns to an off condition. Sealing uses a parallel input instruction with the output's address.

sequencer

A set of program instructions that determines the order in which a PLC performs a group of processes. Sequencer instructions can be time-driven or event-driven.

sequencer compare

SQC. A sequencer instruction that compares input data with data that has been stored in memory. Sequencer compare instructions are typically used to monitor or troubleshoot machines.

sequencer load

SQL. A sequencer instruction that loads the current data into the sequencer data file in the CPU. A sequencer load instruction can record and load information from each source into a memory address table.

sequencer output

SQO. A sequencer instruction that determines the output conditions for the next step of the process. Sequencer output instructions are only enabled once certain conditions are met.

sheets

The backdrop on which the function block diagram is written. Sheets contain series of function block diagrams.

signal

A current that carries data from one device to another. Signals are sent to and from the CPU.

software

The programs and instructions that control a computer's hardware functions and operations. Software communicates with the PLC.

status bit

A binary digit that represents the true (1) or false (0) condition of a program instruction. Status bits are recorded in an instruction's data file.

textual languages

A type of programming language that is input into a PLC using a keyboard and stored as text files. Textual languages include structured text and instruction lists.

time base

A value programmed into a PLC timer instruction that specifies the rate at which the timer increases. A time base value specifies units of time.

timer

A set of program instructions that allow a PLC to control and monitor time-dependent aspects of machines and processes. Timer instructions can delay an output from turning off or on for a preset amount of time.

timer address

The unique label that identifies the location of a timer in the CPU's memory. A timer address is written as T4 followed by a colon and a number that indicates the location.

timer off delay

TOF. A timer instruction that waits to energize an output device after receiving an off signal from an input. A timer off delay instruction may be used in a cooling cycle operation.

timer on delay

TON. A timer instruction that waits to turn on an output device after receiving an on signal from an input. A timer on delay instruction may be used as a safety feature.

timers

A set of program instructions that allows a PLC to control and monitor time-dependent aspects of machines and processes. Timer instructions can delay an output from turning off or on for a preset amount of time.

troubleshoot

To systematically approach problems in order to solve them quickly and efficiently. To troubleshoot a PLC, programmers and technicians use a logical process of elimination to identify the source of a problem.

user-defined

Named or categorized by a program user. User-defined files may consist of any internal relay data or functions.

user-developed program

PLC instructions written by a programmer. A user-developed program is custom-made for the specific operation needed.

wire connectors

An element in a function block diagram program that connects different function blocks to one another without using a wire. Wire connectors connect function blocks that are on different sheets.

wires

A line that connects references to function blocks. Wires map the path of the flow of data between function blocks and their elements.

words

A group of 16 binary digits treated as a unit. Words contain the specific status bits for program instructions.

XIC

Examine if closed. An input instruction that prompts a CPU to look for an on, or true, condition in a referenced input device. The XIC, or normally open, instruction is logically true if the associated input device is on.

XIO

Examine if open. An input instruction that prompts a CPU to look for an off, or false, condition in a referenced input device. The XIO, or normally closed, instruction is logically true if the associated input device is off.