PLC Technician Handbook 2022 EditionF
PLC Technician Handbook 2022 EditionF
PLC Technician Handbook 2022 EditionF
www.gbctechtraining.com
PLCs have become an integral part of manufacturing in the twenty-first century and now dominate industrial
automation. To have a meaningful and successful career in the field requires a thorough understanding of the
key foundational skills and theoretical concepts of PLCs.
The PLC Technician’s Handbook was developed to be a compact collection of fundamental content for
practicing automation and PLC technicians to reference through their career. The handbook is broken down
into three sections for easy reference: first, a series of articles including basic programming & tips and
common practices, second, programming examples, and third, supplemental information such as instruction
sets of the main ladder logic programming commands and important schematic symbols.
Special thanks to Dwayne Nehls, Shimona Babb and Surajit Barua for their valuable assistance and
contribution to the creation of the handbook.
We hope that this handbook helps you develop a fuller understanding and practice with PLCs and becomes
a useful reference to you in the future.
3
TABLE OF CONTENTS
BASICS OF PROGRAMMING
Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
2. Program Examples
Decision Making . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
3. Supplemental Content
4
A General Overview of PLCs
The world of manufacturing has been changing rapidly over the past decade. Processes are largely automated
and as a result, the quality of products that are produced and the efficiency of systems that produce them is
at an unprecedented level. Despite these changes, programmable logic controllers have remained a critical
component of these systems despite being invented in the 1960s.
PLCs come in a variety of sizes and with different capabilities, but all include the following six essential systems:
• Structured Text
PROCESSOR
• Ladder Diagram
RUN I/O
FORCE RS232
• Sequential Function Chart BAT OK
• Instruction List
Rack or Mounting
Though not a universal truth, most medium to large
PLC systems are assembled so that their individual
components (things like the CPU or processor, the
I/O, and power supply) are held together within a
mounting or rack. Smaller PLC systems often contain
all of the components into one compact housing
(often referred to as a shoebox, or brick). Processor
Output Assembly
Outputs are the pieces of equipment used by the
PLC to execute the commands, and are typically
used to control a manufacturing process (motors,
pumps, actuators, lights, etc.).
1. Analog I/O refers to inputs and outputs that are responsible for a range (e.g. the running speed of
a motor). This type of input operates based on continuous change of variable ranges (temperature,
pressure, etc.) In this case, the output would include setting the speed of the motor.
2. As the name implies, Specialty I/O performs specific tasks, controlling things like high speed counters.
Digital I/O operates in using a binary change (yes/no or on/off).
The PLC Technician program uses the PLCLogix simulation software to teach students about the I/O assembly.
The image above is an example of the software’s interface, containing two discrete input modules, two discrete
output modules, two TTL modules for BCD control and display, and two analog modules.
Power Supply
If the CPU is the brains of the PLC, then certainly the power supply is the digestive system, commonly supplying
the unit with a 24VDC or 120VAC line voltage. The power supply status is continuously monitored and can
include a switch for selecting a particular programming mode. Thanks to the power supply’s integral lithium
battery, in the event of a power failure the contents
stored in memory will not change from what they were
POWER
prior to the loss of power.
ability to test and practice PLC programs. Students can apply the knowledge acquired from this program in
the real world PLC environments.
In the most basic terms, a programmable logic controller (PLC) is a computer that’s equipped with a
microprocessor, but has no keyboard, mouse, or monitor. Though this description might make it seem like PLCs
suffer from limited functionality, quite the opposite is true. In fact, PLCs are built to drive the most complicated
manufacturing processes and withstand very harsh industrial environments. This article will examine how these
sophisticated machines are used in different industries.
Oil Industry
Public opinion may be shifting away from fossil fuels in favor of more ecologically friendly alternative energy
sources, but there is still a strong demand for the extraction of oil and natural gas. Unfortunately, many of
the world’s remaining reserves are difficult to access, meaning that companies are pivoting away from the
historically simple, vertically drilled, single well operations to multi-well operations made possible by directional
or non-vertical drilling. While this process is more efficient (multi-well operations allow companies to drill more
than one well at each site, meaning that operations can be centralized and less impact to the surrounding
environment), it is also more complicated, so a more robust system is needed to control the site’s equipment.
For accurate readings of inputs and outputs and to control the multitude of valves, pumps, and sensors that
allow each well and well pad to operate safely is controlled by its own PLC. PLCs are often paired with a Human
Machine Interface, or HMI, that allows users to monitor the health of the system, manually override controls,
view system alarms, or get a glimpse of the system in operation in real time.
PLCs allow resource gathering operations to scale up in size with relative ease, since additional PLCs can be
added to the system as new well pads are added. PLCs and HMI systems also help maintenance crews quickly
identify potential issues on site, resulting in less wasted time performing system diagnostics.
Glass Industry
While PLCs can efficiently control actuators and valves and perform actions based on data gathered by sensors,
these are not the only uses for PLCs in an industrial setting. In fact, the glass industry has widely used PLCs for
many years to help manage the precise material ratios required by the production process. The manufacturing
of glass is a surprisingly complicated endeavor and is largely made possible in part by the robust data gathering
capabilities and advanced quality control afforded by PLC technology when paired with a Distributed Control
System (DCS). At one point, glass manufacturers relied exclusively on their DCS for their operations, but the
associated high cost of these systems propagated a need for a less costly alternative.
In recent years, the equipment used in the manufacture of glass has become more sophisticated, further
increasing the demand for PLC solutions that are based on a DCS, which in turn is driving the demand for
technicians who have completed PLC programming courses.
Cement Industry
Much like the production of glass, the cement industry relies heavily on equipment and software capable of
mixing various raw materials with consistency so that the quality of the finished product is at a consistently high
level. The role of the PLC in this industry varies, but in particular, PLCs control ball milling, coal kiln, and shaft
kiln operations.
Under Control
Admittedly, the above represents just a few of the industries that rely on PLCs in the manufacture of their
products. PLCs can be found in most factories when automation is used including those that mass produce
food, vehicles, textiles and more.
Nowadays, with almost every service imaginable available to us on our smartphone, it’s difficult to envision
what technology was like before the invention of a single controller. For factories and manufacturing plants, the
invention of programmable logic controllers (or PLCs) revolutionized the industrial automation process, as its
cutting-edge technology replaced a complicated system of electromagnetic relays with a singular controller.
In industrial workplaces, PLCs are still the preferred choice over other systems. The system has evolved to
incorporate modern technologies, while maintaining the durability of the design to withstand the conditions in a
factory setting.
In order to gain the best understanding and appreciation of PLCs, it’s important to look at the history of the PLC,
how it has evolved, and why it still remains one of the most important automation inventions used today.
Industrial automation began long before PLCs. In the early 1900s until their invention, the only way to control
machinery was through the use of complicated electromechanical relay circuits. Each motor would need to be
turned ON/OFF individually. This resulted in factories needing massive cabinets full of power relays.
As industrial automation continued to grow, modern factories of the time needed dozens of motors with ON/
OFF switches to control one machine, and all these relays had to be hardwired in a very specific way. PLCs were
developed as a solution to have one solid control as an electronic replacement for hard-wired relay systems.
Known as “The Father of the PLC,” Dick Morely first came up with the vision of a programmable controller which
could work for every job. He put the proposal together on January 1, 1968. Along with the team at his company
(Bedford and Associate) they created a design for a unit which would be modular and rugged while using no
interrupts. They called it the 084, which was named after their 84th project.
At the same time as the 084, Bill Stone with GM Hydramatic (automatic transmission division of General Motors)
was having the same issue: problems with reliability and documentation for the machines in his plant. His
solution proposed a solid-state controller as an electronic replacement for hard-wired relay systems.
For this reason, Morely insists he is not the inventor of the PLC. Morley stated: “the programmable controller’s
time was right. It invented itself because there was a need for it, and other people had that same need.”
PLCs were designed so that they could easily be understood and used by plant engineers and maintenance
electricians, using a software called Ladder Logic. Widely used in PLCs today, Ladder Logic is a programming
language which uses ladder diagrams which resemble the rails and rungs of a traditional relay logic circuit.
In the next few decades, the PLC evolved in numerous ways to adapt to various environments and integrate the
latest modern technologies.
The emergence of competitors who developed similar systems which rivalled Modicon sparked the need for
new innovations. As a result, the development of the “Data Highway” by Allen-Bradley and “Modus” by Modicon
allowed PLCs to exchange information with each other.
As PLCs became more widely adopted, the need for a vendor-independent standardized programming language
for industrial automation led to the introduction of the IEC 61131-3 standard — the international standard held
for PLC software made by the International Electrotechnical Commission.
At the start of the 1990s, end users began making special requests. Plant managers wished for the new
machinery to have industrial terminals with PLC monitoring software. They wanted machines which could tell
the technicians what was amiss rather than spend hours troubleshooting; this resulted in the development of the
programmable human-machine interface (HMI).
The implementation of HMI with new devices eventually brought internet connection to the factory floor.
There continues to be an increase in demand for skilled and qualified technicians who receive PLC training.
Many technical colleges and institutions offer PLC training online as a convenient option for those who wish to
expand their professional qualifications while still working. Adding a PLC Technician Certificate to your existing
resume opens the possibility for new job opportunities, promotions, and higher pay.
Qualified PLC Technicians are valuable to any manufacturing plant or industrial workplace. As the technology
of the PLC evolves, there is a demand for employees with skills in the fundamentals of PLC programming. PLC
classes online offer simulation software which enables you to design, run, test, and debug ladder logic programs
and simulate the operation of real-world PLC applications.
Programmable Logic Controllers (PLCs) are general-purpose control devices often used in plants or
manufacturing systems. They provide both a useful and efficient control solution for a variety of applications,
and can accept inputs from a variety of devices, such as motion detectors, joysticks and buttons, amongst
others. In turn, PLCs are able to produce outputs that control lights, motors and sound effects, amongst others.
Programming resources for this input-output system can include timers, counters and other variables.
While PLCs can be very effective in their commercial applications, they come with a steep learning curve. There
is some difficulty in learning their functionality as well as inherent difficulty with program maintenance using their
traditional Relay Ladder Logic (RLL) programming language. It should also be noted that PLCs from different
manufacturers can be programmed in various ways.
If you’re an aspiring PLC technician or considering enrolling in an online PLC training course, there are three
primary PLC programming languages of which you should be aware.
You can then connect these boxes to create the larger PLC program. Almost all PLC programs are written, at
least partially, with FBD, because it offers the technician the ability to connect various functions together. The
function blocks are integral to this programming language, as they delineate the relationship between input and
output functions.
Within the FBD language, there are a few standard blocks. Amongst the most important ones include:
• Edge Detection
• Counter-Function Blocks
There is an infinite number of function blocks provided within a FBD, and oftentimes, one exists for almost every
operation that can be performed within PLC programming, including:
Additionally, many PLC technicians and enthusiasts will often build their own function blocks.
2. Ladder Diagram
Also called Ladder Logic, Ladder Diagram (LD) is a visual PLC programming language, which one can learn fairly
quickly. Those with experience with electric relay circuits may find LD programs relatively easy to grasp, as the
two look very similar. The organization, PLCOpen, has established the standards for LD making it one of the only
standardized PLC programming languages. Essentially, each function is coded into a rung and once many rungs
join together in a program, they make what looks like a ladder.
LD was created for technicians and electricians who have a background reading and understanding electrical
circuit schematics. Rather than using text, LD programming uses graphic elements called symbols, which have
been made to look like electrical symbols. An important difference, however, is that while electric circuits are
drawn horizontally, LD programs are created vertically.
As you construct the LD program vertically, the PLC will execute one rung (or symbol) at a time, as each symbol
in the ladder is an instruction. When you create a new piece of ladder logic, you will notice two vertical lines,
and it’s in between these two lines where you’re
ladder logic will live. You’ll proceed to draw vertical
connections between the original lines, creating the
rungs of information. You can then proceed to include
any of the aforementioned symbols within these
rungs, forming the instructions for the PLC. Executing
the program one rung at a time, the PLC will typically
scan all of its inputs and then proceed to execute the
program to set outputs. A few common symbols, or Examine If Closed
instructions, include:
There are a number of other symbols involved in LD programs, a few of which include:
JSR
JSR Jump to This instruction jumps
Subroutine Jump to Subroutine execution to a specific routine
Routine name ? and initiates the execution of
Input par ? this routine, called a
Return par ? subroutine.
SBR
SBR Subroutine Stores recurring sections of
Subroutine
program logic.
Input par ?
?
LBL Label Target of the JMP instruction
LBL with the same label name.
3. Structured Text
The Structured Text (ST) programming language is text-based and is often regarded as one of the easiest
languages to understand for beginners and for those building programs that will be read by others. While
graphics-based programs, such as the aforementioned FBD or LD, may seem easier to decipher, using a
text-based language (such as ST) will take up less space and allow users to more easily follow the logic of
the program. Another benefit of ST is that it can be combined with different programming languages. For
example, you can create function blocks containing functions written in ST, and because ST is a standardized
programming language you can proceed to program different PLC brands with it.
Similar to ladder logic, programs written in ST are executed one line at a time. The basic syntax of ST revolves
around “Program” and “End_Program” which sandwich your PLC program, as seen below:
It’s important to note that the “End_Program” command will not end your program definitively, but rather instruct
the PLC scan cycle to start over again causing your program to repeat itself.
Your PLC programming software will likely implement the “Program”/”End_Program” construct automatically,
prompting you to write the code needed to fill the construct. While there are many syntax details that govern ST,
there are some general rules of which you should always be mindful:
Program
• ST is not case-sensitive: while it’s good practice to use
sentence-case for readability, it’s not necessary
Let’s look at the basic structure of a PLC and how it operates. In general, a PLC takes stimulus from the outside
world and brings it into a computing environment. Decision or monitoring instructions within the PLC process the
input information and instruct the outputs of the PLC to react to the stimulus in a determined manner. Field devices
bring status information to the PLC, the program interprets the information and will then discern the appropriate
actions or output to provide in response to the given input conditions. The adoption of PLC’s has resulted in the
replacement of the majority of Relay Control Logic which has been historically used to control applications.
Programming Terminal
Input Output
Devices Devices
Memory
Power Supply
Above, we have a functional diagram representing the major components of a PLC system. The input and output
devices can allow for a range of voltages or currents, and can be digital or analog in nature. The specifics of the
I/O are largely dependent on the type of control application being performed. The actual PLC contains several
sections not detailed in the block diagram including facilities for communications.
Exe
What is a Scan Cycle? ts
cu
te
pu
In
Pr
Generally, PLC’s operate by repeating what is called a “Scan
og
ad
ram
Re
Cycle”. This cycle consists of four basic functions. First, the
inputs are read, next the program instructions are executed after
which diagnostics and any required communications occurs,
and finally, the outputs are updated. One important aspect of
PLC Scan Cycle
the scan cycle is the “Scan Time”. This is the total time it takes
ns
for the PLC to perform a complete scan cycle. This time can
c a s/
Up
n i s tic
ti o
da
be critical in applications that require real time monitoring and n
o
O ag
te
control. ut
pu Di m u
ts
Com
There are several types of languages or approaches used for programming PLCs. These include Structured
Text, Instruction Lists, Function Block Diagraming, as well as Ladder Logic programming. For the benefit of
those technicians who have no programming experience, we will be working with the ladder logic programming
approach in our discussions going forward. It uses a format that would be the most familiar for technicians who
work with electronics and industrial control equipment. This programming language is based on relay logic as
was used traditionally for industrial control applications so many aspects of it will be familiar to those technicians
who have been working in the field.
Field_Device_Input OTE_Output_Coil
<I:1/0> <O:2/0>
OTE_Output_Coil Controlled_Output
<O:2/0> <O:2/1>
Application control programs generally consist of 2 types of routine segments; time driven segments and event
driven segments that generally either direct a series of timed events or provide a desired response to changing
conditions in the environment. In addition to these two basic routine segment types, programs often also
include a means of repeating routine segments a desired number of times. Here we examine Time Driven routine
segments with a simple practical everyday example.
The ON duration timer is used to start the OFF duration timer. The OFF duration timer is used to reset the
ON duration timer and restart the cycle. This type of application can be used for something as simple as
flashing lights.
As a quick visual review, here is the T4 timer file data structure for a single timing instruction. We recall that this
structure consists of 3 Words of 16 bits length each. This allows for the storage of timers bit status, (DN, TT, EN)
as well as the “Preset” and “Accumulated” time values.
The TON delay timer instruction has 3 useful status bits, the enable (EN), timer timing (TT), and done (DN) bits.
These are the primary bits used to drive timed routine segments. Below, find the basic operation of this type of
timing instruction explained as well as how the status bits respond during operation. This TON instruction can
be used to turn on or off an output after a given period of time has expired. The instruction counts time base
intervals ( 0.1s) when the rung condition it is on becomes TRUE. As long as the rung condition remains true,
the timer modifies its accumulated value (ACC) time each iteration until it reaches the preset value (PRE). The
accumulated value gets reset when the rung condition goes false regardless of whether the timer has timed out
or not. The status bit behaviour is as follows:
Timer Enable Bit EN (bit 15) rung conditions are true rung conditions go false
In addition to the TON delay timer instruction, two other timer instructions are included in the basic instruction
set. The TOF delay timer, and the RET or retention timer. The retention timer functions much the same way as
the TON delay timer with a couple exceptions. The Accumulated value is not reset when the rung condition goes
false, it is kept. This allows the time interval to be interrupted, and then resumed without losing the current time
value. The other significant difference with this instruction is that it requires a reset (RES) instruction to clear its
accumulated value.
Check out the video using cascading timers to make an elevator door routine in ladder logic. This video
provides an excellent example of the instructions we have covered to date, namely, coils, contacts, and timers
and provides an illustration of cascading timers to perform a cyclic operation such as opening and closing
elevator doors.
Let’s review a simple Event Driven program segment using another staple of relay logic control systems, the
drum sequencer. This real-world control device has an associated virtual ladder logic instruction.
EXAMPLE
Field_Stimulus
<I:1/0>
SQO Click on the link that
1 Squencer Output
EN illustrates the operation
File #B3:0 of an SQO while
Mask ffffh DN explaining how Masking is
Dest O:2
accomplished when sending
Control R6:0
Length 4 a data table to a specified
Position 0 output location. Masking is
explained and the operation
of the sequencer pointer is
illustrated.
SQO Squencer
The pointer will move from through these locations, and when it reaches B3:4, it will wrap back to location B3:1.
The O:2 output will be passed each value stored from B3:1 to B3:4. The maximum number of values that can be
stored in any one data table is 255 as we need 1 location to be designated as the origin of the table and as we
learned in our earlier discussion of data files, the B3 file can hold 256 words.
We will take a brief look at how the virtual version of a counter is implemented when programming modern day
PLCs to perform industrial control applications. We will also illustrate how a technician can become familiar with
the wide variety of additional instructions used with the AB SLC 500 series of controllers. What is the difference
between the CTU and CTD counter instructions?
When programming PLCs, we encounter 2 basic types of counters, an UP counter or CTU instruction, and a
DOWN counter or CTD instruction. As you may have intuited, CTU counter instructions start at a user defined
value (stored in the ACC or accumulated field of the instruction), and count up or increment the value each time
a “false to true transition” occurs on the rung on which the instruction is located. The CTD instruction is used to
decrement a user defined (again a value stored in the ACC field for the instruction) value each time the rung on
which this instruction is located exhibits a “false to true” transition. In both instances, a field device such as a
special purpose sensor, physical wand, or a proximity detector causes an input rack location to change states.
Information pertaining to these counter instructions is stored in the C5 (counter) data file location. In addition
to the individual counter types, (up or down counter), it is possible to combine these instructions to create a
counter bi-directional counter or “counter pair”.
Up_Count
<I:1/1>
CTU
1 Count Up EN
Counter C5:1
Preset 100
DN
Accum 10
Down_Count
<I:1/2>
CTD
CD
Count Down
Counter C5:1
Preset 100 DN
Accum 10
C5:0 0 0 0 0 0 0 0
C5:1 0 0 0 0 0 100 10
C5:2 0 0 0 0 0 0 0
C5:3 0 0 0 0 0 0 0
C5:4 0 0 0 0 0 0 0
C5:5 0 0 0 0 0 0 0
C5:6 0 0 0 0 0 0 0
C5:7 0 0 0 0 0 0 0
In the above illustration, the “Counter” field for both the CTU and CTD instructions reference the same memory
storage location, C5:1 (also shown in the figure). Each memory location in that file stores the CU (up count
enabled), CD (down count enabled), DN (done), OV (overflow), UN (underflow) status bits as well as the Preset
and Accumulated value for counters that share the C5 reference. In this example, the Preset value is set to 100.
Notice that value is shared and displayed as the Preset value for both counters. The current Accumulated value
is 10 and it is also shared and displayed in each instruction. When the I:1/1 contact closes, the CTU counter is
triggered. This will increment the Accumulated value stored in the C5:1 memory location and the modified value
will be displayed in both instructions. When the I:1/2 contact closes, the Accumulated value will be decremented
and will return to the value of 10. Each of the existing counters is capable of modifying this Accumulated value.
They also share bit status. In this way, a running count can be incremented or decremented by field events (state
transitions at the I:1 input module referenced by the contacts on the rung.
EXAMPLE
Click on the link to demonstrate the behavior of an up/down counter pair employed to keep a running
count value that can be incremented or decremented as required. The video outlines an elevator hoist
routine that uses a running count to track the elevator car location.
Is sharing a data file storage address among multiple instructions a common thing?
There are other instructions capable of employing a shared memory location reference. Another common
instruction that employs the use of this reference sharing technique would be the SQO sequencer output
instruction. It is possible to have several of these sequencer instructions all sharing the same R6 control data
file memory location, while referencing different Source file locations. The objective in this instance would be
the sharing of the POS (position) value. This would move the file pointer in each of the referenced source files in
step with each other. Technicians would use this facility to create a virtual Sequencer Table and send parts of the
table data to different output or instruction field locations. A sequencer table could store the output pattern for
the lights in a traffic light application.
A separate sequencer table could store the timing information for each step in the light sequence. As the pointers
move together, each output light pattern (being sent to the output locations controlling the lights) is stepped
through, the corresponding time duration for each step can be sent to the Preset field of a timer instruction.
How do you research the behavior of the wide variety of instructions available with
SLC 500 series controllers?
The basic extended instruction set is detailed in the vendors User’s Instruction Set Reference Manual. The guide
lists the available instructions, and describes the operation and data associated with each instruction. As the
instructions are too numerous to be expounded upon in this format, it is important to familiarize yourself with
this resource.
When we think about technologies which have revolutionized industrial automation, we often think about a
specific piece of hardware we interact with, rather than the software behind the scenes. For factories and
manufacturing plants, the Programmable Logic Controller (PLC) dramatically improves efficiency and control; yet
it’s the SCADA software which runs all the operations smoothly.
To understand the basics of SCADA systems, it’s important to know what they are, their functions and
components, and their place in modern industrial workplaces.
The basic SCADA architecture begins with PLCs or Remote Terminal Units (RTUs). These microcomputers
receive data from the sensors and machinery within a factory or operation, then route the information to
computers running the SCADA software. The software processes, distributes, and displays information on a
Human Machine Interface (HMI) for a human operator to make decisions based on the information.
SCADA systems were first introduced to the factory floor after the implementation of industrial computers,
primarily PLCs. The term “SCADA system” was coined in the early 1970s, as the software which allowed
automated communications to transmit data from remote sites to monitoring equipment. Some of the biggest
industries that use SCADA include oil and gas, food and beverage, automotive, and chemicals. A basic SCADA
system has several key components and functions, which is what we’ll explore below.
A SCADA system has four primary functions: data acquisition, network data communication, data presentation,
and control.
1. Data Acquisition
SCADA systems acquire data from sensors and network devices connected to PLCs. They measure parameters
such as speed, temperature, weight, flow rate, gaseous emissions and pressure. This raw data is then sent to a
PLC to process, and then on to an HMI for a human operator to analyze and make decisions as required.
3. Data Presentation
SCADA systems report data to either an HMI or a HCI (Human Computer Interface), where the information is
displayed to a human operator. This master station continuously monitors all sensors and alerts the operator
when there is an “alarm” or dysfunction - when a control factor is not functioning within normal operational
range.
4. Control
SCADA systems can be programmed to perform certain control decisions based on data collected from the
sensors. Control functions may include turning power on/off, adjusting temperature, decreasing or increasing
speed, and regulating a variety of industrial processes.
Digital or analog inputs and sensors are responsible for measuring and controlling the status and parameters of
a machine. Their primary function is data acquisition, which is then sent to the PLCs or RTUs. PLCs and RTUs
are small industrial computers which collect data from the inputs and sensors and report the information in a
meaningful way. They serve as local collection points for gathering reports and also deliver commands to control
relays. Data collected from multiple PLCs is subsequently sent to a central HMI.
HMIs serve as the master and satellite computer stations which allow a human operator to analyze all the
collected data from networked devices and sensors. The information is often displayed in graphical pictures
and maps representing machines and devices, data charts, and performance reports. Based on the information,
the human operator can make informed decisions to optimize the efficiency of the production process. The
communications network is what allows data to be sent between the machines, PLCs, and operators. SCADA
systems typically use a closed LAN for local geographical areas, or WANs to connect to different regions.
Without a correctly designed communication network, a SCADA system would not be able to function.
This article provides an introductory understanding of the “File Based Addressing” scheme used with 16-bit
(500 series) PLC’s from Allen Bradley. Although addressing schemes are proprietary in nature, Allen Bradley’s
approach can serve as a valid representation of the addressing schemes generally employed by this generation
of controller, and the principals set out in this article can be easily applied to 16-bit controllers offered by a host
of other vendor’s. PLC memory allocation consists of 2 general areas: program files, and data files. Each section
consists of 256 files, some of which are predefined, while others are flexible and can be used to suit the needs
of a given application. The part of the file based addressing scheme that will be discussed in this article, resides
within the 256 files contained in the Data Files section of PLC memory. Files 0 through 8 in the data files section
are standard and predefined as shown in the figure below. Files 9 through 255 can consist of any of the available
file types depending on the user’s needs. The figure below lists the 11 basic data file types, Output, Input,
Status, Bit, Timer, Counter, Control, Integer, Floating point, String, and ASCII. These files store data and values
pertaining to I/O, instructions, processor status, as well as variables in data tables. All these file types can be
referenced using the File Based Addressing scheme.
What is an address?
An “address” is essentially a means of referencing a location in memory. Addresses allow for physical I/O as well
as the data or status of instructions/elements to be accessed by the controller. These values are stored in the
Data Files portion of the PLCs memory. The Data File section of memory is organized into 11 general file types.
Each file type is denoted by a specific letter which is used at the start of all associated addressing.
An input address related to terminal connection 12 on an input module situated in slot 3 of the I/O rack would
have the address I:3/12. This address contains 3 alpha numeric characters and 2 delimiters. The address starts
with the memory file type “I” denoting its location in the input file. The next item in the address is the delimiter
“:”. This delimiter is used to separate the file type from the slot number containing the input module that is being
referenced, in this instance slot 3. After the slot number is specified, a second delimiter (a backslash), separates
the slot number from the actual terminal connection point (0-15) on the input module. The state of this terminal
connection point, (high or low in the case of discrete I/O) will be stored in the input file. A 16-bit word, stored
in the input file, is used to represent each one of the input modules present in the I/O rack. Each terminal, on a
given module, is represented by a single bit in that 16-bit word. Bits 0 through 15 in the stored word correspond
to terminals 0 through 15 on the input module. The values appearing at these terminals (high or low for discrete
modules) will be stored to the corresponding memory location in the “I” (input) File.
An output address follows the same format as an input address. It consists of 3 alpha numeric values and 2
delimiters. Data pertaining to output addresses are stored in the “O” File. A discrete output can be turned on
or off by storing a high or low value to a memory location associated with a specific terminal in a specific I/O
rack slot location. As an example, if you wish to turn on a device connected to terminal 7 of the output module
located in slot 2 of the I/O rack, you would store a 1 value to the address O:2/7. Once again, the “O” (output) File
is organized into a data table of 16-bit words. Each terminal on the output module corresponds to a single bit
in a given word. Each output module in the rack will correspond to a separate word in the data table contained
in the file. Module terminals will present the state (high or low for discrete I/O) that has been stored to the
corresponding “O” (output) File in memory.
In addition to addresses referencing physical terminals in the I/O rack, it is common to reference “Virtual
Outputs” using this addressing scheme. A virtual output is an output that does not physically exist in the I/O
rack. For instance, if 8 slots in the rack are populated with modules of various types, a virtual output can be
referenced by specifying a slot number that is not present or in use. The address O:10/0 is an example. Since
there is no slot 10 in the rack, there is no module associated with this address. This does not mean, however,
that there is not a word “10” in the data table in the “O” (output) File. Virtual outputs can be used as internal
memory locations to store status or data without referencing an actual terminal on an output module.
Now let’s examine the addressing format for these 3 files, as well as examine some specialty files that store
custom data structures used to hold information pertaining to timers, counters, and control elements. These
addresses as well as the structure of the associated timer (T), counter (C) and control (R) files are a bit more
involved than the straightforward I/O addressing we have examined so far.
Here is a quick review of the “I” (input) and “O” (output) addressing scheme.
Where:
indicates the input or output file is to be used (file 0 or file 1 of the 256 available data
I or O
files)
: is the element delimiter
e is the slot number of the I/O module
. is the word delimiter
is the word number (only used when more than 16 inputs or outputs contained in a
s
single slot)
/ is the bit delimiter
b is the terminal number on the I/O module (0-15)
In addition to addressing physical I/O locations, virtual outputs can be addressed by specifying a slot number
that is beyond the range of the number of slots that have defined modules located in the rack. As an example,
the address O:10/0 would denote a virtual output whose data is stored in the 11th element in the output data
file. This is a virtual output if no output module was defined to exist in slot 10 of the I/O rack.
Where:
indicates the bit file is to be used (B3 is the default, B9 to B255 can be used if
B3
additional storage is required)
: is the element delimiter
e is the element number (16 bit word). The value can range from 0 to 255
/ is the bit delimiter
b is the bit number within the element specified. The value can range from 0-15.
Where:
indicates the bit file is to be used (B3 is the default, B9 to B255 can be used if
B3
additional storage is required)
/ is the bit delimiter
b is the bit number within the entire data file table (can range from 0-4096)
In summary, a status bit in the B3 data file table can be referenced in either one of two ways. If we want to
address bit 3 in the 2nd element in the B3 data file, we can specify this memory location as B3:1/3 or we can
alternately specify this memory location as B3/19. For ease of use, it is generally recommended that you use the
element designation format as it allows for an additional layer of categorization when organizing status flag bits.
Where:
indicates the integer file is to be used (N7 is the default, N9 to N255 can be used if
N7
additional storage is required)
: is the element delimiter
e is the element number (16 bit word). The value can range from 0 to 255
/ is the bit delimiter
b is the bit number within the entire data file table (can range from 0-15)
As an example, to store or read a value from the 4th element in this data file table, you would use the address
N7:3 to identify the specific memory location for that integer value. Again, in general usage, you would not often
have the need to specify a particular bit within the stored integer value.
Where:
indicates the integer file is to be used (N7 is the default, N9 to N255 can be used if
F8
additional storage is required)
: is the element delimiter
is the element number. Each element consists of two 16 bit words. The value can
e
range from 0 to 255
Floating point information can only be used by instructions that accept the REAL data type. Not all basic
instructions can be used with floating point values stored in this data file table.
How do you reference information contained in data files specifically intended for
use with instruction set items?
So far, we have covered addressing schemes that deal with data files that store information regarding physical
I/O as well as variables that are used with PLC program. In addition to these types of data files, we will now take
a look at some of the data file types used with the instructions that are available in the instruction set for the 500
series of AB controllers. There are 3 data file types which are intended for use with specific instructions. The
T4 data file is used for storing timer variables and status bits. The C5 data file is used to store values relating
to counter variables and status bits, and lastly the R6 data file is used to store information and status bits for
“control items. (this last category would include sequencers, the FIFO and LIFO data stack instructions, as well
as bit shift instructions among others. Each of these 3 data file types consists of 256 elements, each of which is
comprised of three 16 bit words making these the largest of the data file types. We will move on now, to take a
brief look at the addressing format for each of these data file types.
Where:
indicates the timer file is to be used (T4 is the default, T9 to T255 can be used if
T4
required)
: is the element delimiter
e is the element number (each element contains three 16 bit words)
. is the word delimiter
is the word number (word 0 is the control word, word 1 is the preset value, word 2 is
s
the accumulated value)
/ is the bit delimiter
b is the bit number in the specified word (0-15)
means there are two ways to reference items in the control word (word 0) of a timer element. In the examples
and explanation below, we are assuming that we are addressing the 6th element in the timer data file. (Timer
T4:5 would be the general reference for this timer in a program)
In either instance of the above, (for both PRE and ACC addresses) you can add a designation specifying the
particular bit inside either of these words in the element. For example, if we want to reference the least
significant bit (bit 0) of the accumulated value of the 6th timer element in the table, we can do so as follows:
In summary, the status as well as preset and accumulated values can all be referenced down to the single
bit level. The timer elements each contain three 16-bit words that are addressable using the file based
addressing scheme. Individual bits inside each of these words can be referenced as well as then entire word
in the case of the Preset and Accumulated values (word 1 and 2 in the element). In addition, there are several
standard letter combinations that can be used in place of specific bit or word numbers. These letters provide
easily identifiable references, and it is recommended that they be used in place of the more obscure number
only approach.
Where:
indicates the counter file is to be used (C5 is the default counter data file, C9 to C255
C5
can be used if required)
: is the element delimiter
e is the element number (each element contains three 16 bit words)
. is the word delimiter
is the word number (word 0 is the control word, word 1 is the preset value, word 2 is
s
the accumulated value)
/ is the bit delimiter
b is the bit number in the specified word (0-15)
In either instance of the above, (for both PRE and ACC addresses) you can add a designation specifying
the particular bit inside either of these words in the element. For example, if we want to reference the least
significant bit (bit 0) of the accumulated value of the 3rd counter element in the table, we can do so as follows:
In summary, the counter data file type contains 256 elements, each of which is made up of three 16-bit words.
These elements and the subsequent addressing scheme follow the same format laid out for the timer (T4) data
file type. The only significant difference pertains to the control word bits that are addressable, and the letters
used to denote them.
Where:
indicates the control file is to be used (R6 is the default counter data file, R9 to R255
R6
can be used if required)
: is the element delimiter
e is the element number (each element contains three 16 bit words)
. is the word delimiter
is the word number (word 0 is the control word, word 1 is the length value, word 2 is
s
the accumulated value)
/ is the bit delimiter
b is the bit number in the specified word (0-15)
Once again, in either instance of the above, (for both LEN and POS addresses) you can add a designation
specifying the particular bit inside either of these words in the element. For example, if we want to reference the
least significant bit (bit 0) of the length value or the position value of the 1st control data element in the table, we
can do so as follows:
To summarize, Control Data files are used with several instructions. This data file type uses elements consisting
of three 16-bit words. As with the timer and counter data files, the first word, word 0, is used to store status bits
used for the specific instructions that are employing the data file
Let’s examine scan time and its impact on everyday PLC applications as well as examine how it can be reduced.
Scan time is an important metric to be considered in many high-speed PLC applications. The time it takes to
perform a single scan cycle can have significant impact on the input stimulus and/or output control signals
present or required for high-speed applications. Specialty I/O modules are often employed in these situations
and offer significant advantages.
That said, it is important to note that scan cycle time can also be of significance for general applications as well.
Although they may not have the extreme constraints and dependencies of high-speed applications, general
applications, such as a simple multiplexing program segment, can have practical limitations that can relate
directly to scan time. The impact scan time has on the operation of timers can be significant. It is generally
accepted that an understanding of the impact of scan time along with some basic knowledge of how it can be
reduced is important when learning how to program a PLC with ladder logic.
We will examine a simple example of each of the following 5 tips over the next two blogs:
1. Place instructions/conditions that are most likely to be false at the start of a rung to reduce the number
of instructions seen during the scan.
2. Avoid duplicating unique tag/instruction combinations when creating ladder logic programs whenever
possible. A change in architecture can often reduce the total number of instructions used in a program
reducing memory usage as well as scan time.
3. Program flow control can be key to significant reductions in scan time. Use the JMP and LBL
instructions to reduce the active segments of a running program.
4. Compartmentalizing tasks (making modular processes) and organizing them can have significant
impact on scan time. Passing variables can allow for program segments (subroutines) to be used in
multiple instances.
5. Avoid floating point arithmetic and try to use integers wherever possible. If you need better than
integer precision, consider multiplying all your floats by 10, 100, or 1000 to get integers.
Motor_Down
<Local:2:O.Data.1>
The “Stop PB” pushbutton field device is a normally closed momentary contact switch. When the application is
running, the normally open contact associated with it closes due to the state of the pushbutton in the field. For
this reason, the branch part of the seal in, should appear to the left of the “Stop PB” pushbutton contact on the
rung. The Stop PB contact will be closed most of the time during program execution. It should not be the first
instruction scanned on the rung. This small effect can have a significant impact on scan cycle time cumulatively.
Station_1_PB Pilot_Light
<Local:3:I.Data.0> <Local:4:O.Data.0> Latch_Bit_1
0 L
Pilot_Light
<Local:4:O.Data.0> Latch_Bit_1
Station_1_PB Pilot_Light
<Local:3:I.Data.0> Latch_Bit_1 <Local:4:O.Data.0>
1 L
Pilot_Light
Latch_Bit_1 <Local:4:O.Data.0>
The program segment above is optimized and does not use any unique tag/instruction combinations more than
once. If the application called for the use of a second station, one could copy this structure and modify the tags
to create the program segment shown below:
Station_1_PB Pilot_Light
<Local:3:I.Data.0> <Local:4:O.Data.0> Latch_Bit_1
0 L
Pilot_Light
<Local:4:O.Data.0> Latch_Bit_1
Station_1_PB Pilot_Light
<Local:3:I.Data.0> Latch_Bit_1 <Local:4:O.Data.0>
1 L
Pilot_Light
Latch_Bit_1 <Local:4:O.Data.0>
Station_2_PB Pilot_Light
<Local:3:I.Data.1> <Local:4:O.Data.0> Latch_Bit_2
2 L
Pilot_Light
<Local:4:O.Data.0> Latch_Bit_2
Station_2_PB Pilot_Light
<Local:3:I.Data.1> Latch_Bit_2 <Local:4:O.Data.0>
3 L
Pilot_Light
Latch_Bit_2 <Local:4:O.Data.0>
Although this was an easy way to accomplish our objective, we have introduced a duplication of 4 tag/
instruction combinations. The XIO, XIC, OTL and OTU instructions are appearing twice with the “Pilot_Light”
alias tag in the version above. The impact of this redundancy would increase for each additional station that may
be required. An alternate topology can be the way to resolve this redundancy issue.
The program segment shown below will function identically to the version having 2 stop/start stations we
examined previously.
0 L
Latch_Bit_2
Pilot_Light
<Local:4:O.Data.0> Latch_Bit_1
Latch_Bit_2
Station_1_PB Pilot_Light
<Local:3:I.Data.0> Latch_Bit_1 <Local:4:O.Data.0>
1 L
Station_2_PB
<Local:3:I.Data.1> Latch_Bit_2
Pilot_Light
Latch_Bit_1 <Local:4:O.Data.0>
Latch_Bit_2
This version of the program segment uses 4 instructions less than the previous version. It contains no duplicate
tag/instruction combinations and this new topology is easy to expand upon when additional stations may be
required. It was not immediately apparent that there was another way to organize the required logic for this
example, but time should be taken for the attempt as it is always worth the effort when successful and can have
a significant impact on scan cycle time as well as memory usage.
3. Use the JMP and LBL instructions to reduce the volume of program code being
executed during each scan cycle.
Program flow is an area in which significant reduction in scan time is possible.
In the example below, the motor 2 and motor 3 rungs are skipped over when the “Enable_Jump” contact
is closed on rung 1. At that time, the JMP instruction is encountered and program execution jumps to the
“Label_1” LBL instruction location on rung 4 skipping over rungs 2 and 3. This concept can be used to jump
over large portions of a program that are not being used at any given time in a production cycle. This has the
potential to greatly reduce the number of rungs being scanned and subsequently can significantly reduce an
applications scan cycle time.
Motor_1
<Local:2:O.Data.1>
Enable_Jump
<Local:1:I.Data.6> Label_1
1 JMP
Motor_2_Run Motor_2
<Local:1:I.Data.2> <Local:2:O.Data.2>
Motor_3_Run Motor_3
<Local:1:I.Data.3> <Local:2:O.Data.3>
Motor_4_Run Motor_4
Label_1 <Local:1:I.Data.4> <Local:2:O.Data.4>
4 LBL
Station_2_PB Motor_5
<Local:3:I.Data.1> <Local:2:O.Data.5>
The ability to skip over rungs is not the only way that the JMP and LBL instructions can be utilized to reduce
scan cycle time. Suppose you are monitoring a series of inputs for specific changes in state, and that the nature
of these state changes will determine what series of actions will consequently occur. In a situation such as this,
creating a program loop to execute only the rungs needed to monitor the inputs will ensure that scan cycle time
is not a deterrent to providing rapid responses to any input state changes.
Scan
N
Scan
Jump Label
Not
Scanned
Scanned
Label Jump
N
Sca
Continue Scan
Scan
Not
Scanned
Jump Label
Scanned
d
Label Jump
Not
Scanned
inue Scan
This is often accomplished by creating a “zone” that is defined by the location of the JMP and LBL instructions
in your program. This zone is scanned from top to bottom and then program execution loops back to the start
of the defined zone again. This will continue until an exit condition allows program execution to resume outside
the loop. It is obvious that these techniques can have significant impact on the scan cycle and that program flow
management using the JMP and LBL instructions can be a powerful tool providing a degree of control over scan
cycle times.
of two values in several calculations being made. Creating a subroutine that can be called in more than one
circumstance avoids the need to duplicate any of the instructions needed to find an average value. Values are
passed into the routine and a result is passed out as shown below.
Calculate_Average
<Local:1:I.Data.0>
JSR
0 Jump To Subroutine
Routine Name GetAverage
Input Par Variable_1
Input Par Variable_2
Return Par Average
SBR JSR
0 Subroutine Jump To Subroutine
Input Par Sub_Value_1 Routine Name GetAverage
Input Par Sub_Value_2 Input Par Variable_1
Input Par Variable_2
Return Par Average
DIV
Divide
Source A Sub_Sum
100
Source B 2
Dest SubResult
50
RET
Return from Subroutine
Return Par Sub_Result
The JMP and LBL instructions allow you to focus on a segment or skip over segments. The JSR and RET
subroutine instructions allow program segments to be used multiple times instead of creating multiple instances
of them. The program flow instructions are great tools for managing scan cycle times.
5. Avoid floating point arithmetic and try to use integers wherever possible.
This general practice shortens scan cycle time as the instructions that use the REAL data type take up more
memory, use more resources to function and require more cycles than the INT data type variables. As an
example, suppose we have an analog input signal ranging from 0 to 10 volts and the sensor is providing 2
decimal places of accuracy. A value such as 8.34 V would be an example of the type of input coming to the
analog input channel. Multiplying the value by 100 will remove the decimal portion of the value and create a
whole number that can be used with the INT data type. It can be said that in general it is beneficial to work with
INT or DINT data types when doing math operations by scaling values at the input of output point of a process.
An analog output control signal should be generated using INT or DINT data types and converted to a REAL
value, within output range, just prior to being sent out when at all possible.
MUL
008.6 V 0 Multiply
Source A Local:7:I.Ch-Data
8.6
Source B 100
DIV
1
Divide 008.6 V
Source A Scaled_Input_Value
860 Local:8:O.Ch0Data
Source B 100
Dest Local:8:O.Ch0Data
8.6
This program segment takes an analog input value between 0.00 and 10.00 and converts it to a whole number
value ranging from 0 to 100. This scaled value can be operated on using DINT data type variables at that point.
The value is being scaled back to the 0 to 10 range before being sent to an output module location.
Scan cycle time is an application parameter that can have varying significance to a process. In instances where
scan time is critical, knowing ways to reduce its impact on an application can be extremely helpful. Following
these 5 tips on reducing scan cycle time and they will help you to manage this parameter in cases where it may
be critical to normal operation.
PLC timer instructions emulate the behaviour of “Time Delay Relays” and their associated contacts. The two
basic types of timer instructions used to achieve the desired behaviours are the TON on delay timer and the TOF
off delay timer.
All timer instructions share a common structure and use the “TIMER” datatype. The datatype has storage
for timer “Preset” and “Accumulated” values as well as the three significant status bits used with this kind
of instruction. (EN enable, TT timer timing, and DN done). The behaviour of these status bits is key to
understanding how the behaviour of time delay relays has been replicated using these simple instructions with
normally open and normally closed contacts. We can begin with a quick review of the operation of the TON and
TOF delay timer instructions with respect to their status bit behaviour.
Timing Diagrams and general behaviour of the TON vs TOF timer instructions
Timer Rung:
Enable:
Done:
Here we have the timing diagram associated with a TON delay timer instruction. When the timer rung goes high
in the figure above, the TON timers EN bit goes high. It will remain high as long as the rung condition is true.
In addition to the EN bit going high, the TT, (timer timing) bit also goes high and the timer begins timing out its
“preset” time duration (10 seconds in the example graph above). The TT bit remains high until the specified
duration times out at which point the TT bit goes low and the DN (done) bit goes high. The DN bit will remain in
this state until the rung condition for the timer transitions back to the false (low) state.
Below we have a similar timing diagram, this time, it illustrates the behaviour of the three significant status bits
with the TOF delay timer instruction.
PROGRAM EXAMPLES 44
PLC Timer Instructions - the four types of timed relays they emulate
Timer Rung:
Enable:
Done:
The EN (enable) bit for the TOF delay timer instruction behaves exactly like that of its counterpart. When the
timer rung goes high, the EN bit goes high and remains high as long as the rung remains true (high). The DN bit
is also enabled when the timing rung goes high. This is distinctly different behaviour than that of the TON
version. When the timer rung transitions from high to low, (true to false) the TT bit goes high, and the timer
begins timing out its preset time duration (10 seconds in the above example). The DN bit remains high during
this period. When the specified period times out, the TT bit goes low, and the DN bit also goes low returning the
timer status bits to their rest state.
Now that we have reviewed the basic operation of the status bits and the TON and TOF timing diagrams, lets
take a look at how they are employed to replace timed relay contacts used with older hardwired control systems.
Listed below are the four timed relay contact behaviours performed by these two timer types. The timer type
used to perform each of these functions is also provided:
Use the TON on delay timer done (DN) status bit to reproduce the behaviour of:
Use the TOF off delay timer done (DN) status bit to reproduce the behaviour of:
PROGRAM EXAMPLES 45
PLC Timer Instructions - the four types of timed relays they emulate
NOTC and NCTO timed relay behaviour using the TON delay timer:
Slot 1 Slot 2
00 Toggle_Switch NOTC_Pilot_Light 00
01 NCTO_Pilot_Light 01
02 02
03 03
Toggle_Switch
<Local:1:I.Data.0>
TON
0 Timer On Delay
EN
Timer TON_Timer
Preset 10000 DN
Accum 0
NOTC_Pilot_Light
TON_Timer.DN <Local:2:O.Data.0>
NCTO_Pilot_Light
TON_Timer.DN
<Local:2:O.Data.1>
The above figure is a ladder logic program that illustrates the use of the TON delay timer to provide NOTC
and NCTO time delay relay contact behaviour. The two outputs in the program segment will behave as if time
delay relays are being used to enable them. Although we are not discussing the value fields used with these
instructions in this article, it should be noted that for a TON on delay timer instruction, the accumulated value is
reset to zero if the timer rung transitions to false at any time. The preset value remains unchanged.
PROGRAM EXAMPLES 46
PLC Timer Instructions - the four types of timed relays they emulate
NOTO and NCTC timed relay behaviour using the TOF delay timer:
Slot 1 Slot 2
00 Toggle_Switch NOTO_Pilot_Light 00
01 NCTC_Pilot_Light 01
02 02
03 03
Toggle_Switch
<Local:1:I.Data.0>
TOF
0 Timer Off Delay
EN
Timer TOF_Timer
Preset 10000 DN
Accum 0
NOTO_Pilot_Light
TOF_Timer.DN <Local:2:O.Data.0>
NCTC_Pilot_Light
TOF_Timer.DN
<Local:2:O.Data.1>
The TOF timer instruction is used to emulate the behaviour of the NOTO and NCTC type of timed relays. Initially,
the output on rung 1 is low and the output on rung 2 is high. (Rung 1 Normally Open, Rung 2 Normally Closed).
When the timer rung goes high, rung 1 goes high and rung two goes low. When the timer times out, the output
on rung 1 returns to its at rest low state for a TO or “timed open” finish, and the output on rung 2 goes back to
its initial high state providing the TC or “timed closed” portion of the behaviour.
While the behaviour of the TON delay timer instruction illustrated in the previous section is somewhat intuitive,
the TOF timer is often the source of confusion when considering the NOTO and NCTC behaviours that this type
of timer instruction emulates.
PROGRAM EXAMPLES 47
PLC Timer Instructions - the four types of timed relays they emulate
Slot 1 Slot 2
00 Toggle_Switch EN_Pilot_Light 00
01 Reset_Pushbutton TT_Pilot_Light 01
02 DN_Pilot_Light 02
03 03
Field_Device_Input
<I:1/0>
RTO
0 Retentive Timer On
EN
Timer RTO_Timer
Preset 10000 DN
Accum 0
EN_Pilot_Light
RTO_Timer.EN <Local:2:O.Data.0>
TT_Pilot_Light
RTO_Timer.TT <Local:2:O.Data.1>
DN_Pilot_Light
RTO_Timer.DN
<Local:2:O.Data.2>
Reset_Pushbutton
<Local:1:I.Data.1> RTO_Timer
2 RES
In the figure above, the toggle switch can be used to start and stop the timer. With a retentive timer, the
accumulated value is kept when the timer rung transitions to false. The value will remain there until the timer
is reset using the RES (reset) instruction as shown on rung 2 above. The general behaviour of the RTO timer is
that of a TON delay timer. In addition to the different ACC value behaviour, the DN status bit for the RTO timer
will remain set if it times out even if the timer rung transitions from true to false unlike that of the TON time
which goes low immediately. The DN status bit will remain set until the RES instruction resets it along with the
accumulated value.
PROGRAM EXAMPLES 48
DECISION MAKING - LADDER LOGIC EQUIVALENT
RUNGS FOR THREE INPUT LOGIC GATES
Boolean logic gates are often used in decision making applications. In this article we will go over the rung
configurations as well as the truth tables for the major logic gates used in decision making circuits/applications.
We will begin with the SINGLE INPUT buffer and inverter gates along with their truth tables. A truth table lists all
possible input combinations with their corresponding output condition.
02 B_Input Y_Output 02
<Local:1:I.Data.1> <Local:2:O.Data.1>
03 03
1
Buffer Inverter
Input Output Input Output
A X B Y
Buffer Inverter 0 0 0 1
1 1 1 0
In the figure above, rung 0 provides buffer logic. This is accomplished using an NO (Normally Open) contact with
the normally open switch (field device). The inverter is located on Rung 1 and uses the NC (Normally Closed)
contact with the normally open switch in the field.
PROGRAM EXAMPLES 49
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
01 B_Input 0 NAND 01
C_Input
<Local:1:I.Data.2>
Inputs Outputs
A B C AND NAND
0 0 0 0 1
AND 0 0 1 0 1
0 1 0 0 1
0 1 1 0 1
1 0 0 0 1
1 0 1 0 1
NAND 1 1 0 0 1
1 1 1 1 0
Here we have the 3 INPUT AND as well as the NAND logic gates along with their corresponding truth table. Each
input condition is presented on the input switches and the output state is recorded in the truth table. In this way,
the complete behaviour of these two decision making rungs can be easily illustrated and conveyed.
PROGRAM EXAMPLES 50
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
B_Input
0 01
01
02 C_Input A_Input OR OR 02
<Local:1:I.Data.0> <Local:2:O.Data.2>
03 NOR 03
1
B_Input
<Local:1:I.Data.1>
C_Input
<Local:1:I.Data.2>
Inputs Outputs
A B C OR NOR
0 0 0 0 1
0 0 1 1 0
OR
0 1 0 1 0
0 1 1 1 0
1 0 0 1 0
1 0 1 1 0
NOR 1 1 0 1 0
1 1 1 1 0
Rung 0 in the above figure provides the 3 INPUT NOR logic function. The NOR output will go LOW if any one of
the 3 input switches are closed. Effectively, neither Input A, NOR Input B, NOR Input C can be closed if you want
the output to be HIGH.
PROGRAM EXAMPLES 51
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
01 B_Input 0 NAND 01
B_Input C_Input
<Local:1:I.Data.1> <Local:1:I.Data.2>
B_Input C_Input
<Local:1:I.Data.1> <Local:1:I.Data.2>
B_Input C_Input
<Local:1:I.Data.1> <Local:1:I.Data.2>
Inputs Outputs
A B C XOR XNOR
0 0 0 0 1
0 0 1 1 0
XOR 0 1 0 1 0
0 1 1 0 1
1 0 0 1 0
1 0 1 0 1
1 1 0 0 1
XNOR
1 1 1 1 0
Rung 0 in the above figure provides a variation on the basic OR function. The XOR (exclusive OR) logic function Is
based on exclusivity. The output of an XOR logic function rung will go HIGH when only ONE of the inputs is HIGH.
This holds true for all input combinations with the exception of the state where all three input switches are closed.
PROGRAM EXAMPLES 52
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
The above figure illustrates the output logic for the basic 6 three input logic gates. Logic gates are used in
decision making rungs when conditional logic is required to direct the behaviour of a specific output.
A
B
Decision Making Logic Circuit - Combinational Logic Diagram Using Standard 2 and 3 Input Logic Gates
as well as Inverters.
PROGRAM EXAMPLES 53
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
Although the basic gates have been covered here, as can be seen in the figure above, the power of these basic
building blocks with respect to decision making and direction taking resides in the ability to combine them to
create combinational logic decision making program segments. The gate representation of this decision making
circuit can actually be reduced using Boolean algebra to the following logic function:
A and NOT B = Z
This can be arrived at by creating a truth table, and then using reduction theorems to simplify the logic.
A A A
1 A·A=A
2 A·0=0
open circuit
open circuit
A
3 A+1=1
short circuit
short circuit
A
4 A+A=1
short circuit
A
A
A
5 A+A=A
A
A A
6 A·A=0
open circuit
A A
7 A·1=A
short circuit
A A
8 A+0=A
open circuit
The above table lists the basic 8 boolean reductions. These identities allow you to reduce the number of logic
gates being used to perform the desired logical operation.
PROGRAM EXAMPLES 54
Decision Making - Ladder Logic equivalent rungs for Three input logic gates
10. (x + y) + z = x + (y + z) 14. x + xy = x
These additional boolean reduction theorems will allow you to reduce complex multiterm boolean expressions
down to their simplest forms. These 15 theorems in combination with DeMorgans theorems, (next) constitute the
basis for boolean algebra.
Theorem 1. The complement of a sum equals the product of the complements. A+B=A·B
Theorem 2. The complement of a product equals the sum of the complements. A·B=A+B
Theorem 1 allows you to convert a NOR based pair of conditions to a NAND based pair of conditions. Theorem
2 reverses this function. It can often be convenient to re-express the way in which you are viewing the condition
when trying to reduce a Boolean expression to its simplest form.
A
B
A B C Z Boolean Reduction
0 0 0 0
0 0 1 0 Truth Table: A~B~C + A~BC = Z
0 1 0 0
0 1 1 0 Theorem 18. (A~B) (~C + C) = Z
1 0 0 1 (A~B~C)
1 0 1 1 (A~BC) Theorem 4. (A~B) (1) = Z
1 1 0 0
1 1 1 0 Theorem 7. A~B = Z
Z = A and NOT B
PROGRAM EXAMPLES 55
3 SUPPLEMENTAL
CONTENT
COMMON PLC FIELD DEVICES
AND SCHEMATIC SYMBOLS
In this section, you are provided with some common input and output field devices used in PLCs, their relevant
instruction, along with a brief description and schematic symbols.
XIC/ NO Examine Momentary pushbutton Pushing the button will complete the
If Closed connection between the terminals
/ Normally and allow the current to flow.
open
Single Pole Single Throw Switch SPST is a switch that only has a
(SPST) single input and can connect only to
one output. This means it only has
one input terminal and only one output
terminal. Serving as an on off switch,
the circuit is on when the switch is
closed and off when it’s open.
Double Pole Single Throw Switch This is a pair of single pole switches
(DPST) that are electrically separate but
are linked to the same mechanical
switch. A DPST switch is often used
for switching mains operated devices
as both the Live and Neutral wires
are switched on or off simultaneously.
Normally open held closed switch With this type of limit switch,
something has to continuously push
the switch to keep the contacts
closed; if the pushing stops the
contacts will open.
SUPPLEMENTAL CONTENT 57
Common PLC Field Devices and Schematic Symbols
SUPPLEMENTAL CONTENT 58
Common PLC Field Devices and Schematic Symbols
SUPPLEMENTAL CONTENT 59
Common PLC Field Devices and Schematic Symbols
SUPPLEMENTAL CONTENT 60
NUMBER SYSTEMS AND CODES USED WITH PLC
A number system is essentially a code consisting of symbols which are assigned for each individual quantity.
Once a code is memorized, it is possible to count using this code. There are several numbering systems used in
PLCs, such as Decimal, Binary, Octal, Hexadecimal and BCD. In this section we will examine these number
systems and see how we can convert any of the other base system to the equivalent decimal number.
The radix, or base, of a number system is the total number of individual symbols in that system. The largest-
valued symbol always has a magnitude of one less than the radix. For example, the decimal number system has
a radix of 10, so the largest single digit is 10 – 1, or 9. Each number is represented by its base. If the base is 2 it
is a binary number, if the base is 8 it is an octal number, if the base is 10 it is a decimal number and if the base is
16, it is the hexadecimal number system.
All number systems use position weighting to represent the significance of an individual digit in a group of
numbers. As the digits move to the left of a decimal point, the value of the digit increases by its base power.
If a digit moves to the right of the decimal place, it decreases by its base power. When the digits are grouped
together, larger quantities can be expressed.
As the digits move to the right, they decrease by a power of 10 as shown in this example:
4 x 10-2 = 0.04
1 x 10-1 = 0.1
1 x 100 = 1
1 x 101 = 10
9 x 102 = 900
5 x 103 = 5,000
5,911.14
SUPPLEMENTAL CONTENT 61
Number Systems and Codes used with PLC
Word
Byte Byte
Nibble Nibble Nibble Nibble
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Figure 1
Typically, 5 volts is used to represent binary 1, and 0 volts is used to represent binary 0 and this indicates ON
or OFF for voltage level of 0 V or 5 V. For example, the binary word 10110111 would appear as the following
voltage levels:
5 V, 0 V, 5 V, 5 V, 0 V, 5 V, 5 V, 5 V
When the processor 'sees' these voltage levels it considers the binary number 10110111 to be present.
Because only two symbols, or digits, are used in the binary number system, the base, or radix, is two. Therefore,
the position weighting that is assigned to a binary symbol will double each position a digit is moved to the left of
the decimal point, and it will decrease by ½ each position a digit is moved to the right of the decimal point. The
digit of a binary number that has the lowest weight is called the Least Significant Bit, or LSB, and the digit with
the highest value is called the Most Significant Bit, or MSB.
A nibble of 10112 would be equal to a decimal number 11 or (1x23 + 1x21 + 1x20) or (810 + 210 + 110). A byte of
110101112 would be equal to 21510 or (1x27 + 1x26 + 1x24 + 1x22 + 1x21 + 1x20) or (12810 + 6410 + 1610 + 410 + 210
+ 110).
SUPPLEMENTAL CONTENT 62
Number Systems and Codes used with PLC
For example:
= 2048 + 256 + 8 + 4 + 2
1 x 214 = 16384
1 x 213 = 8192
1 x 212 = 4096
1 x 211 = 2048
1 x 210 = 1024
1 x 29 = 512
1 x 28 = 256
1 x 27 = 128
1 x 26 = 64
1 x 25 = 32
1 x 24 = 16
1 x 23 = 6
1 x 22 = 4
1 x 21 = 2
1 x 20 = 1
0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 32767
Figure 3
SUPPLEMENTAL CONTENT 63
Number Systems and Codes used with PLC
Magnitude
Decimal value
Sign
0 1 1 1 +7
0 1 1 0 +6
0 1 0 1 +5
0 1 0 0 +4
0 0 1 1 +3
0 0 1 0 +2
0 0 0 1 +1
0 0 0 0 0
1 0 0 1 -1
1 0 1 0 -2
1 0 1 1 -3
1 1 0 0 -4
1 1 0 1 -5
1 1 1 0 -6
1 1 1 1 -7
The far-left position is always 1 for negative numbers. The equivalent decimal value of the binary number
is obtained by subtracting the value of the far-left position, 32768, from the sum of the values of the other
positions. In Figure 5, the value is 32767 - 32768 = -1. All positions are 1.
For example:
= 30755 - 32768
= -2013.
SUPPLEMENTAL CONTENT 64
Number Systems and Codes used with PLC
1 x 214 = 16384
1 x 213 = 8192
1 x 212 = 4096
1 x 211 = 2048
1 x 210 = 1024
1 x 29 = 512
1 x 28 = 256
1 x 27 = 128
1 x 26 = 64
1 x 25 = 32
1 x 24 = 16
1 x 23 = 6
1 x 22 = 4
1 x 21 = 2
1 x 20 = 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 32767
Figure 5
An often-easier way to calculate a value is to locate the last 1 in the string of 1s beginning at the left and
subtract its value from the total value of positions to the right of that position.
For example:
= (16 + 8 + 2) - 256
= -230.
The 2s complement notion is also used to express a negative binary number. If a binary number has the value
1, the complement would be 0 and if the binary number is 0, the complement would be 1. In other words, the
SUPPLEMENTAL CONTENT 65
Number Systems and Codes used with PLC
1's complement of 1001 is 0110. When negative numbers are represented in 1's complement, each negative
number's magnitude is the 1's complement of the corresponding positive number's magnitude. Figure 6 shows
the 1’s complement of four-digit binary numbers.
Magnitude
Decimal value
Sign
0 1 1 1 +7
0 1 1 0 +6
0 1 0 1 +5
0 1 0 0 +4
0 0 1 1 +3
0 0 1 0 +2
0 0 0 1 +1
0 0 0 0 0
1 1 1 0 -1
1 1 0 1 -2
1 1 0 0 -3
1 0 1 1 -4
1 0 1 0 -5
1 0 0 1 -6
1 0 0 0 -7
Figure 6
2s complement is similar to the 1’s complement but 1 digit is used to represent the sign. Using the 2's
complement, binary numbers are actually added together to produce a subtraction operation. 2's complement
= 1 + 1's complement.
SUPPLEMENTAL CONTENT 66
Number Systems and Codes used with PLC
1 1 0 0 1
1 x 20 = 1
1 x 21 = 0
1 x 22 = 0
1 x 23 = 8
1 x 24 = 16
25
The sum of 1 + 8 + 16 = 25. Therefore, the decimal equivalent of binary number 11001 is 25.
Decimal values that are entered into a digital machine must be converted, or encoded, into binary form. To
convert a decimal number into binary form, divide the decimal number by 2 and record the remainders as
shown:
25
= 12 + remainder of 1
2
12
= 6 + remainder of 0
2
6
= 3 + remainder of 0
2
3
= 1 + remainder of 1
2
1
= 0 + remainder of 1
2
1 1 0 0 1
MSB LSB
SUPPLEMENTAL CONTENT 67
Number Systems and Codes used with PLC
214
8 = 26 with a remainder of 6
26
8 = 3 with a remainder of 2
3
8 = 0 with a remainder of 3
Result = 326
When converting a decimal fraction to octal, the decimal number is multiplied instead of divided. Also, the first
number divided is now the most- significant digit, and the last number is the least- significant digit.
etc.
Result = 0.263
SUPPLEMENTAL CONTENT 68
Number Systems and Codes used with PLC
Octal Number 0 1 2 3 4 5 6 7
Binary Equivalent 000 001 010 011 100 101 110 111
Figure 7
1 3 7
1 4 . 5 2
The binary equivalent of 14.528 is 001 100 . 101 010, or 1100 . 101010
1 5 2 7 3 6
11010101110111102 = 1527368
SUPPLEMENTAL CONTENT 69
Number Systems and Codes used with PLC
4 3 . 5 4
100011.10112 = 43.548
0 0000 0
1 0001 1
2 0010 2
3 0011 3
4 0100 4
5 0101 5
6 0110 6
7 0111 7
8 1000 8
9 1001 9
10 1010 A
11 1011 B
12 1100 C
13 1101 D
14 1110 E
15 1111 F
Figure 8
SUPPLEMENTAL CONTENT 70
Number Systems and Codes used with PLC
= 1,536 + 48 + 7
63716 = 1,59110
= 1,024 + 192 + 15
4CF16 = 123110
541
16 = 33 with a remainder of 13 (D) - (MSB)
33
16 = 2 with a remainder of 1
1
16 = 0 with a remainder of 1 - (LSB)
Hexadecimal
218A
SUPPLEMENTAL CONTENT 71
Number Systems and Codes used with PLC
Decimal
8586
Figure 9b: Decimal number -8586 in equivalent binary and hexadecimal forms
We know this is a negative number because it exceeds the maximum positive value of 32767. To calculate its
value, subtract 164 (the next higher power of 16) from 56950: 56950 - 65536 = -8586 OR work backwards from
2’s complement to 1’s complement, then invert the binary digits and convert to decimal to obtain the negative
decimal equivalent value.
0 0000 0000
1 0001 0001
2 0010 0010
3 0011 0011
4 0100 0100
5 0101 0101
6 0110 0110
7 0111 0111
8 1000 1000
9 1001 1001
10 0001 0000 1010
11 0001 0001 1011
12 0001 0010 1100
13 0001 0011 1101
14 0001 0100 1110
15 0001 0101 1111
Figure 10
SUPPLEMENTAL CONTENT 72
Number Systems and Codes used with PLC
BCD Conversion
A decimal number is expressed as BCD by changing each digit to its binary equivalent as illustrated for decimal
value 317:
3 1 7 (Decimal)
001100010111 is the BCD equivalent of decimal number 317, however the 0s on the MSB side can be ignored
so 1100010111 is also a correct expression of the decimal number 317.
To determine a decimal number from a BCD number. Start at the least significant bit and break the code into
groups of four bits. The decimal digit represented by each four-bit group is then written as shown:
7 8 . 9 (Decimal)
0000 0 1
0001 1 0
0010 1 0
0011 0 1
0100 1 0
0101 0 1
0110 0 1
0111 1 0
1000 1 0
1001 0 1
SUPPLEMENTAL CONTENT 73
Number Systems and Codes used with PLC
The Gray code is a special type of binary code that does not use position weighting. In other words, each
position does not have a definite weight. It is used to minimize the error that may occur when transitioning form
one number to the next through a sequence. Gray code is set up so that as we progress from one number to the
next, only one bit changes. This makes the speed of transmission faster than codes like BCD since only one bit
changes at a time. The Gray code is ideally suited for absolute encoders and other digital counting devices due
to the high degree of accuracy associated with this code. Here in Figure 12 is a comparison of Gray code and
binary equivalents with respect to decimal:
0 0000 0000 0
1 0001 0001 1
2 0010 0011 3
3 0011 0010 2
4 0100 0110 6
5 0101 0111 7
6 0110 0101 5
7 0111 0100 4
8 1000 1100 12
9 1001 1101 13
10 1010 1111 15
11 1011 1110 14
12 1100 1010 10
13 1101 1011 11
14 1110 1001 9
15 1111 1000 8
Figure 12
The decimal value "1" is representation in binary would normally be "0001" and "2" would be "0010". In Gray
code, these values are represented as "0001" and "0011". That way, incrementing a value from 1 to 2 requires
only one bit to change, instead of two.
The abbreviation ASCII stands for American Standard Code for Information Interchange. It is an
alphanumeric code which includes letters as well as numbers and special characters such as those found on
standard typewriters and computer keyboards. These includes 10 numeric digits, 26 upper-case letters, 26
lower-case letters and 25 special characters.
The ASCII code is a seven-bit code in which the decimal digits are represented by the 8-4-2-1 BCD code
preceded by 011. Upper-case letters are preceded by 100 or 101. Lower-case letters are preceded by 110 or
111. Character symbols are preceded by 010, 011, 101, and 111. This seven-bit code provides all possible
combinations of characters used when communicating with peripherals or interfaces in a PLC system. In
Figure 13a we find a partial listing of the ASCII code and a Standard ASCII Control Code and Character Code
in Figure 13b.
SUPPLEMENTAL CONTENT 74
Number Systems and Codes used with PLC
Hex 0 1 2 3 4 5 6 7
0000 0 NUL DLE SP 0 @ P ` p
0001 1 SOH DC1 ! 1 A Q a q
0010 2 STX DC2 " 2 B R b r
0011 3 ETX DC3 # 3 C S c s
0100 4 EOT DC4 $ 4 D T d t
0101 5 ENQ NAK % 5 E U e u
0110 6 ACK SYN & 6 F V f v
0111 7 BEL ETB ' 7 G W g w
1000 8 BS CAN ( 8 H X h x
1001 9 HT EM ) 9 I Y i y
1010 A LF SUB * : J Z j z
1011 B VT ESC + ; K [ k {
1100 C FF FS , < L \ l |
1101 D CR GS - = M ] m }
1110 E SO RS . > N ^ n ~
1111 F SI US / ? O _ o DEL
SUPPLEMENTAL CONTENT 75
CORE INSTUCTION SET
The PLCLogix instructions encompass all the main ladder logic programming commands associated with Logix
5000. The PLCLogix Instruction Set consists of the following groups of commands: Bit Instructions, Timer
and Counter Instructions, Program Control, Compare, Communications, Math, and Data Handling/Transfer
instructions.
1. Bit Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
XIC Examine If Closed ? Examines a bit for an On (set,
high) condition.
SUPPLEMENTAL CONTENT 76
CORE INSTUCTION SET
Instruction
Instruction Name Symbol Description
Mnemonic
TON Timer ON Delay TO N A non-retentive timer that
Ti mer O n Del ay EN accumulates time when the
instruction is enabled. The
Ti mer ? DN accumulated value is reset
P reset ?
when rung conditions go
Accum ?
false.
SUPPLEMENTAL CONTENT 77
CORE INSTUCTION SET
?
JMP Jump to Label Skips sections of ladder
JMP logic.
SUPPLEMENTAL CONTENT 78
CORE INSTUCTION SET
4. Compare Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
EQU Equal EQ U This instruction is used to
Eq ual test whether two values are
S ource A ? equal. If Source A is equal
?? to Source B, the instruction
S ource B ? is logically true.
??
SUPPLEMENTAL CONTENT 79
CORE INSTUCTION SET
4. Compare Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
MEQ Mask Equal To MEQ Passes the Source and
Mask Eq ual Compare values through
S ource ? a Mask and compares the
?? results.
Mask ?
??
C omp are ?
??
SUPPLEMENTAL CONTENT 80
CORE INSTUCTION SET
5. Math Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
ADD Add A DD Adds Source A to Source B
Add and stores the result in the
S ource A ? Destination.
??
S ource B ?
??
Dest ?
??
SUPPLEMENTAL CONTENT 81
CORE INSTUCTION SET
5. Math Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
SQR Square Root SQR Calculates the square root
S q uare Root of the source and places
S ource A ? the float result in the
?? Destination.
S ource B ?
??
Dest ?
??
SUPPLEMENTAL CONTENT 82
CORE INSTUCTION SET
Instruction
Instruction Name Symbol Description
Mnemonic
SIN Sine S IN Takes the sine of the
S i ne Source value (in radians}
S ource ? and places the result in the
?? Destination.
Dest ?
??
SUPPLEMENTAL CONTENT 83
CORE INSTUCTION SET
Instruction
Instruction Name Symbol Description
Mnemonic
LN Natural Log LN Takes the natural log of
N at ural Log the Source value and
S ource ? stores the result in the
?? Destination.
Dest ?
??
SUPPLEMENTAL CONTENT 84
CORE INSTUCTION SET
Instruction
Instruction Name Symbol Description
Mnemonic
TOD Convert to BCD TO D This instruction converts
To BC D a decimal value to a BCD
S ource ? value and stores the result
?? in the Destination.
Dest ?
??
SUPPLEMENTAL CONTENT 85
CORE INSTUCTION SET
Instruction
Instruction Name Symbol Description
Mnemonic
XOR Bitwise Exclusive OR XO R Performs a bitwise XOR
Bi t wi se Ex cl usi ve O R operation using the bits
S ource A ? in Source A and Source B
?? and stores the result in the
S ource B ? Destination.
??
Dest ?
??
SUPPLEMENTAL CONTENT 86
CORE INSTUCTION SET
7. Array/Shift Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
BSL Bit Shift Left BS L Shifts the specified bits
Bi t S hi f t EN within the Array (DINT) one
Lef t ? position left.
A rray ? DN
C ont rol ?
S ource Bi t ?
Lengt h
SUPPLEMENTAL CONTENT 87
CORE INSTUCTION SET
8. Sequencer Instruction
Instruction
Instruction Name Symbol Description
Mnemonic
SQI Sequencer Input SQI Detects when a step is
S eq uencer complete in a sequence
Inp ut ?
pair of SQO/SQI
A rray ?
Mask ? instructions.
S ource ?
C ont rol ?
Lengt h ?
P osi t i on
SUPPLEMENTAL CONTENT 88
CORE INSTUCTION SET
9. Communication Instructions
Instruction
Instruction Name Symbol Description
Mnemonic
GSV Get System Data GS V Gets controller system data
Get S yst em that is stored in objects.
Val ue ?
C l ass N ame ?
Inst ance N ame ?
A t t ri b ut e N ame ?
Dest ??
SUPPLEMENTAL CONTENT 89
PLC Technician Handbook - 2022 Edition
The PLC handbook serves as a useful tool to technicians who are in training and in the workforce. It is a text designed to provide
guidance by illustrating important concepts, tips and common practices and supplemental content that is relevant to the field.
To learn more about George Brown College School of Distance Education Technical Training, visit www.gbctechtraining.com
For specific information about each of our Online Certificate Programs, visit the following sites:
www.gbctechtraining.com