You are on page 1of 179

Koldwater Technologies, LLC

P.O. Box 701


Mannford, Oklahoma
USA 74044-0701

http://www.koldwater.com

Permission Granted to reproduce for


educational purposes.
The PLCTrainer Lab Manual
Published by Koldwater Technologies, LLC

 2007, Koldwater Technologies, LLC, All Rights Reserved

Warranty Disclaimer

This manual is provided AS IS without any warranty or guarantee, expressed or implied.


In no event shall Koldwater Technologies, LLC, the Publisher and the Distributor, be
liable for any damages whatsoever arising out of the use of this manual or any of the
products described herein or perform any independent analysis of the information
contained herein.

Neither Koldwater Technologies, LLC, the Publisher nor the Distributor warranty or
guarantee any of the products or circuits described herein. Nor do we assume, and do
expressly disclaim any obligation to obtain and include information other than that
supplied herein.

The user is expressly warned to consider and adopt all safety precautions that might be
indicated or implied by the activities and circuits described herein and to avoid all
potential hazards. By following any instructions contained, the user willingly assumes all
risk in connection with such instructions contained herein.

Specifically, Koldwater Technologies, LLC, the Publisher and the Distributor make no
representation or warranty that this manual is fit for any particular purpose. This
includes, but is not limited to, warranties of fitness for any particular purpose or
merchantability, nor is any such representations implied with respect to the material set
forth herein. Koldwater Technologies, LLC, the Publisher and the Distributor shall not be
liable for any special, consequential or exemplary damages resulting in whole or in part,
from the user's use of, or reliance upon, this material. (In simple terms, this means that
if you suffer a loss through the use of this manual or anything associated with it, it's not
our fault. In fact, in today's litigious society, we make no claims or guarantees for this
manual at all, and your use of this manual indicates that you agree to hold us blameless
for anything you may experience as a result of such use.)

2
Unit 1, Overview of PLCs
Learning Steps

Student Action Where Media

View Unit 1, Introduction to PLCs The PLCTrainer Tutorial


Complete Unit 1, Introduction to PLCs The PLCTrainer Lab
Manual
Stop Unit 1, Introduction to PLCs Have Instructor Evaluate
Assignment Sheet 1 Assignment Sheet 1
Complete Unit 1, Introduction to PLCs The PLCTrainer Lab
Assignment Sheet 2 Manual
Stop Unit 1, Introduction to PLCs Have Instructor Evaluate
Assignment Sheet 2 Assignment Sheet 2
Complete Unit 1, Practical Exercise 1 The PLCTrainer Lab
Manual
Stop Have Instructor Evaluate
The PLCTrainer Lab
Manual Practical Exercise 1
Complete Unit 1, Practical Exercise 2 Have Instructor Evaluate
The PLCTrainer Lab
Manual Practical Exercise 2
Review Unit 1, Introduction to PLCs The PLCTrainer Tutorial
See Instructor

3
Introduction:
The basis for all Control Systems is introduced in this unit, both manual and automatic.
The elements of early Control Systems are examined and shown to be the foundation for
today’s Programmable Control Systems.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the foundations and
beginnings of Programmable Logic Controllers. This will be evidenced by successful
completion of Assignment Sheets, Practical Exercises and the Unit Quiz.

Enabling Objectives:
1. Describe the 3 stages necessary to control a process.
2. Identify the similarities between Manual, Electro-mechanical and PLC Control.
3. Identify the components of a Programmable Logic Control system.
4. Describe the role PLCs play in an automatic control system.
5. Describe several advantages of a programmable controller over a hard wired relay
controlled system
6. Identify the 3 main components of a programmable controller, describing the function
of each one.
7. Define the term discrete
8. Identify 3 types of programming devices

4
The Evolution of Control Systems

Before the Industrial Revolution, all stages in a process were done by hand. Filling,
capping, labeling, inspection and packing were all accomplished with manual labor.

Early in the 20th century, entire processes were automated. Then, filling, capping
labeling and packing were controlled by electro-mechanical relays, cams, and other
crude control devices.

5
The high-speed demand and the computer age have together caused the evolution of a
faster more precise process control system, the Programmable Logic Controller. This
graphic shows the bottling process being more efficiently by a Programmable Logic
Controller. The PLC offers greater flexibility and faster changes than the old relay
control systems.

As technology continues to expand, so will our methods of automated control. Today it


is possible to link many control systems together under the management of a central
control system.

Functions of Programmable Controllers

PLCs make system control much more efficient than the electro-mechanical systems of
the past. Additionally, PLC's are capable of performing many functions that the older
systems just could not do. These might include:

6
• Math functions
• Data manipulation
• Fault location
• Alarming
• Control of dangerous devices in dangerous environments.

Automatic Control

All PLC controlled systems operate through three basic types of devices:

• Inputs - Sensing devices or switching devices that provide information about the
progress or status of the operation.

• Logic – The communicating parts of the system takes information from the inputs,
makes decisions and operates the outputs accordingly.

• Outputs – The working or indicating parts of the system. These parts accomplish
the work and indicate the condition of the system.

Parts of a PLC

All PLCs are divided into three main parts:

• CPU – The Central Processing Unit is the brain of the PLC. The Logic is stored here
and the decisions are made here.

• Input/Output – The I/O section is used to communicate information to and from the
CPU. Gathering information through input devices and operating the system through
output devices.

• Programming Device – The programming device allows the user to tell the PLC
how to react to the information gathered by the input devices. This may be a small
hand-held device, a dedicated industrial grade computer, or simply a personal
computer such as a laptop.

7
Assignment Sheet 1

1. The logic functions that are performed by a Programmable Logic Controller


were previously performed by:

❏ Desktop computers ❏ Relays

❏ Timers ❏ Electromechanical relays, timers,


mechanical counters and drum sequencers

2. Programmable Logic Controllers were first developed in the:

❏1960s ❏1950s

❏ 1980s ❏1970s

3. Which industry was instrumental in the development of the PLC?

❏ The baking industry ❏ The construction industry

❏ The automobile industry ❏ The toy industry

4. Which of the following is not one of the three main parts of a PLC?

❏ The CPU ❏ The input/output section

❏ The monitor ❏ The programming device

5. Generally, PLCs are programmed using:

❏ Boolean Algebra ❏ Relay logic

❏ Mnemonic codes ❏ Ladder logic

8
6. The 3 basic types of devices related to control systems are

❏ Programming Devices ❏ Input

❏ Logic ❏ Output

9
Assignment Sheet 2

1. Name the 3 main components of a typical programmable controller.

2. What does the abbreviation I/O stand for?

3. “Real world” or actual input or output devices are also referred to as


_________________ devices.

4. List 2 types of programming devices?

5. The power supply needed to produce low level DC voltage used by the
processor is always located inside the processor unit.

❏ True

❏ False

6. What do the following acronyms stand for?

CPU _____________________

I/O _____________________

PLC ______________________

10
Practical Exercise 1
As a student of Programmable Logic Controllers, it is important that you develop an
understanding of those types of processes that lend themselves to control by PLCs.
Form a Team of 3 to 4 fellow students, then, research 1 local industry. Determine how
they have used programmable controllers to increase production and efficiency.

Using presentation software such as PowerPoint, share this information with the rest of
your class. Include any graphics or drawings that might enhance your presentation. Be
prepared to answer questions posed by other students.

Your presentation should include:

1. Name and location of the industry


2. Type of product manufactured or processed
3. Number of PLCs used in the plant or process
4. The brand or brands of PLC
5. Who is responsible for troubleshooting and maintenance of the systems

11
Practical Exercise 2
Directions:

Match the following input or output Devices with the statement that best explains their
function in the system using your logical ability to determine what device causes what
action. You will not find answers to this question within the tutorial.

When the system is started, the product moves into the ‘oven’. There it stops and the
doors will close. Once the target temperature is achieved for a specific period, the
doors will open and the product moves out as another moves in place.

A. Temperature Sensors B. Position Switch


C. Doors open switch D. Start button
E. Heating Element F. Drive Motor

1. The _____________________ De-activates, signaling the Logic to begin


heating.

2. The _____________________ will signal the Logic to start the belt moving.

3. The _____________________ will determine whether the heat is at the proper


level.

12
4. The _____________________ assures that the product is inside the oven and
signals the Logic to close the doors.

13
Unit 2 & 3, Input/Output Modules
Learning Steps

Student Action Where Media

View Unit 2, Input/Output The PLCTrainer Tutorial


Modules
View Unit 3, Safety Circuit The PLCTrainer Tutorial
Complete Unit 2, Input/Output The PLCTrainer Lab
Modules Manual
Assignment Sheet 1
Stop Unit 2, Input/Output Have Instructor Evaluate
Modules Assignment Sheet 1
Assignment Sheet 1
Complete Unit 2, Practical Exercise 1 The PLCTrainer Lab
Manual
Stop Unit 2, Practical Exercise 1 Have Instructor Evaluate
The PLCTrainer Lab
Manual Practical Exercise 1
Complete Unit 2, Practical Exercise 2 The PLCTrainer Lab
Manual
Stop Unit 2, Practical Exercise 2 Have Instructor Evaluate
The PLCTrainer Lab
Manual Practical Exercise 2
Review Unit 2, Input/Output The PLCTrainer Tutorial
Modules
See Instructor

14
Introduction:
The Input/output modules act as the eyes, ears, and hands of a programmable
controller. These modules allow the user to interface “real world” sensing devices and
work devices to the programmable control system

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the use and interfacing of
the input/output modules associated with a programmable controller. This will be
evidenced by successful completion of the assignment sheets, practical exercises and
the unit quiz.

Enabling Objectives:

1. Describe the I/O section of a programmable controller.


2. Identify DIP switches.
3. Describe how basic AC/DC input and output modules work.
4. Define optical isolation and describe why it is used.
5. Describe the proper voltage connections used for both input and output modules.
6. Explain why a hard-wired emergency stop circuit is desirable.
7. Define the term interposing.
8. Describe what I/O shielding does.
9. Describe surge suppression.
10. Draw a schematic of the proper connection to an input module and an output
module.
11. Install a hard-wired Emergency Stop circuit on a programmable controller.

15
Assignment Sheet 1

1. Describe briefly the purpose of the I/O Section.

2. State 2 reasons for using optical isolation.

3. Briefly describe why a hardwired emergency stop circuit is recommended for


programmable controller installations.

4. Describe the function of an interposing relay.

5. To insure the maximum benefit of shielding, the shield of a shielded cable


must be terminated and grounded at both ends.

❏ True

❏ False

6. The term E-Stop refers to:

❏ Extra Stop ❏ Every Stop

❏ Emergency Stop ❏ Energy Stop

16
7. Electro-magnetic induction (EMI) can be reduced with proper grounding of
equipment.

❏ True

❏ False

8. Solid state output devices tend to:

❏ Never fail ❏ Fail in the open (off) condition

❏ Fail in the shorted (on) condition ❏ Not be affected by overload

17
Practical Exercise 1
Directions:

1. Draw an input module with four input devices and show all the necessary
electrical connections and identify the potentials for both AC and DC.

2. Draw an output module wit four output devices and show all necessary
electrical connections and identify the potentials for both AC and DC.

18
Practical Exercise 2
Directions:

Using the schematic below or a schematic supplied by your instructor, install an


emergency stop circuit for a programmable controller.

NOTE: This is only possible if you have access to the proper equipment and manuals.
Otherwise, study the diagram and become familiar with this type of emergency stop
system.

19
Unit 4, PLC Processors
Learning Steps

Student Action Where Media

View Unit 4, PLC Processors The PLCTrainer Tutorial


Complete Unit 4, PLC Processors The PLCTrainer Lab
Assignment Sheet 1 Manual
Stop Unit 4, PLC Processors Have Instructor Evaluate
Assignment Sheet 1 Assignment Sheet 1
Review Unit 4, PLC Processors The PLCTrainer Tutorial
See Instructor

20
Introduction:
The processor of a programmable controller is the brain of the system. It collects
information from the input modules and causes appropriate output actions based on the
user program.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the function of a
programmable controller processor. This will be evidenced by successful completion of
the assignment sheets and the unit quiz.

Enabling Objectives:
1. Describe the function of the processor.
2. Identify 2 main types of memory.
3. Describe the memory designs.
4. Convert memory size into actual memory words.
5. Identify and explain the two broad categories of memory use.
6. Identify different peripheral devices that can be used with a programmable controller.

21
Assignment Sheet 1

1. The processor is often referred to as the _______________ of the


programmable controller.

2. Briefly describe volatile memory.

3. 1K of memory is actually;

❏ 1000 words ❏ 1010 words

❏ 1024 words ❏ 1042 words

4. Calculate the actual number of words in 8K of memory.

5. The most common type of volatile memory is:

❏ PROM ❏ Bubble

❏ EAROM ❏ RAM

6. Which of the following are types of non-volatile memory?

❏ EEPROM ❏ RAM ❏ EAROM

❏ PROM ❏ Bubble ❏ Magnetic Core

7. List 2 broad categories of memory.

22
Unit 5, Numbering Systems and
Codes
Learning Steps

Student Action Where Media

View Unit 5, Numbering Systems The PLCTrainer Tutorial


& Codes
Complete Unit 5, Numbering Systems The PLCTrainer Lab
& Codes Manual
Assignment Sheet 1
Stop Unit 5, Numbering Systems Have Instructor Evaluate
& Codes Assignment Sheet 1
Assignment Sheet 1
Complete Unit 5, Numbering Systems The PLCTrainer Lab
& Codes Manual
Practical Exercise 1
Stop Unit 5, Numbering Systems Have Instructor Evaluate
& Codes Practical Exercise 1
Practical Exercise 1
Complete Unit 5, Numbering Systems The PLCTrainer Lab
& Codes Manual
Practical Exercise 2
Stop Unit 5, Numbering Systems Have Instructor Evaluate
& Codes Practical Exercise 2
Practical Exercise 2
Review Unit 5, Numbering Systems The PLCTrainer Tutorial
& Codes
See Instructor

23
Introduction:
There are several numbering systems that are used to store information in the form of
binary digits (BITS) into the memory of a processor. Which specific numbering system is
used or the combination of numbering systems will depend on the hardware
requirements of the programmable controller.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the decimal system,
binary, binary coded decimal (BCD), hexadecimal and octal numbering systems. This
will be evidenced by successful completion of the assignment sheets, practical exercises
and the unit quiz.

Enabling Objectives:

1. Understand decimal system, binary, binary coded decimal (BCD), hexadecimal and
octal numbering systems.
2. Convert from one numbering system to another.
3. Label input and output addresses on a ladder logic diagram
4. Label all of the input addresses and output address on the programmable controller
available to you.

24
Assignment Sheet 1

1. When information is stored using only 1’s and 0’s it is called a __________
system.

2. A BIT is an acronym for _______________________________.

3. The decimal system uses 10 digits or a base of 10. List the base for each of
the following numbering systems.

Binary _____________

Hexadecimal _____________

Octal _____________

4. Convert the Binary number 11011011 to a decimal number.

5. Convert the decimal number 359 to binary.

6. Convert binary coded decimal (BCD) number 0101 0011 1001 to a decimal
number.

7. Convert the hexadecimal number 14CD to a decimal number

25
8. Convert decimal number 3247 to a hexadecimal number.

9. Convert decimal number 232 to octal.

10. How do we prevent binary numbers 10 and 11 from being confused as


decimal numbers 10 and 11?

11. Convert the following values to decimal.

10011000 _________________

01100101 _________________

10011001 _________________

00010101 _________________

12. Convert the following BCD values to decimal.

1001 1000 _________________

0110 0101 _________________

1001 1001 _________________

0001 0101 _________________

13. The BCD values 1001 0011 0101 is NOT:

❏ 935 10 ❏ 647 8

❏ 0011 1010 0111 BCD ❏ 3A7 16

26
14. The hexadecimal value 2CB is NOT:

❏ 715 10 ❏ 1313 8

❏ 0111 0001 0011 BCD ❏ 001011001011 2

27
Practical Exercise 1
Directions:

Using the programmable controller addressing system available to you (you may
need to consult the User’s Manual or see your instructor for a specific
explanation), label the following ladder logic instructions. (You may also use the
I/O Simulator available in LogixPro)

Instruction “A” is input 5 on your programmable controller.

Instruction “B” is an examine if open instruction that is operated by output “D”.

Instruction “C” is input 2 on your programmable controller.

Instruction “D” is output 1 on your programmable controller.

What numbering system is used when addressing I/O’s for the PLC available for
your use?

28
29
Practical Exercise 2
Directions:

Draw a graphical representation of the programmable controller available to you.


Label the input section and the output section with the proper addresses. Be
sure that you have the module numbers correct.

30
Unit 6, Memory Structure
Learning Steps

Student Action Where Media

View Unit 6, Memory Structure The PLCTrainer Tutorial


Complete Unit 6, Memory Structure The PLCTrainer Lab
Assignment Sheet 1 Manual
Stop Unit 6, Memory Structure Have Instructor Evaluate
Assignment Sheet 1 Assignment Sheet 1
Complete Unit 6, Memory Structure The PLCTrainer Lab
Practical Exercise 1 Manual
Stop Unit 6, Memory Structure Have Instructor Evaluate
Practical Exercise 1 Practical Exercise 1
Review Unit 6, Memory Structure The PLCTrainer Tutorial
See Instructor

31
Introduction:
The processor memory stores the I/O status, the user program and numeric data used
by the processor. All data, logic and numeric, is stored within binary digits which are
represented by either a “1” or a “0.” By storing binary data, the processor can rapidly
scan and execute the user program and update the I/O section.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the decimal system,
binary, binary coded decimal (BCD), hexadecimal and octal numbering systems. This
will be evidenced by successful completion of the assignment sheets, practical exercises
and the unit quiz.

Enabling Objectives:

1. Identify the 2 broad categories of memory and describe the function of each.
2. Identify the types of information stored in each category of memory.
3. Describe the order of operation of a processor scan, and explain why it is important
to understand the scan process.

32
Assignment Sheet 1

1. The following types of information are normally found and/or stored in one of
the PC’s two memory categories (storage and user). Place an “S” (storage
memory) or a “U” (user memory) before the information type to indicate in
which memory it is normally found and/or stored.

______ Status of discrete input devices ______ Preset values of


timers and counters

______ Ladder diagram ______ Numeric values


for arithmetic

______ Holding registers

2. When a PC is first turned on it will run a self-diagnostic or self-check test.

❏ True

❏ False

3. The actual scan time, or the time it takes a PC to complete a scan will
decrease as the number of program words increases.

❏ True

❏ False

33
Practical Exercise 1
Directions:

Describe the order of operation of a processor scan, and explain why it is important
to understand the scan process.

34
Unit 7, Programming Basics
Learning Steps

Student Action Where Media

View Unit 7, Programming Basics The PLCTrainer Tutorial


Complete Unit 7, Programming Basics The PLCTrainer Lab
Assignment Sheet 1 Manual
Stop Unit 7, Programming Basics Have Instructor Evaluate
Assignment Sheet 1 Assignment Sheet 1

Complete Unit 7, Programming Basics The PLCTrainer Lab


Assignment Sheet 2 Manual
Stop Unit 7, Programming Basics Have Instructor Evaluate
Assignment Sheet 2 Assignment Sheet 2
Complete Unit 7, Programming Basics The PLCTrainer Lab
Practical Exercise 1 Manual
Stop Unit 7, Programming Basics Have Instructor Evaluate
Practical Exercise 1 Practical Exercise 1
Review Unit 7, Programming Basics The PLCTrainer Tutorial
See Instructor

35
NOTE:
The Practical Exercises from this point on are based on the use of an Allen Bradley
SLC500 – 1747 L30B. Input 0 is a hard-wired, normally closed stop button; Input 1 is a
hard-wired normally open start button.
All other inputs are a variety of toggle switches, limit switches and proximity sensors.
All outputs are operating indicator lights.

An effort has been made to keep the exercises “generic” enough so that any brand or
model of programmable controller may be substituted. All examples in future units will
be in the Allen Bradley format. You may need to adjust the addresses shown to match
your PLC or match the LogixPro Simulator.

LogixPro
If you are using LogixPro for these exercises, the I/O Simulator may be used to
accomplish the solutions to the problems. Keep in mind, there are many
solutions to each of these problems. If your solution accomplishes the proper
operation of the problem you may assume that you have correctly solved the
problem.

On the I/O Simulator, you may “right-click” on an input switch to change its
normal state.

Also note that LogixPro contains a variety of simulations that may be solved in
addition to the problems in this manual. See “Help”, “Student Exercises” for an
introduction to the use of LogixPro and for an explanation of the simulations.

36
Introduction:
The Normally open and Normally Closed symbols used for input devices are used
differently in some applications than others. This variation can be understood by using
relay analogy, looking at the individual bits associated with the I/O devices, or using the
Examine ON, Examine Off true false approach.
Each PC has a maximum network size, or matrix, that limits the number of horizontal
contacts and parallel contacts for any one rung.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the difference between
ladder diagrams, wiring diagrams and ladder logic programs. The learner will also
develop and program several control systems. This will be evidenced by successful
completion of the assignment sheets, practical exercises and the unit quiz.

Enabling Objectives:

1. Identify a wiring diagram.


2. Identify the parts of a ladder diagram.
5. Understand the Examine On instruction
6. Understand the Examine Off instruction
7. Write and understand the ladder logic for a standard stop/start circuit.
8. Convert a ladder diagram with vertical contacts to a PC format
9. Convert a program that includes nested contacts to a program without nested
contacts
10. Address, program and test ladder logic diagrams that operates an output with the
operation of a single input
11. Address, program and test ladder logic diagrams that depicts an AND circuit.
12. Address, program and test ladder logic diagrams that depict an OR circuit.
13. Program and test a standard start/stop circuit.

37
Assignment Sheet 1

1. Define Normally Open and Normally Closed.

2. Describe the difference between a wiring diagram and a ladder diagram.

3. Contacts wired in parallel have what relationship.

❏ AND

❏ Or

4. The 2 main vertical lines of a ladder diagram are often referred to as:

❏ Rungs ❏ Rails

❏ Power ports ❏ Tracks

5. The horizontal lines of a ladder diagram are referred to as:

❏ Rungs ❏ Rails

❏ Power ports ❏ Tracks

38
6. Explain the operation of the following circuit if contacts M on rung 2 do not
close.

7. Devices that are intended to perform a stop function are normally wired in
_____________ with each other.

8. Devices that are intended to start a function are normally wired in


_____________ with each other.

39
Assignment Sheet 2

1. When a normally open limit switch is wired to an input module, and


programmed using a normally open contact symbol (Examine On), the
instruction will be true when: (Check all correct answers)

❏ Power is applied and the ❏ Never


PC is in the run mode

❏ The limit switch is closed ❏ The limit switch is open

2. If the limit switch in question 2 is programmed using a normally closed


(Examine Off) the instruction will be true when: (Check all correct answers)

❏ Power is applied and the ❏ Never


PC is in the run mode

❏ The limit switch is closed ❏ The limit switch is open

3. Draw and label a diagram to show how a network that requires 14 series contacts to
control a discrete output can be programmed on a PC that limits series logic elements
on one line to 10. (Hint: Internal relays are locations in memory that may be used in
solving this problem, see B3:n/n)

40
4. Indicate the logic T (True) or F (False) for the following contacts.

5. Draw a circuit with nested contacts.

41
6. Draw a circuit that retains the logic of the diagram below, which eliminates the
vertical contact. Show the Boolean equation.

7. Power flow in a programmable controller is: (Check ALL correct answers)

❏ Up to down only ❏ Up or down only

❏ Left to right ❏ Right to left

❏ Up or down and ❏ Up, down and


from left to right from left to right

❏ Up to down only and ❏ Up to down only and


left to right right to left

❏ Up or down and left to right


or right to left

8. Write a program for a programmable controller that does NOT allow nested
contacts, for the hand-off-automatic circuit shown below.

42
If you are New To PLCs then Please Read This.!
LogixPro allows you to practice and develop your RSLogix programming skills where and when
you want. It replaces the PLC, ladder rung editor, and all the electrical components that have until
now, been required to learn RSLogix. It doesn't however; replace instructors, texts, tutorials or
PLC documentation manuals etc. which are so essential when learning about PLCs and RSLogix.
Think of LogixPro as a Word Processor which will allow you to practice your literary skills after
you are familiar with the meaning of words and how they are spelled

The LogixPro Screen


The most commonly used elements of LogixPro are displayed below. The Edit Panel provides
easy access to all the RSLogix instructions and they may be simply dragged and dropped into
your program.

Once your program is ready for testing, clicking on the "Toggle Button" of the Edit Panel will bring
the PLC Panel into view. From the PLC Panel you can download your program to the "PLC" and
then place it into the "RUN" mode. This will initiate the scanning of your program and the I/O of
your chosen simulation.

Editing Your Program


If you’re familiar with Windows and how to use a mouse, then you are going to find editing a
breeze. Both Instructions and Rungs are selected simply by clicking on them with the left mouse
button. Deleting is then just a matter of hitting the Del key on your keyboard.

Double Clicking (2 quick clicks) with the left mouse button allows you to edit an instruction's
address while right clicking (right mouse button) displays a pop-up menu of related editing
commands.

Click on an Instruction or Rung with the left mouse button and keep it held down and you will be
able to drag it wherever you please. Let go of it on any of the tiny locating boxes that you will see,
and the Instruction or Rung will cling to its new home. Isn't Windows Grand!

43
Debugging Your Program

If you take a look at the PLC Panel you'll notice an adjustable Speed Control. This is not a
component of normal PLCs, but is provided with LogixPro so that you may adjust the speed of the
simulations to suit your particular computer.

When the simulation is slowed, so is the PLC scanning. You can use this to good effect when
trying to debug your program. Set the scan slow enough and you can easily monitor how your
program's instructions are responding. This capability may not be typical of real PLCs, but for
Training Purposes, you will find that it is an invaluable debugging tool.

RSLogix Documentation

Be sure to check out the entries listed under "RSLogix/LogixPro Reference Documents & Links"
on the lower half of the LogixPro Index page. Also, if you have the space on your hard drive, then
seriously consider installing the "AB SLC® Instruction Set Reference Manual". An installation
program has been provided which will integrate this Manual into the LogixPro Help menu and
give you high speed access to the wealth of information it contains.

Where To Go Next

The LogixPro Student Exercises are designed to familiarize you with the fundamentals of
RSLogix programming. The exercises should be tackled in the sequence listed and the steps and
directions of each exercise should be followed closely. In some cases, you may guess correctly,
that there are simpler ways to accomplish a task that we assign. Just remember however, that
making your life simpler is not our primary goal. We want you to learn, and that sometimes means
having you do things the hard way at times.

If you run into problems with the exercises or LogixPro itself, remember that this is still relatively
new material and software. Don't waste too much time trying to figure out some program action
that seems amiss. Just email us, and we'll do our best to either fix or explain the problem.

Enjoy!

44
Practical Exercise 1
Directions:

Address, program and test the following ladder logic diagrams. Use the addressing
format for the programmable controller available to you. See your instructor for specific
instructions.

(A)
RSLogix (LogixPro) Relay Logic Instructions
This exercise is designed to familiarize you with the operation of LogixPro and to step you
through the process of creating, editing and testing simple PLC programs utilizing the Relay Logic
Instructions supported by RSLogix.

From the Simulations Menu at the top of the screen, Select the I/O Simulation and ensure that the
User Instruction Bar shown above is visible.

The program editing window should contain a single rung. This is the End of Program rung and is
always the last rung in any program. If this is the only rung visible then your program is currently
empty.

If your program is not empty, then click on the File menu entry at the top of the screen and select
"New" from the drop-down list. A dialog box will appear asking for you to select a Processor Type.
Just click on "OK" to accept the default TLP LogixPro selection.

Now maximize the ProSim-II Simulation Window

45
The I/O Simulator

The simulator screen shown above, should now be in view. For this exercise we will be using the
I/O simulator section, which consists of 32 switches and lights. Two groups of 16 toggle switches
are shown connected to 2 Input cards of our simulated PLC. Likewise two groups of 16 Lights are
connected to two output cards of our PLC. The two input cards are addressed as "I:1" and "I:3"
while the output cards are addressed "O:2" and "O:4".

Use your mouse to click on the various switches and note the change in the status color of the
terminal that the switch is connected to. Move your mouse slowly over a switch, and the mouse
cursor should change to a hand symbol, indicating that the state of switch can be altered by
clicking at this location. When you pass the mouse over a switch, a "tool-tip" text box also
appears and informs you to "Right Click to Toggle Switch Type". Click your right mouse button on
a switch, and note how the switch type may be readily changed.

RSLogix Program Creation

Collapse the I/O simulation screen back to its normal size by clicking on the same (center) button
you used to maximize the simulation's window. You should now be able to see both the
simulation and program windows again. If you wish, you can adjust the relative size of these
windows by dragging the bar that divides them with your mouse.

I want you to now enter the following single run program which consists of a single Input
instruction (XIC - Examine If Closed) and a single Output instruction (OTE - Output Energize).
There's more than one way to accomplish this task, but for now I will outline what I consider to be
the most commonly used approach.

First click on the "New Rung" button in the User Instruction Bar. It's the first button on the
very left end of the Bar. If you hold the mouse pointer over any of these buttons for a second or
two, you should see a short "ToolTip" which describes the function or name of the instruction that
the button represents.

46
You should now see a new Rung added to your program as shown above, and the Rung number
at the left side of the new rung should be highlighted. Note that the new Rung was inserted above
the existing (END) End Of Program Rung. Alternatively you could have dragged (left mouse
button held down) the Rung button into the program window and dropped it onto one of the
locating boxes that would have appeared.

Now click on the XIC instruction with your left mouse button (Left Click) and it will be added
to the right of your highlighted selection. Note that the new XIC instruction is now selected
(highlighted). Once again, you could have alternatively dragged and dropped the instruction into
the program window.

If you accidentally add an instruction which you wish to remove, just Left Click on the
instruction to select it, and then press the "Del" key on your keyboard. Alternatively, you
may right click on the instruction and then select "Cut" from the drop-down menu that
appears.

Left Click on the OTE output instruction and it will be added to the right of your current
selection.

Double Click (2 quick left mouse button clicks) on the XIC instruction and a textbox should appear
which will allow you to enter the address (I:1/0) of the switch we wish to monitor. Use the
Backspace key to get rid of the "?" currently in the textbox. Once you type in the address, click
anywhere else on the instruction (other than the textbox) and the box should close.

Right Click on the XIC instruction and select "Edit Symbol" from the drop-down menu that
appears. Another textbox will appear where you can type in a name (Switch-0) to associate with
this address. As before, a click anywhere else will close the box.

Enter the address and symbol for the OTE instruction and your first RSLogix program will now be
complete. Before continuing however, Double check that the addresses of your instructions are
correct.

Testing your Program

It's now time to "Download" your program to the PLC. First click on the "Toggle" button at the top
right corner of the Edit Panel which will bring the PLC Panel into view.

Click on the "DownLoad" button to initiate the downloading of your program to the PLC. Once
complete, click inside the "RUN" option selection circle to start the PLC scanning.

47
Enlarge the Simulation window so that you can see both the Switches and Lamps, by dragging
the bar that separates the Simulation and Program windows to the right with your mouse. Now
click on Switch I:1/00 in the simulator and if all is well, Lamp O:2/00 should illuminate.

Toggle the Switch On and Off a number of times and note the change in value indicated in the
PLC Panel's status boxes which are being updated constantly as the PLC Scans. Try placing the
PLC back into the "PGM" mode and then toggle the simulator's Switch a few times and note the
result. Place the PLC back into the "Run" mode and the Scan should resume.

We are usually told to think of the XIC instruction as an electrical contact that allows electrical
flow to pass when an external switch is closed. We are then told that the OTE will energize if the
flow is allowed to get through to it. In actual fact the XIC is a conditional instruction which tests
any bit that we address for Truth or a 1.

Editing your Program

Click on the "Toggle" button of the PLC Panel which will put the PLC into the PGM mode and
bring the Edit Panel back into view.

Now add a second rung to your program as shown below. This time instead of entering the
addresses as you did before, try dragging the appropriate address which is displayed in the I/O
simulation and dropping it onto the instruction.

Note that the XIO instruction which Tests for Zero or False has it's address highlighted in yellow.
This indicates that the instruction is True, which in the case of an XIO, means that the bit
addressed is currently a Zero or False.

This is probably a good time to practice your drag drop skills. Try moving instructions from rung to
rung by holding the left mouse button down while over an instruction, and then while keeping the
mouse button down, move the mouse (and instruction) to a new location. Try doing the same with
complete rungs by dragging the box at the left end of the rung and dropping it in a new location.

Once you feel comfortable with drag drop, ensure that your program once again looks like the
one pictured above, now download your program to the PLC and place the PLC into the Run
Mode. Toggle both Switch-0 and Switch-1 on and off a number of times and observe the effects
this has on the lamps. Ensure that you are satisfied with the operation of your program before
proceeding further.

Stop/Start utilizing OTL and OTU

For this exercise we need two Normally Open momentary switches. Using your right mouse
button, click on switch "I:1/2" and "I:1/3", changing them to N.O. pushbuttons. Now add the
following two rungs to your program. Once you have the rungs entered correctly, download and
run your modified program.

48
Activate the Start and Stop switches and ensure that the OTL and OTU output instructions are
responding as outlined in your text. Once you have the lamp ON, could you turn it off if power
was lost in the Stop Switch circuit?

Now modify your program so that it operates correctly when you substitute the N.O. Stop switch
(I:1/03) with a Normally Closed Switch. If we now lost power on the N.C. Stop switch circuit, what
would happen to the state of Lamp (O:2/02)?

Emulating Standard Stop/Start Control

Erase your program by selecting "New" from the "File" menu selection at the top of the screen.
When the dialog box appears just click on "OK" to select the default PLC type. Now enter the
following program. To enter a branch, just drag the branch (button) onto the rung and then insert
or drag instructions into the branch.

Before you download and run this program, take a careful look at our use of a XIC instruction to
test the state of the N.C. Stop Switch. When someone presses the Stop Switch, will bit I:1/04 go
True or False? Will the XIC instruction go True or False when the Switch is pressed? Is this the
logic we are seeking in this case? .... Run the program and see if you're right! .... If we loose
power in the Stop Switch circuit, what state will the lamp go to? .... Why do you think that most
prefer this method rather than the OTL/OTU method of implementing Stop/Start Control?

Output Branching with RSLogix

Modify your program so that it matches the following.

Download and Run the program. Operate the Stop and Start switches several times with Switch-0
open, and again with Switch-0 closed. Remove the XIC instruction from the Output branch and

49
note what happens to Lamp-3 when you Start and Stop the circuit. Try moving the Lamp-3 OTE
instruction so that it is in series with the Lamp-2 OTE instruction. Download, Run and observe
how both lamps still light even with the empty branch (short?) in place. It may look like an
electrical circuit but in fact we know that it isn't and therefore obeys a somewhat different set of
rules. Remove the empty branch, Download, Run and see if this has any effect on the logic or
operation of the rung.

Controlling One Light from two Locations

Create, enter and test a program which will perform the common electrical function of controlling
a light from two different locations. Clear your program and utilize toggle switch (I:1/00) and
switch (I:1/01) to control Lamp (O:2/00)... (Hint: If both switches are On or if both switches are
Off, then the Lamp should be On! This of course is just one approach to solving this problem)

50
Unit 8, Timer Instructions
Learning Steps

Student Action Where Media

View Unit 8, Timer Instructions The PLCTrainer Tutorial


Complete Unit 8, Timer Instructions The PLCTrainer Lab
Assignment Sheet 1 Manual
Stop Unit 8, Timer Instructions Have Instructor Evaluate
Assignment Sheet 1 Assignment Sheet 1
Complete Unit 8, Timer Instructions The PLCTrainer Lab
Practical Exercise 1 Manual
Stop Unit 8, Timer Instructions Have Instructor Evaluate
Practical Exercise 1 Practical Exercise 1
Complete Unit 8, Timer Instructions The PLCTrainer Lab
Practical Exercise 2 Manual
Stop Unit 8, Timer Instructions Have Instructor Evaluate
Practical Exercise 2 Practical Exercise 2
Review Unit 8, Timer Instructions The PLCTrainer Tutorial
See Instructor

51
Introduction:
Though the addressing format is different for different programmable controllers, the
basic principles of timers are the same. Preset and accumulated times are stored and
compared on each processor scan. When the accumulated value equals the preset
value, discrete output devices or internal relays can be turned on or off. Timers can be
programmed for On Delay, Off Delay, or as Retentive timers. The only limit to the
number of timed and instantaneous contacts that can be programmed is the memory
size.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss how programmable
control timers operate, and explain the difference between On delay, Off delay and
Retentive timers. The learner will also develop and program several control systems.
This will be evidenced by successful completion of the assignment sheets, practical
exercises and the unit quiz.

Enabling Objectives:
1. Describe how pneumatic time delay relays work.
2. Describe the difference between an On delay timer and an Off delay timer.
3. Describe the difference between an On delay timer and a Retentive timer.
4. Explain how to extend the time range of timers by cascading timers.
5. Program and test ladder logic diagrams that use on delay timers.
6. Program and test ladder logic diagrams that use Off delay timers.
7. Address, program and test ladder logic diagrams that use Retentive timers.
8. Address, program and test ladder logic diagrams that cascade timers.
9. Write and test a program that uses a standard start/stop station to operate several
timers.

52
Assignment Sheet 1

1. Match the standard time delay symbols.

2. The amount of time for which a timer is programmed is called the:

❏ Preset ❏ Set point

❏ Desired time (DT) ❏ All of the above

3. As scan time increases, so does the accuracy of any programmed timers.

❏ True

❏ False

4. When the timing of a device is not reset on a loss of power, the timing is said
to be:

❏ Holding ❏ Retentive

❏ Secured ❏ Continuous

5. When more time is needed than can be programmed with one timer, two or
more timers can be programmed together. This programming technique is
called:

❏ Stacking ❏ Cascading

❏ Doubling ❏ Synchronizing

53
Practical Exercise 1
Directions:

The TON Timer .... (Timer ON Delay)

• From the LogixPro Simulations Menu, select the I/O Simulation.

• Clear out any existing program by selecting the "New" entry in the File menu, and then
select the "Clear Data Table" entry in the Simulations menu.

• Now enter the following program being careful to enter the addresses exactly as shown.

• Confirm that you have entered the number 100 as the timer's preset value. This value
represents a 10 second timing interval (10x0.1) as the timebase is fixed at 0.1 seconds:

• Once you have your program entered, and have ensured that it is correct, download it to
the PLC.

• Ensure that Switch I:1/0 is Open, and then place the PLC into the Run mode.

• Right click on the Timer instruction, and select "GoTo DataTable" from the drop-down
menu.

• Note the initial value of timer T4:1's accumulator and preset in the spaces below. Also
indicate the state of each of the timer's control bits in the spaces provided:

Initial State (Switch I:1/0=Open):


T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN = ____

• Close switch I:1/0, and carefully observe the incrementing of the timer's accumulator, and
the state of each of it's control bits.

• Once the Timer stops incrementing, note the final value of timer T4:1's accumulator,
preset, and the state of it's control bits below:

54
Final State (Switch I:1/0=Closed):
T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN = ____

• Toggle the state of switch I:1/0 a number of times, and observe the operation of the
Timer in both the DataTable display and in the Ladder Rung program display.

• Confirm that when the rung is taken false, the accumulator and all 3 control bits are reset
to zero. This type of timer is a non-retentive instruction, in that the truth of the rung can
cause the accumulator and control bits to be reset (=0).

Conclusions:
Use the TON instruction to turn an output on or off after the timer has been on for a
preset time interval. This output instruction begins timing when its rung goes "true". It
waits the specified amount of time (as set in the Preset), keeps track of the accumulated
intervals which have occurred (Accumulator), and sets the DN (done) bit when the ACC
(accumulated) time equals the PRESET time.

As long as rung conditions remain true, the timer adjusts its accumulated value (ACC)
each evaluation until it reaches the preset value (PRE). The accumulated value is reset
when rung conditions go false, regardless of whether the timer has timed out.

Cascaded TON Timers

• Insert a new rung containing a second timer just below the first rung as shown below.
This second timer T4:2 will be enabled when the first timer's Done bit T4:1/DN goes true
or high (1).

• Once you have completed this addition to your program, download your program to the
PLC and select RUN.

• Toggle the state of switch I:1/0 to ON and observe the operation of the timers in your
program.

• Bring the DataTable display into view, and pay particular attention to the way in which the
timers are cascaded (one timer starts the next).

• Try changing the value of one of the timer presets by double clicking on the preset value
in the DataTable display, and then entering a new value.

55
• Run the timers through their timing sequence a number of times. Don't move on until you
are satisfied that the timers are working as you would expect

In this exercise we have utilized just two timers, but there is nothing stopping us from
sequencing as many timers as we wish. The only thing to remember is; to use the DN
(done) bit of the previous timer to enable the next timer in the sequence. Obviously
locating the timers on consecutive rungs, and employing consecutive numbering will
make such a program much easier to read and trouble-shoot.

Self Resetting Timers

• Place the PLC into the PGM mode, and modify the first rung of your program as depicted
below.

• Once you have modified your program, download it to the PLC and place the PLC into
the RUN mode.

• Close switch I:1/0 and observe the operation of the timers. The timers should now be
operating in a continuous loop with Timer1 starting Timer2, and then when Timer2 is
done, Timer1 is reset by Timer2's done bit. As before, when Timer1 is reset, it in turn
resets Timer2 which causes Timer2's done to go low (T4:2/DN=0). Once Timer2's done
bit is low, the sequence is back to where it originally began, and the timing sequence will
start over once again on the very next scan.

• Remove the first instruction (switch XIC I:1/0) from rung zero of your program.

• Download and RUN this modified version of your program

• Does the timing operation continuously sequence as before? It should!

• Can you stop the timing sequence? Not without taking the PLC out of the RUN mode! In
many applications there may never be a need to stop such a timing sequence, so a
switch might not be used or needed.

In this exercise we cascaded two timers, but as before there is nothing to stop us from
cascading as many timers as we wish. The thing to remember here is; utilize the DN (XIC
or "NOT” done) bit of the last timer in the sequence to reset the first timer in the
sequence. Once again, consecutive rungs, and numbering will make a program much
easier to read and trouble-shoot.

The TOF Timer .... (Timer OFF Delay)

In Allen Bradley PLC programming, the TON timer is by far the most commonly used type
of timer. Most people consider TON timers to be simple to use and understand. In
comparison, many people find the operation of the Allen Bradley TOF (Timer OFF delay)
timer to be less intuitive, but I'm going to let you decide for yourself.

56
• Make sure that switch I:1/0 is Closed, and then enter or modify your existing program to
match the one shown below.

• Once you have your program entered, and have ensured that it is correct, download it to
the PLC.

• Ensure that Switch I:1/0 is Closed, and then place the PLC into the Run mode.

• Right click on the Timer instruction, and select "GoTo DataTable" from the drop-down
menu.

• Note the initial value of timer T4:1's accumulator and preset in the spaces below. Also
indicate the state of each of the timer's control bits in the spaces provided:

Initial State (Switch I:1/0=Closed):


T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN = ____

• Open switch I:1/0, and carefully observe the incrementing of the timer's accumulator, and
the state of each of it's control bits.

• Once the Timer stops incrementing, note the final value of timer T4:1's accumulator,
preset, and the state of it's control bits below:

Final State (Switch I:1/0=Open):


T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN = ____

• Toggle the state of switch I:1/0 a number of times, and observe the operation of the
Timer in both the DataTable display and in the Ladder Rung program display.

• Confirm that when the rung is taken true, the accumulator and all 3 control bits are reset
to zero. The TOF timer like the TON timer is also a non-retentive instruction and can be
reset by changing the truth of the rung.

Conclusions:
Use the TOF instruction to turn an output on or off after its rung has been off for a preset
time interval. This output instruction begins timing when its rung goes "false." It waits the
specified amount of time (as set in the PRESET), keeps track of the accumulated

57
intervals which have occurred (ACCUM), and resets the DN (done) bit when the ACCUM
(accumulated) time equals the PRESET time.

The Accumulated value is reset when rung conditions go true regardless of whether the
timer has timed out.

The RTO Timer .... (Retentive Timer ON)

• Make sure that switch I:1/0 is Open, and then replace the TOF timer in your program with
a RTO retentive timer.

• Now insert a new rung below the timer, and add the XIC,I:1/1 and RES,T4:1 instructions.

• Your program should now match the one shown below:

• Once you have your program entered, and have ensured that it is correct, download it to
the PLC.

• Ensure that both Switches are Open, and then place the PLC into the Run mode.

• Right click on the Timer instruction, and select "GoTo DataTable" from the drop-down
menu.

• Note the initial value of timer T4:1's accumulator, preset and control bits. Are we starting
off with the same values we had in the TON exercise? You should be answering Yes.!

• Close switch I:1/0 for 2 or 3 seconds and then Open it again.

• Note that the timer stopped timing when the rung went false, but the accumulator was not
reset to zero.

58
• Close the switch again and leave it closed which will allow the timer to time-out
(ACC=PRE).

• Once timed out, note the state of the control bits

• Open the switch, and once again note the state of the control bits.

• Now close Switch I:1/1 and leave it closed. This will cause the Reset instruction to go
true.

• Close switch I:1/0 momentarily to see if the timer will start timing again. It should not!

• Open Switch I:1/1 which will cause the Reset instruction return to false.

• Now toggle switch I:1/0 several times and note that the timer should again start timing as
expected.

• Repeat the foregoing steps, until you are satisfied that you clearly understand the
operation of both the RTO timer, and the Reset instruction.

Conclusions:
An RTO timer functions the same as a TON with the exception that once it has begun
timing, it holds its count of time even if the rung goes false, a fault occurs, the mode
changes from RUN to PGM, or power is lost. When rung continuity returns (rung goes
true again), the RTO begins timing from the accumulated time which was held when rung
continuity was lost. By retaining its accumulated value, retentive timers measure the
cumulative period during which rung conditions are true.

59
(B)

In the space below, write a brief explanation of the operation of the circuit shown
above. Be sure to include an explanation of the use of the Enable Bit if Input 5 is
a momentary contact.

60
Practical Exercise 2
Directions:

Design, program and test a ladder logic program that will operate as follows:
When the hard-wired normally open start button is pressed, output 3 will energize and
timer 1 will energize. Fifteen seconds later output 4 will energize; twelve seconds later
output 0 will energize. As soon as the hard-wired normally closed stop button is pressed
all outputs will de-energize. Upon completion of the program, write a brief explanation
of its operation.

61
Unit 9, Counter Instructions
Learning Steps

Student Action Where Media

View Unit 9, Counter Instructions The PLCTrainer Tutorial


Stop Unit 9, Programming Have Instructor Evaluate
Counters Assignment Sheet 1
Assignment Sheet 1
Complete Unit 9, Programming The PLCTrainer Lab
Counters Manual
Practical Exercise 1
Stop Unit 9, Programming Have Instructor Evaluate
Counters Practical Exercise 1
Practical Exercise 1
Complete Unit 9, Programming The PLCTrainer Lab
Counters Manual
Practical Exercise 2
Stop Unit 9, Programming Have Instructor Evaluate
Counters Practical Exercise 2
Practical Exercise 2
Complete Unit 9, Programming The PLCTrainer Lab
Counters Manual
Practical Exercise 3
Stop Unit 9, Programming Have Instructor Evaluate
Counters Practical Exercise 3
Practical Exercise 3
Review Unit 9, Programming The PLCTrainer Tutorial
Counters
See Instructor

62
Introduction:
Programmed counters give added flexibility and control for electrical process equipment
and/or driven machinery. Like timers, counters store values in Binary or Binary coded
decimal (BCD) format for the preset and accumulated count. For up counters the
processor compares the preset and accumulated values on each scan and updates the
I/O section on the scan that the accumulated value equals the preset value. For down
counters the processor updates the I/O section when the accumulated value is 0 for
some PC’s and when the accumulated value is equal to or greater than the preset with
other PC’s. Counters count, increment or decrement, when the count rung transition is
from false to true.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss how programmable
control counters operate. The learner will also develop and program several control
systems. This will be evidenced by successful completion of the assignment sheets,
practical exercises and the unit quiz.

Enabling Objectives:
1. Name the different types of counters.
2. Define the terms increment and decrement.
3. Address, program and test diagrams using up counters.
4. Address, program and test a diagram using a down counter.
5. Address, program and test a diagram using a combination of counters (up/down)
6. Design, program and test a ladder logic diagram that utilizes counters.

63
Assignment Sheet 1

1. The diagram below shows input 2 open. When the input is closed, counter
C5:4 will:

❏ Increment by 1

❏ Decrement by 1

2. The reset rung in the diagram below will reset counter C5:4:

❏ Automatically when the ❏ Automatically when


count reaches 20 the count reaches 4

❏ When input 3 is closed ❏ When input 3 is open

64
3. Counters can count past their preset value.

❏ True

❏ False

4. Output 10 shown in the diagram below will be true when:

❏ Only when the preset and ❏ When the accumulated value is


accumulated values are equal equal to or greater than the preset

❏ When the accumulated value ❏ When the count reaches 4


reaches 32767 and overflows

5. Up and down counters may be programmed together to count up and down.

❏ True

❏ False

6. Define the term increment.

65
8. Define the term decrement.

66
Practical Exercise 1
Directions:

The CTU and RES ...... Counter Instructions

• From the LogixPro Simulations Menu, select the I/O Simulation.

• Clear out any existing program by selecting the "New" entry in the File menu, and then
select the "Clear Data Table" entry in the Simulations menu.

• Now enter the following program being careful to enter the addresses exactly as shown.

• Confirm that you have entered the number 10 as the counter's preset value. This value is
optionally used to set the point at which the counter's Done Bit will be Set, indicating that
the count is complete.

• Once you have your program entered, and have ensured that it is correct, download it to
the PLC.

• Ensure that Switch I:1/0 and I:1/1 are Open, and then place the PLC into the Run mode.

• Right click on the CTU instruction, and select "GoTo DataTable" from the drop-down
menu.

• Note the initial value of Counter C5:1's accumulator and preset in the spaces below. Also
indicate the state of each of the Counter's primary control bits in the spaces provided:

67
Initial State (Switch I:1/0=Open):
C5:1.ACC = _______ C5:1.PRE = _______ C5:1/CU = ___ C5:1/CD = ___ C5:1/DN =
___

• Open and Close switch I:1/00 a number of times and carefully observe the incrementing
of C5:1's accumulator and the operation of the enable and done bits.

• Close switch I:1/01 and observe the effect that the "RES" instruction has on the counter.

• Attempt to increment the counter while switch I:1/01 is closed. You should not be able to
increment the counter while the "RES" instruction is held "True".

• Open switch I:1/01 to allow the "RES" instruction to go false, and then increment the
counter until the accumulator matches the preset.

• Increment the counter 2 or 3 more times and note the final value of C5:1's accumulator,
preset and status bits in the spaces below.

Final State (Switch I:1/0=Closed):


C5:1.ACC = _______ C5:1.PRE = _______ C5:1/CU = ___ C5:1/CD = ___ C5:1/DN =
___

Conclusions:
The CTU output instruction counts up for each false-to-true transition of conditions preceding it in
the rung and produces an output (DN) when the accumulated value reaches the preset value.
Rung transitions might be triggered by a limit switch or by parts traveling past a detector etc.

The ability of the counter to detect a false-to-true transitions depends on the speed (frequency) of
the incoming signal. The on and off duration of an incoming signal must not be faster than the
scan time.

Each count (accumulator) is retained when the rung conditions again become false, permitting
counting to continue beyond the preset value. This way you can base an output on the preset but
continue counting to keep track of inventory/parts, etc.

Use a RES (reset) instruction with the same address as the counter, or another instruction in your
program to overwrite the value of the accumulator and control bits. The on or off status of counter
done, overflow, and underflow bits is retentive. The accumulated value and control bits are reset
when a RES is enabled.

68
(B)

Use input 6 to increment the counter, when the preset is equal to 20, turn on the
output on rung 1, and turn off the output on rung 2. Use input 9 to reset the
counter. Write a brief explanation of the operation of the circuit in the space
below.

69
Practical Exercise 2
Directions:

Program and test the following ladder logic diagram. Use the addressing format for the
programmable controller available to you. See your instructor for specific instructions.

Choose your input devices and addresses for the operation of the counter and
the reset. Have the counter operate the output on rung 1. In the space below,
write a brief explanation of the operation of the circuit shown above.

70
Practical Exercise 3
Directions:

Program and test the following ladder logic diagram. Use the addressing format for the
programmable controller available to you. See your instructor for specific instructions.

Choose your input devices and addresses for the operation of the counters and
the reset. Have the counter operate the output on rung 1. In the space below,
write a brief explanation of the operation of the circuit shown above.

71
Practical Exercise 4
Directions:

Design, program and test a ladder logic program that will operate as follows:
You have been assigned the task of designing and building a control system that will
monitor the number of cars entering and exiting the parking garage at your place of
employment. The parking garage has a total of 300 parking spaces. When the total
number of cars within the garage is equal to 300, a lighted sign should come on that will
announce that all parking spaces are taken.

Cars entering the garage are sensed by an inductive proximity sensor embedded in the
concrete. The cars that exit the garage are also sense by another proximity sensor
embedded in the exit ramp concrete.

72
Scenario Problems
Group 1
The following are a series of scenario problems designed to help you apply the
knowledge that you have gained thus far. Each scenario is applicable to a “real world”
application for a programmable controller. You are encouraged to apply any and all
knowledge of programmable controller instructions and operations. Additionally, each
scenario will require you to compose a written explanation of the operation of the control
system. This explanation must include detailed operating instructions. Documentation
of your programs is essential.

Note:
A common method of programming a series of interdependent events is referred to an
Event Sequence Programming. This method is dependent upon the completion of 1
event before the next event takes place. An example of event sequence programming is
shown below.

Consider the following operation of a pneumatic pick-and-place robot.


When start is pressed, if all actuators are in the proper position the robot arm will extend.
When it is completely extended, the gripper will close. Once the gripper is closed, the
robot will raise. After it is fully raised the robot will rotate right. As soon as it is
completely rotated right it will open the gripper. When the gripper is opened the robot
will rotate left, and then lower.

73
74
Scenario 1:

LogixPro
The Silo Lab
Utilizing Relay Logic

The ProSim-II Silo Simulation


From the Simulations Menu at the top of the screen, Select the Silo Simulation

Exercise #1 -- Continuous Operation

Completely design and de-bug a ladder control circuit which will automatically position and
fill the boxes which are continuously sequenced along the conveyor. Ensure that the
following details are also met:

• The sequence can be stopped and re-started at any time using the panel mounted
Stop and Start switches.

• The RUN light will remain energized as long as the system is operating
automatically.

• The RUN light, Conveyor Motor and Solenoid will de-energize whenever the
system is halted via the STOP switch.

75
• The FILL light will be energized while the box is filling.

• The FULL light will energize when the box is full and will remain that way until the
box has moved clear of the prox-sensor.

Exercise #2 -- Container Filling with Manual Restart

Alter or re-write your program so that it incorporates the following changes:

• Stop the conveyor when the right edge of the box is first sensed by the prox-
sensor.

• With the box in position and the conveyor stopped, open the solenoid valve and
allow the box to fill. Filling should stop when the Level sensor goes true.

• The FILL light will be energized while the box is filling.

• The FULL light will energize when the box is full and will remain that way until the
box has moved clear of the prox-sensor.

• Once the box is full, momentarily pressing the Start Switch will move the box off
the conveyor and bring a new box into position. Forcing the operator to hold the
Start button down until the box clears the prox-sensor is not acceptable.

Exercise #3 -- Selectable Mode of Operation

Alter or re-write your program so that the panel mounted Selector switch can be utilized to
select one of 3 different modes of operation. The 3 modes shall operate as follows:

• When the selector switch is in position "A", the system shall operate in the
"Continuous" mode of operation. This is the mode of operation which was used in
Exercise #1.

• When the selector switch is in position "B", the system shall operate in the "Manual
Restart" mode of operation. This is the mode of operation which was used in
Exercise #2.

• When the selector switch is in position "C", the system shall operate in the "Fill
Bypass" mode of operation. In this mode, the boxes will simply move down the
conveyor continuously and bypass the fill operation. As in the other modes, the
Start and Stop pushbuttons will control the conveyor motion and the Run Lamp will
operate as expected.

76
Scenario 2:

LogixPro
Door Simulation Lab
Utilizing Relay Logic

The ProSim-II Door Simulation


From the Simulations Menu at the top of the screen, Select the Door Simulation.

Take the time to familiarize yourself with the components used in the Door system, and
take particular note of the current state of the limit switches. When the door is in the closed
position, both limit switches are in their activated state (Not Normal). Run your mouse over
each switch, and you should see a tool-tip text box appear, which denotes that the selected
switch is wired using a set of Normally Open contacts. With the door fully closed, what
signal level would you expect to see at the limit switch inputs I:1/03 and I:1/04?

To confirm your assessment of the current limit switch states, place the PLC into the RUN
mode which will initiate scanning. Now open the Data Table display by clicking on the Data
Table icon located on the toolbar (3rd from right) at the top of the screen.

When you have the Data Table showing, select the "Input Table" from the drop down Table
list box. You should now be able to see the current state of each bit associated with input
card I:1. You should also note that bit I:1/02 is also in a High or True state. Use your
mouse to press the Stop switch on the Control Panel a few times, and note the results.
Don't continue on with the exercise until you are confident that you understand the rational
of the observed results.

Student Programming Exercise #1:

77
In this exercise we want you to apply your knowledge of Relay Logic Instructions to design
a program which will control the ProSim-II Door. The Door System includes a Reversible
Motor, a pair of Limit Switches and a Control Panel, all connected to your PLC. The
program you create will monitor and control this equipment while adhering to the following
criteria:

• In this exercise the Open and Close pushbuttons will be used to control the
movement of the door. Movement will not be maintained when either switch is
released, and therefore the Stop switch is neither required nor used in this
exercise. However, all other available Inputs and Outputs are employed in this
exercise.

• Pressing the Open Switch will cause the door to move upwards (open) if not
already fully open. The opening operation will continue as long as the switch is
held down. If the switch is released, or if limit switch LS1 opens, the door
movement will halt immediately.

• Pressing the Close Switch will cause the door to move down (close) if not already
fully closed. The closing operation will continue as long as the switch is held down.
If the switch is released, or if limit switch LS2 closes, the door movement will halt
immediately.

• If the Door is already fully opened, Pressing the Open Switch will Not energize the
motor.

• If the Door is already fully closed, Pressing the Close Switch will Not energize the
motor.

• Under no circumstance will both motor windings be energized at the same time.

• The Open Lamp will be illuminated if the door is in the Fully Open position.

• The Shut Lamp will be illuminated if the door is in the Fully Closed position.

It is your responsibility to fully design, document, debug, and test your Program. Avoid the
use of OTL or OTU latching instructions, and make a concerted effort to minimize the
number of rungs employed.

Ensure that you have made effective use of both instruction and rung comments to clearly
document your program. All I/O components referenced within your program should be
clearly labeled, and rung comments should be employed to add additional clarity as
required.

Student Programming Exercise #2:

78
In this exercise we want you to apply your knowledge of Relay Logic Instructions to design
a program which will maintain the appropriate door movement once initiated by the
operator. The Opening or Closing operation of the door will continue to completion even if
the operator releases the pushbutton which initiated the movement. The program will
adhere to the following criteria:

• Door movement will halt immediately when the Stop Switch is initially pressed, and
will remain halted if the switch is released.

• Pressing the Open Switch will cause the door to Open if not already fully open. The
opening operation will continue to completion even if the switch is released.

• Pressing the Close Switch will cause the door to Close if not already fully shut. The
closing operation will continue to completion even if the Switch is released.

• If the Door is already fully opened, Pressing the Open Switch will Not energize the
motor.

• If the Door is already fully closed, Pressing the Close Switch will Not energize the
motor.

• Under no circumstance will both motor windings be energized at the same time.

• The Ajar Lamp will be illuminated if the door is NOT in either the fully closed or fully
opened position.

• The Open Lamp will be illuminated if the door is in the Fully Open position.

• The Shut Lamp will be illuminated if the door is in the Fully Closed position.

It is your responsibility to fully design, document, debug, and test your Program. Avoid the
use of OTL or OTU latching instructions, and make a concerted effort to minimize the
number of rungs employed.

As before, ensure that you have made effective use of both instruction and rung comments
to clearly document your program.

Student Programming Exercise #3:


In this exercise we want to introduce you to a simple programming technique for adding a
bit of "Flash" to your program. We want you to make use of the PLC's Free Running Timer
which can be viewed in the Data Table Display at location S2:4. This integer word contains
a count which is incremented continuously by the PLC when it is in the Run mode, and it
can come in quite handy at times for variety of purposes. In this exercise we want you to

79
utilize this word as follows:

With the PLC in the Run mode, Display word S2:4 utilizing the Data Table display. Ensure
that the Radix is set to Binary so that you can view the individual bits within the word. You
should see a binary count in progress where the rate of change of each bit is directly
related to it's position within the word. Bit 0 will have the highest rate, while Bit 1 will be 1/2
as fast as Bit 0, and Bit 2 half as fast as 1 etc. etc.

We want you to add a Lamp Flasher to your program by monitoring the state of one of
these bits with an XIC instruction. I'm going to suggest using Bit 4 for this purpose, but
depending upon the speed of your computer you may elect to substitute another Bit. With
an actual AB PLC, the rate is consistent, but with LogixPro it varies from computer to
computer.

Place an XIC instruction addressed to S:4/4 on the rung which controls either the Open or
Shut Lamp in your previous program. Now download and Run this modified program to see
the flashing effect achieved. The Lamp should flash at a reasonable rate whenever your
program energizes the selected Lamp.

Now modify your program so that the following criteria is met:

• If the Door is fully open, the Open lamp will be energized but not flashing as was
the case before.

• If the Door is opening, the Open lamp will flash while the door is in motion.

• If the Door is fully closed, the Shut lamp will be energized but not flashing as was
the case before.

• If the Door is closing, the Shut lamp will flash while the door is in motion.

• The Ajar Lamp will flash if the door is stationary, and is not in the fully open or fully
closed position. The Ajar Lamp will flash at a slower rate (1/4) then the other
lamps.

• The Ajar Lamp will be illuminated in a steady state if the door is in motion.

As before, ensure that you have made effective use of both instruction and rung comments
to clearly document your program.

Supplemental Programming Exercise #4:


We do not recommend proceeding with this exercise if you do not have an instructor or
experienced PLC programmer to call upon for assistance.

In this exercise we want you to modify your program so that it adheres to this additional
criteria:

80
• If the door is currently opening, pressing the Close Switch will immediately halt
movement. Door movement will remain halted when the switch is released.

• If the door is currently closing, pressing the Open Switch will immediately halt
movement. Door movement will remain halted when the switch is released.

• Once movement is halted by the either of the foregoing actions, the operating
criteria associated with the previous exercise will again take effect.

• The utilization of Binary or Integer Table bits to Flag specific conditions within your
program would be appropriate. Also, the retentive OTL and OTU instructions may
be utilized freely at your discretion.

81
Scenario 3:

PSIM
Traffic Control Lab
Utilizing TON Timers

Traffic Control using 3 Lights

Exit to the Main Menu and select the Traffic Light simulation.

Using your knowledge of cascading timers, develop a ladder logic program which will
sequence a set of green, amber and red lights in the following manner:

Sequence of Operation:

1. Light O:1/00 (Red) = 12 seconds ON

2. Light O:1/02 (Green) = 8 seconds ON

3. Light O:1/01 (Amber) = 4 seconds ON

4. The sequence now repeats with Red = ON.

<----------------- Time in Seconds ------------------>

RED GREEN AMBER

12 Sec. 8 Sec. 4 Sec.

Traffic Control using 6 Lights

Modify your program so that the 3 lights which represent the other traffic direction are also
controlled.

82
Red = O:1/00 Green = O:1/02 Amber = O:1/01

Green = O:1/06 Amber = O:1/05 Red = O:1/04

8 Sec. 4 Sec. 8 Sec. 4 Sec.

Traffic Light Control With Delayed Green

Modify your program so that there is a 1 second period when both directions will have their
RED lights illuminated. Using the timing diagram below, note that two 1 second periods are
required in this sequence.

Red = O:1/00 Green = O:1/02 Amber = O:1/01

Green = O:1/06 Amber = O:1/05 Red = O:1/04

8 Sec. 4 Sec. 1 8 Sec. 4 Sec.

83
Scenario 4:

PSIM
The Batch Mix Lab
Utilizing PLC Counters

Filling the Batch Mixing Tank

Exit to the Main Menu and select the Batch Mixing simulation.

Using your knowledge of PLC counters, design a program to meet the following
requirements:

o When switch S2 is pressed, pump P1 will be energized and the tank will
start to fill. The pulses generated by flowmeter FL1 should be used to
increment a counter.

o When the count reaches a value where the tank is approximately 90% full,
the pump is to be shut-off and the status panel FULL light is to be
energized.

o The filling operation is to halt immediately if the stop switch S1 is pressed.

Note: exiting to the main menu and then returning to the batch mix simulation will
clear the tank etc. and allow you to retry your program.

Emptying the Batch Mix Tank

Modify your program so that:

• The mixer will run for 8 seconds once the tank is full.

• When the mixer stops, pump P3 is to be started and the tank is to be drained till
the counter's accumulator reaches zero.

• Pressing switch S2 will cause the sequence to repeat.

84
Continuous Operation

Modify your program so that the filling and emptying sequence will repeat
continuously once it has been started by the initial pressing of switch S2.

• Ensure that the RUN light is energized when the mixer or either pump is running.

• The STANDBY light should light and the process should halt when the Stop button
is pressed.

• The process should restart where it left off if the Start button is pressed following a
Stop.

85
Unit 10, Program Control
Instructions
Learning Steps

Student Action Where Media

View Unit 11, Program Control The PLCTrainer Tutorial


Instructions
Complete Unit 11, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 11, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 11, Assignment Sheet The PLCTrainer Lab
2 Manual
Complete Scenario 1 The PLCTrainer Lab
Manual
Stop Scenario 1 Have Instructor Evaluate
Scenario 1
Complete Scenario 2 The PLCTrainer Lab
Manual
Stop Scenario 2 Have Instructor Evaluate
Scenario 2
Complete Scenario 3 The PLCTrainer Lab
Manual
Stop Scenario 3 Have Instructor Evaluate
Scenario 3
Complete Scenario 4 The PLCTrainer Lab
Manual
Stop Scenario 4 Have Instructor Evaluate
Scenario 4
Complete Scenario 5 The PLCTrainer Lab
Manual
Stop Scenario 5 Have Instructor Evaluate
Scenario 5
See Instructor

86
Introduction:
Program Control Instructions such as Master Control Instructions, Latching Instructions,
Jump to Label Instructions and Jump to Subroutine Instructions are essential in the
operation of many automated systems.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss the proper use and
operation of Master Control Instructions, Latching Instructions, Jump to Label
Instructions, Jump to Subroutine Instructions, and Temporary End Instructions. This will
be evidenced by the proper execution of several programs utilizing these instructions as
well as successful completion of assignment sheets and test.

Enabling Objectives:
1. Complete Assignment Sheet 1.
2. Complete Assignment Sheet 2.
1. Design and test a program using a Master Control Instruction.
2. Design and test a program using a Jump to Label Instruction.
3. Design and test a program using a Jump to Subroutine Instruction.
4. Design and test a program using a Latching Instruction.
5. Design and test a program using a Temporary End Instruction.
6. Design and test a program using an OSR Instruction to operate an output.

87
Assignment Sheet 1
1. The MCR instruction can be used to control:

❏ (A) Entire sections of a program. ❏ (C) Selected elements within a


rung.

❏ (B) Entire rungs. ❏ Both A and B.

2. An OTL instruction will remain ON even if it is contained within a deactivated


MCR zone.

❏ True

❏ False

3. Not all latching relay Instructions require an unlatch instruction.

❏ True

❏ False

4. The latch instruction is retentive, this means:

❏ It will remain ON until the Unlatch instruction is true.

❏ It does not require a reset instruction.

❏ Very few PLCs have this instruction.

❏ None of the above.

5. NEMA requires an electromechanical or redundant means of interrupting the


cycle of a PLC.

❏ True

❏ False

88
6. The best method of providing for a safety or emergency stop circuit is:

❏ Push/Pull Emergency Stop Button.

❏ A magnetically held 3-wire control.

❏ A single pole switch.

❏ A programmed emergency stop using an MCR instruction.

7. The JMP and LABEL instructions allow a processor to:

❏ Return to the beginning of the program.

❏ Take a shorted route to the end of the program.

❏ Skip sections of a program, reducing scan time.

❏ Create a fault condition.

8. The JSR instruction requires that :

❏ A separate PLC is used to run the subroutine.

❏ A programmer has experience at creating subroutines.

❏ More money is spent on a more powerful processor.

❏ A separate file is created, and assigned a number between 3 and 256.

9. The TND instruction is used primarily for:

❏ Emergency stop

❏ Resetting the Watchdog Timer

❏ Debugging and trouble shooting.

89
10. A one shot instruction will allow a rung to be true for one scan only based on
the:

❏ Logic to its right.

❏ False to true transition of the contact to its immediate left.

❏ Conditions preceding the output instruction..

90
Assignment Sheet 2

1. Two MCR Output instructions are used to control a section of a program.


Explain the procedure used to control that section. Be sure to include an
explanation of how the inputs and outputs within the “fenced zone” will be
affected when the instruction controlling the MCR makes a transition from
false to true. Also explain how they will be affected when the instruction
makes a true to false transition.

2. Two Jump to Label Output instructions are used to control a section of a


program. Explain the procedure used to control that section. Be sure to
include an explanation of how the inputs and outputs within the “fenced zone”
will be affected when the instruction controlling the Jump to Label makes a
transition from false to true. Also explain how they will be affected when the
instruction makes a true to false transition.

91
3. A Jump to Subroutine instruction is used to control a section of a program.
Explain the procedure used to control that section. Be sure to include an
explanation of how the inputs and outputs within the “fenced zone” will be
affected when the instruction controlling the Jump to Subroutine instruction
makes a transition from false to true. Also explain how they will be affected
when the instruction makes a true to false transition.

4. What type of instruction is usually not included within a “fenced” section of a


program and why?

5. The “forcing” capability of a PLC allows the user to do what?

6. Briefly discuss 2 practical reasons for using a force instruction.

7. Explain why EXTREME CARE must be used when using a force function.

92
Scenario 1:
Design, program test and document the following control system using a Master Control
Instruction: (Use the I/O Simulator in LogixPro)

Koldwater Technologies, LLC has just entered the grain exportation business. In the
process to modernize the older plant they purchased, PLC control must be added. The
engineers designing the retrofit have specified to addition of a second line of 3
conveyors. Times will arise when the original conveyors, 1, 2 and 3 will be the only ones
needed. At other times, 1, 2, and 3 as well as the new 4, 5 and 6 will be required.

The system should be started and stopped through the operation of a start/stop station.
Additionally, there must be a 2 position switch that will allow the facility operator to select
the 3 original conveyors or all 6 conveyors. The start-up and shut-down sequence will
be as follows.

Press “start” with the selector in the “3” conveyor position.


1. Conveyor 3 will start.
2. After a 15 second delay, conveyor 2 will start.
3. After a 10 second delay, conveyor 1 will start.
Press “stop”
1. Conveyor 1 will stop.
2. After a 20 second delay, conveyor 2 will stop.
3. After a 12 second delay, conveyor 3 will stop.

Press “start” with the selector in the “6” conveyor position.


1. Conveyor 6 will start.
2. After a 15 second delay, conveyor 5 will start.
3. After a 10 second delay, conveyor 4 will start.
4. After a 15 second delay, conveyor 3 will start.
5. After a 29 second delay, conveyor 2 will start.
6. After a 3 second delay, conveyor 1 will start.
Press “stop”
1. Conveyor 1 will stop.
2. After a 20 second delay, conveyor 2 will stop.
3. After a 12 second delay, conveyor 3 will stop.
4. After a 3 second delay, conveyor 4 will stop.
5. After a 16 second delay, conveyor 5 will stop.
6. After a 5 second delay, conveyor 6 will stop.

You might investigate the use of internal relays(B3.X) within the “zones” of the
MCRs, instead of using actual output instructions. The internal relays could
operate the actual output instructions that are not within a “fenced zone”.

93
Scenario 2:
Design, program test and document the following control system using a Jump to Label
instruction: (Use the I/O Simulator in LogixPro)

Koldwater Technologies, LLC has just entered the grain exportation business. In the
process to modernize the older plant they purchased, PLC control must be added. The
engineers designing the retrofit have specified to addition of a second line of 3
conveyors. Times will arise when the original conveyors, 1, 2 and 3 will be the only ones
needed. At other times, 1, 2, and 3 as well as the new 4, 5 and 6 will be required.

The system should be started and stopped through the operation of a start/stop station.
Additionally, there must be a 2 position switch that will allow the facility operator to select
the 3 original conveyors or all 6 conveyors. The start-up and shut-down sequence will
be as follows.

Press “start” with the selector in the “3” conveyor position.


4. Conveyor 3 will start.
5. After a 15 second delay, conveyor 2 will start.
6. After a 10 second delay, conveyor 1 will start.
Press “stop”
4. Conveyor 1 will stop.
5. After a 20 second delay, conveyor 2 will stop.
6. After a 12 second delay, conveyor 3 will stop.

Press “start” with the selector in the “6” conveyor position.


7. Conveyor 6 will start.
8. After a 15 second delay, conveyor 5 will start.
9. After a 10 second delay, conveyor 4 will start.
10. After a 15 second delay, conveyor 3 will start.
11. After a 29 second delay, conveyor 2 will start.
12. After a 3 second delay, conveyor 1 will start.
Press “stop”
7. Conveyor 1 will stop.
8. After a 20 second delay, conveyor 2 will stop.
9. After a 12 second delay, conveyor 3 will stop.
10. After a 3 second delay, conveyor 4 will stop.
11. After a 16 second delay, conveyor 5 will stop.
12. After a 5 second delay, conveyor 6 will stop.

94
Scenario 3:
Design, program and test and document the following control system using a Jump to
Subroutine instruction: (Use the I/O Simulator in LogixPro)

Koldwater Technologies, LLC has just entered the grain exportation business. In the
process to modernize the older plant they purchased, PLC control must be added. The
engineers designing the retrofit have specified to addition of a second line of 3
conveyors. Times will arise when the original conveyors, 1, 2 and 3 will be the only ones
needed. At other times, 1, 2, and 3 as well as the new 4, 5 and 6 will be required.

The system should be started and stopped through the operation of a start/stop station.
Additionally, there must be a 2 position switch that will allow the facility operator to select
the 3 original conveyors or all 6 conveyors. The start-up and shut-down sequence will
be as follows.

Press “start” with the selector in the “3” conveyor position.


7. Conveyor 3 will start.
8. After a 15 second delay, conveyor 2 will start.
9. After a 10 second delay, conveyor 1 will start.
Press “stop”
7. Conveyor 1 will stop.
8. After a 20 second delay, conveyor 2 will stop.
9. After a 12 second delay, conveyor 3 will stop.

Press “start” with the selector in the “6” conveyor position.


13. Conveyor 6 will start.
14. After a 15 second delay, conveyor 5 will start.
15. After a 10 second delay, conveyor 4 will start.
16. After a 15 second delay, conveyor 3 will start.
17. After a 29 second delay, conveyor 2 will start.
18. After a 3 second delay, conveyor 1 will start.
Press “stop”
13. Conveyor 1 will stop.
14. After a 20 second delay, conveyor 2 will stop.
15. After a 12 second delay, conveyor 3 will stop.
16. After a 3 second delay, conveyor 4 will stop.
17. After a 16 second delay, conveyor 5 will stop.
18. After a 5 second delay, conveyor 6 will stop.

Within the subroutines it is possible to “reuse” an output address more than once.
Therefore the use of internal relays is not necessary.

95
Scenario 4:
Design, program and test and document the following control system using a Latching
Instruction. (Use the I/O Simulator in LogixPro)

When start is pressed, output 1 will energize, 5 seconds later output 2 will energize, 2
seconds later output 3 will energize. If power is removed from the PLC the outputs will
come back on as soon as power is restored. Use a normally open stop button to unlatch
the circuit.

96
Scenario 5:
Program a Temporary End instruction at various points within scenario 1 of this unit.
Explain the function or operation of the instruction. (Use the I/O Simulator in LogixPro)

97
Scenario 6:
Design and test a program that will operate an output for only 1 scan. Using an XIC
instruction operated by that output, turn on another output and seal it in. (Use the I/O
Simulator in LogixPro)

98
Unit 11, Data Manipulation

Learning Steps

Student Action Where Media

View Unit 11, Data Manipulation The PLCTrainer Tutorial


Complete Unit 11, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 11, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 11, Assignment Sheet The PLCTrainer Lab
2 Manual
Stop Unit 11, Assignment Sheet Have Instructor Evaluate
2 Assignment Sheet 2
Complete Scenario 1 The PLCTrainer Lab
Manual
Stop Scenario 1 Have Instructor Evaluate
Scenario 1
Complete Scenario 2 The PLCTrainer Lab
Manual
Stop Scenario 2 Have Instructor Evaluate
Scenario 2
Complete Scenario 3 The PLCTrainer Lab
Manual
Stop Scenario 3 Have Instructor Evaluate
Scenario 3
Complete Scenario 4 The PLCTrainer Lab
Manual
Stop Scenario 4 Have Instructor Evaluate
Scenario 4
Complete Scenario 5 The PLCTrainer Lab
Manual
Stop Scenario 5 Have Instructor Evaluate
Scenario 4
See Instructor

99
Introduction:
Most PLCs now have the ability to manipulate data that is stored within its memory
registers. Data manipulation can be placed into two broad categories: data compare
and data transfer.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss and data manipulation
instructions. This will be evidenced by the successful completion of the assignment
sheets and the practical exercises.

Enabling Objectives:
1. Explain what data transfer is.
2. Define the term “writing over”.
3. Write programs that transfers data from one word to another.
4. Identify standard data compare instructions.
5. Write programs that compare numerical data to control outputs.

100
Assignment Sheet 1:
1. The terms table or file are used when referring to:

❏ (A) Consecutive groups of words ❏ (C) A large metal cabinet

❏ (B) Two words ❏ (D) Both A and C

2. The earlier Get and Put instructions were replaced with the MOV instruction:

❏ True

❏ False

3. The MOV instruction will:

❏ (A) Copy from a source word. ❏ (C) Move alphanumeric


data.

❏ (B) Write to a destination word. ❏ (D) Both A and B.

4. Data compare instructions do not include a Not Equal To instruction:

❏ True

❏ False.

5. Which of the following is not a valid Data Compare instruction?

❏ <> ❏ =

❏ <= ❏ >=<

101
6. The NEQ instruction will be logically true when the values stored in Source A
and Source B are equal to each other.

❏ True

❏ False

7. The LEQ instruction will be true when Source A is greater than Source B.

❏ True

❏ False

102
Assignment Sheet 2:
1. Explain the difference between a table or file and a word or register.

2. Data Manipulation instructions give the PLC what capabilities?

3. What 2 broad categories are Data Manipulation divided into?

4. What is involved in a data transfer instruction?

5. What is involved in a data compare instruction?

6. Assume that a thumbwheel is set to a value of 821. What is the BCD value
for this setting?

7. 7. Assume that a thumbwheel is set to a value of 419. What is the BCD value
for this setting?

103
8. Using the addressing format for the PLC available to you, write a program for
the following.
When a switch connected to input 1 is closed, the value stored in Word 2 is
compared to the value of a timer that is operated by input 2. When the
accumulated value of the timer is greater than the value stored in Word 2,
output 5 will energize. It will remain on until the ACC value of the timer is less
than or equal to the value in Word 2.

104
Scenario 1:

PSIM
Word Compare Instructions
Introductory Lab

Word Comparison Instructions

• From the Main Menu of the PSIM program, select the I/O simulation display.

• Toggle Function Key [F2] until the minimum I/O Data Table is displayed in the
upper box of the display, and the Counter Table is displayed in the lower box of the
Data table display.

• Select the Rung Editor [F5] and enter the following ladder Logic program.

105
• Once you have entered your program, select the Program Utility menu and save
your program to disk. Now exit the Rung Editor and return to the I/O simulation
Display.

• Open and Close switch I:1/00 a number of times and carefully observe the
incrementing of C1's accumulator and the operation of the 3 lights which are
controlled by your program.

• Continue incrementing the counter until the "RES" instruction in rung #2 is


activated.

• What was the highest count achieved before the "RES" instruction zeroed the
accumulator?

• Highest accumulator count: ________

• Increment the counter again through its range and note the accumulator values
which allow the lights O:1/00, O:1/01 and O:1/02 to be energized. Note the values
on the appropriate rungs listed below.

106
107
Scenario 2:

PSIM
Traffic Control Lab
Utilizing Compare Instructions

Traffic Control using Comparison Instructions

• Exit to the Main Menu and select the Traffic Light simulation.

• Using your knowledge of word comparison instructions, develop a traffic light


control program which operates via a single timer.

Red = O:1/00 Green = O:1/02 Amber = O:1/01

Green = O:1/06 Amber = O:1/05 Red = O:1/04

8 Sec. 4 Sec. 8 Sec. 4 Sec.

Traffic Light Control With Delayed Green

• Modify your program so that there is a 1 second period when both directions will
have their RED lights illuminated. Using the timing diagram below, note that two 1
second periods are required in this sequence.

Amber =
Red = O:1/00 Green = O:1/02
O:1/01

Green = O:1/06 Amber = O:1/05 Red = O:1/04

8 Sec. 4 Sec. 1 8 Sec. 4 Sec.

108
Scenario 3:
Design, program and test and document the following control system using a Data
Manipulation. (Use the I/O Simulator with LogixPro)

As a maintenance technician for MICRO Manufacturing, you are faced with the task of
developing an energy management system for the corporate offices. With the HVAC
system operating from individual thermostats, several units can possibly kick on at once.
If this occurs the power consumption is greatly increased. The building uses a demand
metering system that records the peak load. If by chance all 4 HVAC units come on at
the same time the electric bill is based on this peak usage. To assure that that scenario
never occurs you must design and program an energy management system that will
sequence the units on based on time of day and day of the week.

At 6:00 AM Monday through Friday the HVAC units will be allowed to operate in 5
minute intervals, i.e. HVAC unit 1 will be authorized for operation at 6:00 AM, five
minutes later, HVAC unit 2 will be authorized etc. At 5:30 PM the units will be disabled
so that they may not operate. This cycle will continue until Saturday. Saturday and
Sunday, no units will be allowed to operate. However there must be an override
programmed in case weekend work is required. There must also be a means of locking
the system out during periods of plant shutdown.

Hint if using RSLogix and at least a SLC 5/03:


On the Project Tree located on the left side of the RSLogix screen, open the Controller
Folder, and then click on Processor Status. Many of the Allen-Bradley PLC has a clock
located here. Generally, the day is held in S:39, the month is held in S:38 and the year is
held in S:37. The hour is held in S:40, the minute is held in S:41 and the seconds in S:42.

Hint if using LogixPro:


The status files are also available within LogixPro. These file values may be manipulated
via your computer’s date and time function.

109
Unit 12, Math Functions
Learning Steps

Student Action Where Media

View Unit 12, Math Functions The PLCTrainer Tutorial


Complete Unit 12, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 12, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 12, Assignment Sheet The PLCTrainer Lab
2 Manual
Stop Unit 12, Assignment Sheet Have Instructor Evaluate
2 Assignment Sheet 2
Complete Scenario 1 The PLCTrainer Lab
Manual
Stop Scenario 1 Have Instructor Evaluate
Scenario 1
Complete Scenario 2 The PLCTrainer Lab
Manual
Stop Scenario 2 Have Instructor Evaluate
Scenario 2
Complete Scenario 3 The PLCTrainer Lab
Manual
Stop Scenario 3 Have Instructor Evaluate
Scenario 3
Complete Scenario 4 The PLCTrainer Lab
Manual
Stop Scenario 4 Have Instructor Evaluate
Scenario 4
See Instructor

110
Introduction:
Most PLCs now have the ability to simple and complex math operations. These
operations are used in the control of batch processes and many other control systems

Terminal Objective:
Upon completion of this unit the learner will be able to discuss and program using simple
math functions. This will be evidenced by the completion of assignment sheets and
practical exercises.

Enabling Objectives:
1. List the four standard math operations
2. Discuss math functions and give examples of their use
3. Write programs using math functions.

111
Assignment Sheet 1:
1. Math instructions coupled with data manipulation instructions give PLCs some
of the qualities of a computer.

❏ True ❏ False

2. No PLCs are capable of performing high level math such as trigonometry,


cube roots, and square roots.

❏ True ❏ False

3. Which of the following is not a basic math function of PLCs?

❏ Addition ❏ Multiplication

❏ Subtraction ❏ Geometry

4. PLCs can use numerical data from the accumulated values of timers and
counters with math functions.

❏ True ❏ False.

5. Integer files are used to store numerical data that are used by math functions.

❏ True ❏ False.

112
Assignment Sheet 2:
1. Explain the purpose of math functions as they apply to PLCs.

2. List the four basic math functions that can be performed on most PLCs.

3. Is it possible to combine data manipulation instructions and math instructions?

4. Give an example of how math instructions might be used in a program.

113
Scenario 1:
Design, program and test and document the following control system using Math
Functions. (Use the I/O Simulator with LogixPro)

KWT Automation has secured the contract to alter the bottling line at a local sparkling
water company. You are assigned the task of writing a program that will operate the
system. The graphic below shows the layout of the line. A sensor has been added at
the beginning of the line to count the bottles entering the line. There is also a sensor
counting the bottles completing the process. The bottling operation should maintain a
94% success rate to meet projected profit margins. If the rate falls below 94% an alarm
must sound to alert maintenance personnel. If it falls below 90% the alarm must sound
and the line must be shut down.
The system must operate effectively no matter how many bottles have been processed.
Remember, at any given time there are 10 bottles in the system. Also be careful that a
division by zero does not occur while you are calculating the percentage. A division by
zero will usually cause a CPU fault.

NOTE: The F8 files are not functional in LogixPro, therefore, all data must be
converted to whole numbers, and the equivalent values must be used.

114
Scenario 3:
Design, program and test and document the following control system using Math
Functions. (Use the I/O Simulator with LogixPro)

Bottle’s Incorporated has a line that contains boxes with 6 bottles, 8 bottles and 12
bottles. The 3 sizes of carton are fed from 3 different conveyors. Each conveyor has a
sensor that counts the boxes. The production supervisor has asked you to write a
program that will update constantly and tally the total numbers of bottles processed.
The tally must also be displayed on a digital readout. Investigate the use of a TOD
instruction to accomplish this.

115
Unit 13, Shift Registers &
Sequencers

Learning Steps

Student Action Where Media

View Unit 13, Shift Registers & The PLCTrainer Tutorial


Sequencers
Complete Unit 13, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 13, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 13, Assignment Sheet The PLCTrainer Lab
2 Manual
Stop Unit 13, Assignment Sheet Have Instructor Evaluate
2 Assignment Sheet 2
Complete Scenario 1 The PLCTrainer Lab
Manual
Stop Scenario 1 Have Instructor Evaluate
Scenario 1
Complete Scenario 2 The PLCTrainer Lab
Manual
Stop Scenario 2 Have Instructor Evaluate
Scenario 2
See Instructor

116
Introduction:
Many PLCs include a shift register instruction. This instruction is helpful in programming
systems that will track parts through a process.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss and program shift
registers. This will be evidenced by successful completion of assignment sheets and
practical exercises.

Enabling Objectives:
1. Describe the function of a shift register.
2. Explain the difference between an asynchronous shift register and a synchronous
shift register
3. Describe what a sequencer instruction does.
4. Understand the basics of sequencer operation
5. Define the word “Mask”.

117
Assignment Sheet 1:
1. There are two shift register instructions available for the Allen BradleyTM
SLC500. They are the BSL and the BSD instructions.

❏ True

❏ False

2. The shift register instruction is commonly used in complex operations that


require tracking parts or materials through a process.

❏ True

❏ False

3. Shifting information within a word or register, one bit at a time is referred to


as:

❏ A Parallel Shift Register. ❏ An Asynchronous Shift


Register.

❏ A Synchronous Shift Register. ❏ A Uni-Bit Shift Register.

4. Shift registers have allowed very complex programs to be shortened and


simplified.

❏ True

❏ False

118
5. Sequencer instructions were designed to replicate the operation of :

❏ Drum switches. ❏ CAM switches.

❏ Stepper switches. ❏ All of the above.

6. If a sequencer is using a specific word or register, it takes control of all Bits


within that register unless a ___________ is defined to allow the use of
specific outputs.

❏ Mask ❏ Blind

❏ Group ❏ None of the above

7. A Hexadecimal code through which the SQO instruction moves data is.

❏ A Mask ❏ A Control

❏ A File ❏ A Destination

8. The address of the output element or file to which a sequencer instruction


moves data is:

❏ A Mask ❏ A Control

❏ A File ❏ A Destination

9. The indexed address of the sequencer file from which the sequencer
instruction transfers data is known as:

❏ A Mask ❏ A Control

❏ A File ❏ A Destination

119
Assignment Sheet 2:
1. Which direction does the data move in a synchronous shift register?

2. What 3 elements are required on most shift registers?

3. Briefly describe how a typical shift register operates.

4. Briefly discuss the operation of a CAM operated sequencer.

5. What types of operations are sequencers most suited for?

6. Where is the information for each step of a sequencer stored?

7. What does the output word of a sequencer do?

120
8. Briefly discuss the purpose of the Mask Word in a sequencer.

121
Scenario 1:
Design, program and test and document the following control system using a Shift
Register Instruction. (Use the I/O Simulator with LogixPro)

KWT Automation has secured the contract to set up the powder coat line at Widgets Inc.
The powder coat is a dry paint that is electro-statically charged, then sprayed onto the
widgets. Once the widget is coated it is transported to an oven. The oven melts the
powder and causes the finish to adhere to the widget. Since the knobs are placed on
the belt at random intervals it is not unusual to have empty spaces on the line. The
powder is very expensive and must not be sprayed if no widget is in place. It is
impossible to place sensors inside the line due to the environment; therefore a shift
register must be used to track the parts. The widgets must be detected before they
enter the powder coat booth and they must also be detected as they move down the
line.

122
Scenario 2:
Design, program and test and document the following control system using a Sequencer
Instruction (SQO). (Use the I/O Simulator with LogixPro)

Operate 4 lights in the pattern shown below using an XIC instruction addressed as S:4/6
to trigger the steps.
1 indicates the light is on, 0 indicates the light is off.

0000
1010
1111
1001
0101
1111
0000
1001
0110

NOTE:
If the file number used for the SQO instruction is #B3:0, and the length is 9, then you
must open the Binary files on the Project Tree and input the proper data for use by the
sequencer.

123
Scenario 3:

LogixPro
Advanced Bottle Line
Exercise

124
Getting Started
There are always numerous ways to accomplish tasks in programming, but a quick review of the
Allen Bradley bit shift instructions should surely point to them as an ideal tool for use in this
particular process. In the bottle line simulation, we are faced with detecting and tracking a few
Boolean details having to do with the bottles entering the line. Sensors are provided to detect the
presence of a new bottle, the bottle size, and whether the bottle is fully intact. Essentially 3 Boolean
states describing the properties of each bottle that enters the line. If we analyze the various ways
that we might process these bottles, it should quickly become apparent that we will have ample
information for making such decisions, assuming we keep track of it.

A single BSR or BSL instruction can be used to track a single Boolean state (0 or 1) which in-turn
can describe a unique property of a product. In the initial exercise you will be asked to track the 3
Boolean values describing each bottle entering our process line. The Boolean states will be referred
to as "Exists", "Large", and "Broken" and these states are to be tracked by you, utilizing 3 separate
BSL (bit shift left) instructions. It can be argued that "Exists" need not be tracked (=correct), as
bottles continuously enter the line, and therefore must exist. We will even use this fact to strobe our
BSL instructions and cause a shifting of our tracked information. Later when you start diverting
broken bottles to scrap however, they will no-longer Exist. These missing bottles could be detected
after they are scrapped by using the "Broken" state, but for now I want you to track all 3 states using
3 separate bit arrays.
..........

Exercise #1 -- Tracking the bottles


Create a program which allows the operator to start and stop the process using the available panel
mounted switches. When the process is running, the main conveyor should be energized, and
bottles should continuously enter and exit the line. For these exercises please utilize the bits in word
B3:0 if and when single bits such as flags etc. are required.

Utilizing LS1 (Exists), strobe 3 BSL instructions to shift 3 separate bit arrays consisting of two 16 bit
words each. Please use files #B3:2, #B3:4, and #B3:6 for this purpose. By restricting you to these
particular files in the binary table, it will be much easier for you, and your instructor to monitor what
is happening with your program using the data table display.

125
Test your program out, and using the Data Table display monitor, take note of how the bits
representing "Exist", "Large", and "Broken" are being shifted within their appropriate bit arrays. You
may find that it will be necessary to slow the scan rate using the slider in the PLC panel to see this
activity clearly. If your program is operating correctly, you should now have a means of determining
the properties associated with each bottle that passes down the bottling line.
..........

Exercise #2 -- Utilizing the Boolean Data

If you paid careful attention to the bits being shifted along in each bit array, you would have likely
noted that there is an offset between each of these 3 arrays. This is due to the fact that the 3 limit
switches are located exactly 2 bottle widths apart. In order to use LS1 to strobe the data from all 3
switches at the same time, this spacing is actually critical, and must be an exact multiple of a bottle
width. The number of bottle widths in-turn determines the offset we encounter within our arrays.

We cannot easily compensate for this offset when using a BSL instruction as the switch data will
always load into bit 0 of the array. There may be ways to overcome this, but for these exercises it
will be your responsibility to compensate for these offsets. You will have to adjust for this whenever
you employ any of these bits to determine a particular bottle's properties.

126
Modify your program so that all Large bottles are diverted to the lower conveyor located on the right
hand side of the simulation. This is to be accomplished by utilizing the appropriate bit in the "Large"
bit array to invoke the transfer. Also, please ensure that the bottles are not damaged in the process.

If you are successful in completing the above, you should be well prepared to deal with the task of
diverting broken bottles to scrap
..........

Exercise #3 -- Boxing the Broken Bottles

To add a little interest to the simulation, I've decided to have you grind up the broken bottles that
occasionally come down the line. Of course it is your responsibility to ensure that the ground glass is
placed into boxes, and to bring new boxes into place as required.

The cost of providing cardboard boxes can be significant over time. For this reason it is essential
that you fill each box to it's maximum capacity, and do so without spillage. Since a small bottle only
produces 2/3 as much ground glass as a large bottle, you will have to adjust for this difference in
your program logic.

In creating the logic for this exercise, you may find that you are faced with initializing variables or
clearing counters etc. each time you edit and then restart your program. Just to make it a little easier
to find this logic, I would ask that you add the following rung to the top of your program.

127
There is no sense cluttering up your program with logic that only executes once each time it is run,
so please place this logic into a subroutine where it is out of the way, yet easily located.

Once you have come up with a solution for the scrap problem, then you are now entering the home
stretch.
..........

Exercise #4 -- Fill and Cap the Bottles

There aren't many details that need to be explained about the filling operation. Energizing the fill
tube solenoid O:2/6 will cause the fill tube to extend and enter the positioned bottle. You then must
make a choice of discharging a large or small quantity of product into the bottle utilizing the
appropriate charge solenoid O:2/7 or O:2/8. Once again, the Boolean data contained in the bit
arrays will be used in determining the correct action to be taken.

The bottle capping station control should be just a matter of capping each bottle that comes along.
The capping ram solenoid O:2/9 must be energized to extend the ram, but you need not adjust for
bottle size with this particular capping equipment. Attempting to cap a bottle that does not exist will
cause little harm, but is a waste of caps, plus adds to clutter on the plant floor. Due to the foregoing,
ensure that you only cap bottles that actually exist.

I will leave issues such as when to stop and start the line to you. Keep in mind however, that we
want to maintain the highest level of production possible with the equipment at our disposal.

Once you have the filling and capping operations operating at maximum efficiency, we can then
move on to the job of keeping the operator fully informed of the production details.
..........

Exercise #5 -- Tracking the Production Numbers

The operator control panel has been equipped with four, quad-digit LED display units which were
included so that the operator might easily view current production counts etc... In order to reduce the
number of PLC output signals required to control this many displays, it was decided to multiplex the

128
four display units, and 4 manufactured quad-digit display units complete with built-in latches were
selected for this purpose...

The 16 data inputs of each quad-display unit were wired to a shared 16-bit data bus, and these
shared data lines were in-turn wired to a 16-bit output card addressed as O:4... Four spare outputs
from card O:2 were then wired to control the strobe (latch enable) line of each individual quad-
display unit; one output for each of the 4 quad-display units...

Supplemental Information on 7 Segment Displays is in Appendix B

The multiplexed displays may be individually written to by placing the BCD representation of the
number to be displayed into output card O:4, and then strobing the appropriate latch enable line
from low to high, and then back to low again... The data is allowed to enter and pass through the
built-in latches of the selected display unit when it's latch enable line is taken high, and the data is
latched, or effectively frozen when the latch enable line is taken low... Once low, further changes to
the data input lines will be ignored, and the display will continue to display the numeric
representation of the data held in the latches... The display will continue to show the same numerals
until the latch enable is again taken high, or power is lost...

Your task, should you accept this assignment [grin], is to update the multiplexed displays with the
running totals of the large and small bottles produced, bottles scrapped, and boxes filled. The rate at
which the updates take place, should be high enough that single counts are not skipped, but not so
high as to burden the PLC unnecessarily.

This particular task of updating the LED displays lends itself well to modularization, and ideally
should be executed in a subroutine. Even if you call this subroutine unconditionally each scan, there
are still benefits to this approach. Placing this logic where it will be out of the way, yet readily
accessible can make for a much less cluttered, and easier to read program.

The task of writing the subroutine will be left to you, and there are many methods that might be
employed to accomplish the task. One possibility is to employ a self-resetting timer, and then write
to each display unit at a unique but regular time interval.. You might first send the desired BCD data
to card O:4 and enable the selected display's latch enable at the same time... Follow this by
disabling the same latch enable at the next time base interval, and you would then be set to repeat
the same sequence for the next display unit... If you do use a timer, remember that the subroutine
will need to be unconditionally called (as shown above) on each scan, in order for a subroutine
located timer to be updated properly

Once you have the completed the foregoing, all that should be left is to handle the details. Allowing

129
the operator to set the count of bottles to be processed might be a feature worth implementing.
Reviewing your program and making certain that it is clearly documented is a must. Adding
something new such as tracking equipment run time is an option.
..........

Exercise #6 (Optional!) -- Just a small Modification

In the introduction to this series of exercises for the bottle line, I stated that "There are always
numerous ways to accomplish tasks in programming". In order to prove the statement was accurate,
I'm now going to ask that you modify your program so that BSR (bit shift right) instructions are used
in place of BSL. At the same time, I also want you limit yourself to the use of just 2 bit arrays for
tracking the bottle properties.

If only the "Large" and "Broken" bit arrays are used, you should still be able to determine if a bottle
exists by examining the "Broken" property of the bottle. This of course assumes that the broken
bottle has been diverted to scrap, and therefore no-longer exists.

While you are making the required modifications, carefully review the AB documentation for the BSR
instruction, and see if you can come up with a way of eliminating the offset we had in the previous
bit arrays.

130
Unit 14, Analog Input & Outputs
Learning Steps

Student Action Where Media

View Unit 14, Analog Inputs & The PLCTrainer Tutorial


Outputs
Complete Unit 14, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 14, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 14, Practical Exercise The PLCTrainer Lab
1 Manual
Stop Unit 14, Practical Exercise Have Instructor Evaluate
1 Practical Exercise
Complete Unit 14, Practical Exercise The PLCTrainer Lab
2 Manual
Stop Unit 14, Practical Exercise Have Instructor Evaluate
2 Practical Exercise
Complete Unit 14, Practical Exercise The PLCTrainer Lab
3 Manual
Stop Unit 14, Practical Exercise Have Instructor Evaluate
3 Practical Exercise
See Instructor

131
Introduction:
Analog inputs and outputs are an essential part of many PLC managed processes. The
competent technician will understand the operation and use of these modules and their
associated instruction set.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss and use PLC analog
modules and instructions. This will be evidenced by successful completion of
assignment sheets and practical exercises.

Enabling Objectives:
1. Answer questions associated with analog inputs and outputs.
2. Complete practical exercises associated with analog inputs and outputs.

132
Assignment Sheet 1:
1. Typical inputs for PLCs using analog input modules are:

❏ Oven temperature ❏ Valve position

❏ Fluid pressure ❏ All of the above.

2. An analog value is a continuous value rather than a discrete value.

❏ True

False

3. Typical outputs for PLCs using analog output modules are:

❏ Fluid valve position ❏ Motor position

❏ Flow rate ❏ None of the above.

4. The time required to acquire a sample of an analog value is instantaneous.

❏ True

False

5. False readings caused by sampling data too slowly is called :

❏ Aliasing ❏ False Data

❏ Ghosting ❏ None of the above.

6. Analog inputs are very sensitive to noise.

❏ True

False

133
7. The Nyquist Criterion specifies that sampling frequencies of analog inputs
should be ________ the frequency of the signal being measured :

❏ Twice ❏ Ten times

❏ Equal to ❏ None of the above.

134
Scenario 1:
Design, program and test and document the following control system using analog
instructions.

As a PLC Technician for KTech Industries you are assigned the task of designing and
building a control system to operate a proportional valve that regulates fluid flow. The
valve needs to receive a signal between 0 (closed) and 100 (completely open). This
relates to a value of 0% open to 100% open. The input controlling the operation of the
valve should be a variable source such as a potentiometer. Additionally, the percentage
that the valve is open should be displayed on a digital readout.

You should use the SCL instruction to accomplish this task and be sure and show all
calculations involved.

NOTE:
This lab is not possible using the LogixPro Simulator. It must be done on a PLC.

135
Scenario 2:
Design, program and test and document the following control system using analog
instructions.

Your task is to design a program using the SCP instruction that will control the
temperature of a gas fired oven between 400 degrees F and 480 degrees F. The gas
valve is a discrete output that is either opened or closed. When the temperature within
the oven drops below 401 degrees F the gas valve should open and an igniter must be
fired until the temperature begins to rise. If the temperature within the oven reaches 479
degrees F the gas valve should close. It is also necessary to display the temperature on
a digital readout.

NOTE:
This lab is not possible using the LogixPro Simulator. It must be done on a PLC.

136
Scenario 3:
Design, program and test and document the following control system using analog
instructions.

A conveyor is transporting containers to a filling area. When the container is seen by a


proximity sensor the conveyor will continue to move for .50 second then stop directly
under the fill hopper. At this time the hopper will open and the material will begin to flow
into the container. A transducer will measure the weight of the container plus the weight
of the material. The container itself weighs 2 pounds. When the total weight is 8
pounds, the hopper door will close and a signal will be sent to move the container via the
conveyor. This process will then repeat itself. A running tally of the total weight
processed for shipment must be displayed on a digital readout. When the total weight
reaches 900 pounds, the system will send a signal to refill the hopper. The hopper has a
sensor located at the top to indicate when it is full.

NOTE:
This lab is not possible using the LogixPro Simulator. It must be done on a PLC.

137
Unit 15, Networking
Learning Steps

Student Action Where Media

View Unit 15, Networking The PLCTrainer Tutorial


Complete Unit 15, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 15, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
See Instructor See your instructor for
network application
problems.
See Instructor

138
Introduction:
PLC Networks are an essential part of many PLC managed processes. The competent
technician will understand the physical and practical setup and operation of a PLC
network.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss and configure PLC
networks. This will be evidenced by successful completion of assignment sheets and
practical exercises.

Enabling Objectives:
3. Name the two typical transmission speeds for UTP and STP cables.
4. List and describe network topologies.
5. List and describe network control schemes.
6. Use WHO ACTIVE to view network nodes.

139
Assignment Sheet 1:
1. What are the two typical speeds of transmission associated with twisted pair
cables?

2. What is the maximum speed of transmission of fiber-optic cable?

3. List and describe the four types of network connection topologies.

4. List and describe the three types of network access control schemes.

140
5. What do the acronyms UTP and STP represent in a network media.

6. What is the name of the function used to view the network nodes that is built
into RSLogix?

141
Practical Exercise:
This exercise will utilize a Master and Slave PLC. You must be running a DH485
network with at least 2 nodes in order to complete this exercise.

The program on the slave PLC will contain two sequencer instructions, SQO:0 and
SQO:1. It will also contain one RTO instruction. As shown in the diagram below, the
T4:0/DN bit will be used to forward the sequencers to the next step.

Each sequencer has six steps. The second sequencer will be called the Preset-Control
Sequencer. It will be used for regulating the delay between steps of the first sequencer,
the Event-Control Sequencer. The Preset-Control Sequencer transfers time delay
information to the T4:0 Preset Register. The DN bit of timer T4:0 is used to reset the
RTO.

142
The ladder logic for the Master PLC is shown below. The Master Program consists of 3
rungs only. When rung 0 is true, the Write-Message function will send six delay
numbers from the Master PLC to the Slave PLC. Use Master PLC Registers N7:30
through N7:35 to store these decimal numbers. Remember, the time base chosen on
the Slave PLC is 1 second. This information should be targeted to Slave PLC registers
N7:0 through N7:5. It is important to note that fourteen addresses N7:0 through N7:13
are used in the Master PLC as control registers for the Write-Message function.

When rung 0 is true, the Write-Message function will be executed. When rung 1 is true,
the output control bit registers in the Slave PLC (B3:0 – B3:5) are read by the Read-
Message function. The content of these registers is then copied into Master PLC
registers B3:0 through B3:5. Registers N7:15 through N7:28 in the Master PLC are used
to control the Read-Message function.

Rung 2 contains a network service rung. It is important to note that only one
communications channel (Channel 1) is used in this network application. This channel is
available through the data highway 1485 line (DH-1485) on the SLC5/03 Master PLC.
Channel 0 could be used for connection of peripheral devices such as network printers
or bar-code scanners.

A communications channel on the PLC LAN must not be disabled unless you do not
intend to use it in the future.

143
144
Help on setup for the Write and a Read function is shown below:

145
Unit 16, HMIs
Learning Steps

Student Action Where Media

View Unit 16, Human Machine The PLCTrainer Tutorial


Interfaces
Complete Unit 16, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 16, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 16, Assignment Sheet The PLCTrainer Lab
2 Manual
Stop Unit 16, Assignment Sheet Have Instructor Evaluate
2 Assignment Sheet 2
See Instructor See your instructor for
practical HMI problems.
See Instructor

146
Introduction:
HMIs are an essential part of many PLC managed processes. The competent
technician will understand the uses and operation of Human Machine Interfaces.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss HMIs.

Enabling Objectives:
1. Describe the use of HMIs.
2. Discuss HMI graphics.

147
Assignment Sheet 1:

1. Human Machine Interfaces are not capable of displaying high quality


graphics.

❏ True

❏ False

2. The interfaces were designed to replace:

❏ Indicator lights. ❏ Message displays.

❏ Readouts. ❏ All of the above.

3. Many HMI units are operated through “touch screen” or “touch panel”
operation.

❏ True

❏ False

4. HMI units do not operate in real time.

❏ True

❏ False

148
5. HMI graphics may include:

❏ Readouts. ❏ Bar graphs.

❏ Indicators. ❏ All of the above.

149
Unit 17, Trouble Shooting
Learning Steps

Student Action Where Media

View Unit 17, Troubleshooting The PLCTrainer Tutorial


Complete Unit 17, Assignment Sheet The PLCTrainer Lab
1 Manual
Stop Unit 17, Assignment Sheet Have Instructor Evaluate
1 Assignment Sheet 1
Complete Unit 17, Assignment Sheet The PLCTrainer Lab
2 Manual
Stop Unit 17, Assignment Sheet Have Instructor Evaluate
2 Assignment Sheet 2
See Instructor See your instructor for
practical troubleshooting
problems.
See Instructor

150
Introduction:
As with any technology, PLCs will require troubleshooting from time to time. The
competent technician will understand troubleshooting procedures and be capable of
reading symptoms.

Terminal Objective:
Upon completion of this unit the learner will be able to discuss troubleshooting
procedures and display an understanding of reading symptoms. This will be evidenced
by successful completion of assignment sheets and practical exercises.

Enabling Objectives:
1. Explain how input devices are tested.
2. Explain how to test output devices.
3. Explain safety considerations when testing outputs.
4. Describe how voltage readings are taken to check input and output modules.

151
Assignment Sheet 1:
1. What are the things that all effective troubleshooting has in common?

❏ Symptom recognition. ❏ Problem isolation.

❏ Corrective action. ❏ All of the above.

2. When troubleshooting a PLC managed system, it is never necessary to


question the operator.

❏ True

❏ False

3. If this LED is not on, the DC power supply is not functioning:

❏ Processor Fault. ❏ I/O Fault.

❏ DC Power On . ❏ Battery Low.

4. If this status light is on, a fault exists within the processor.

❏ Processor Fault. ❏ I/O Fault.

❏ DC Power On. ❏ Battery Low.

5. This status light will be on when a parity error exists between the memory
module and the processor module;

❏ Memory Fault. ❏ I/O Fault.

❏ DC Power On. ❏ Processor Fault.

152
6. Illumination of this LED means the RAM back-up batteries are low. Failure to
replace the batteries could result in the loss of the user program.

❏ Memory Fault ❏ I/O Fault

❏ DC Power On ❏ Battery Low

7. If an output device fails to operate, a quick check with a programming device


will indicate if the program logic is enabling the output.

❏ True

❏ False

8. Placing a ______ resistor in parallel with the meter leads will result in a more
accurate reading when checking Triac operated outputs.

❏ 10 Ohm ❏ 100k-Ohm

❏ 10k-Ohm ❏ 15k-Ohm

9. When checking inputs, a meter reading equal to the applied voltage indicates
that the problem is in the input module.

❏ True

❏ False

10. No voltage reading at the input module indicates that the input device or the
field wiring is the source of the problem.

❏ True

❏ False

153
Assignment Sheet 2:
1. Briefly explain how input devices should be tested. Include a sketch to clarify your
answer.

2. Briefly explain how to test output devices. Include a sketch to clarify your answer.

3. What steps should a systematic approach to troubleshooting have?

154
4. What does it indicate if the DC Power LED is not on?

5. Explain the procedures used to check-out an I/O fault.

6. An electronic based input sensor is wired to a high impedance PLC input. The
sensor is falsely activating the input. What can be done to solve this problem?

7. The input device wired to an input module is activated, but the LED status light does
not light up. You check the voltage at the input terminal and show no voltage.
Suggest 2 possible causes.

8. If the door to a PLC enclosure is not kept closed, what potential problems could
develop?

155
Appendix A

Status File Overview

The status file lets you monitor how your operating system works and lets you direct how
you want it to work. This is done by using the status file to set up interrupts, load memory
module programs, and monitor both hardware and software faults.

Note: Do not write to status file data unless the word or bit is listed as dynamic/static
configuration in the descriptions that follow. If you intend writing to status file data, it is
imperative that you first understand the function fully.
The status file S: contains the following words:

Word Function applies to all processors

S:0 Arithmetic Flags

S:1 Processor Mode Status/Control

S:2 STI Bits / DH485 Comms.

S:3L Current/Last Scan Time

S:3H Watchdog Scan Time

S:4 Free Running Clock

S:5 Minor Error Bits

S:6 Major Error Code

S:7,S:8 Suspend Code/Suspend File

S:9,S:10 Active Nodes (DH-485)

S:11,S:12 I/O Slot Enables

S:13,S:14 Math Register

S:15L Node Address

S:15H Baud Rate

Word Function applies to SLC 5/02, SLC 5/03,SLC 5/04 processors

156
S:16,S:17 Test Single Step - Start Step On - Rung/File

S:18,S:19 Test Single Step - Breakpoint - Rung/File

S:20,S:21 Test - Fault/Power down - Rung/File

S:22 Maximum Observed Scan Time

S:23 Average Scan Time

S:24 Index Register

S:25,S:26 I/O Interrupt Pending

S:27,S:28 I/O Interrupt Enabled

S:29 User Fault Routine File Number

S:30 Selectable Timed Interrupt Set point

S:31 Selectable Timed Interrupt File Number

S:32 I/O Interrupt Executing

Word Function applies to SLC 5/03, and SLC 5/04 processors

S:33 Extended Processor Status and Control Word

S:34 Pass thru Disabled (SLC 5/04 only)

S:35 Last 1 ms Scan Time

S:36 Extended Minor Error Bits

S:37 Clock/Calendar Year

S:38 Clock/Calendar Month

S:39 Clock/Calendar Day

S:40 Clock/Calendar Hours

S:41 Clock/Calendar Minutes

S:42 Clock/Calendar Seconds

S:43 STI Interrupt Time (SLC 5/03 and SLC 5/04)

157
S:44 I/O Event Interrupt Time (SLC 5/03 and SLC 5/04)

S:46 Discrete Input Interrupt - File Number

S:47 Discrete Input Interrupt - Slot Number

S:50 Discrete Input Interrupt - Preset

S:51 Discrete Input Interrupt - Return Mask

S:52 Discrete Input Interrupt - Accumulator

S:55 Last DII Scan Time

S:56 Maximum Observed DII Scan Time

S:57 Operating System Catalog Number

S:61 Processor Series

S:62 Processor Revision

S:63 User Program Type

S:65 User RAM Size

S:66 Flash EEPROM Size

S:67,S:68 Channel 0 Active Nodes

Word Function applies to SLC 5/04 processors

S:69 to S:82 Reserved

S:83 to S:86 DH+ Active Nodes (Channel 1 SLC 5/04 only)

S:87 to S:98 Reserved

S:99 Global Status Word

S:100 to S:163 Global Status File

158
The Following Table Describes Some Status Files Functions

Address Bit Classification Description

This bit is set by the controller when the result of a


mathematical operation does not fit in its
S:0/1 Overflow Status destination. Whenever this bit is set, the overflow
trap bit S:5/0 is also set except for the ENC bit.
Refer to S:5/0.

When set, this bit causes the controller to at Power


up Configuration the Major Error Halted bit S:1/13
Fault and Minor error bits S:5/0 to S:5/7 on power up if the
Static
S:1/8 Override at processor had previously been in the REM run
Configuration
Powerup mode and had faulted. The controller then attempts
to enter the REM Run mode. Set this bit using the
Data Monitor function offline only.

When this bit is set and power is cycled while the


controller is in the REM Run mode, the controller
executes the user-fault routine prior to the execution
of the first scan of your program. You have the
Startup option of clearing the Major Error Halted bit S:1/13
Static
S:1/9 Protection to resume operation in the REM Run mode. If user-
Configuration
Fault fault routine does not reset bit S:1/13, the fault mode
results. Program the user-fault routine logic
accordingly. When executing the startup protection
fault routine, S:6 (major error fault code) will contain
the value 001 6H.

This bit is set by the controller any time a major


error is encountered. The controller enters a fault
condition. Word S:6, the Fault Code will contain a
code that can be used to diagnose the fault
condition. Any time bit S:1/13 is set, the controller:
• either places all outputs in a safe state
(outputs are off) and energizes the fault
LED,

Major Error Dynamic • or enters the user-fault routine with outputs


S:1/13 active (if in REM Run mode), allowing the
Halted Configuration
fault routine ladder logic to attempt recovery
from the fault condition. If the user-fault
routine determines that recovery is required,
clear S:1/13 using ladder logic prior to
exiting the fault routine. If the fault routine
ladder logic does not understand the fault
code, or if the routine determines that it is
not desirable to continue operation, the
controller exits the fault routine with bit
S:1113 set. The outputs are placed in a safe

159
state and the FAULT LED is energized.

Using this bit you can control access to a controller


file. To program this feature, select Future Access
Static Disallow when saving your program. When this bit is
S:1/14 OEM Lock
Configuration set, only a programming device with a matching
copy of the processor file in its memory can monitor
the ladder program, others are denied access.

Set this bit when you intend to use 32-bit addition


and subtraction. When 5.2/14 is set, and the result
of an ADD, SUB, MUL, or DIV instruction cannot be
represented in the destination address (underflow or
overflow),
Math
Dynamic • the overflow bit S:0/l is set,
S:2/14 Overflow
Configuration
Selection
• the overflow trap bit S:5/Ois set,

• and the destination address contains the


unsigned truncated least significant 16 bits
of the result.

Use this bit to initialize your program as the


application requires. Indicates the first scan of the
S:1/15 First Pass Status
user program. Makes rung true only for the first scan
after entering the run mode.

You can use any individual bit of this word in your


user program as a 50% duty cycle clock bit. (S:4/0
S:4/7 Timebase Status
to S:4/15 are 20, 40, 80, 160, 320, 640, 1280, 2560,
5120, 10240, 20480, 40960, 81920....)

When this bit is set by the controller, it indicates that


Overflow Dynamic
S:5/0 a mathematical overflow has occurred in the ladder
Trap Configuration
program

A hexadecimal code is entered in this word by the


controller when a major error is declared. Refer to
S:1/13. The code defines the type of fault, as
indicated on the following pages. This word is not
cleared by the controller. Error codes are presented,
Major Error stored, and displayed in a hexadecimal format. If
S:6 Status
Code you enter a fault code as a parameter in an
instruction in your ladder program, you must convert
the code to decimal. Application note: You can
declare your own application specific major fault by
writing a unique value to S:6 and then setting bit
S:1/13.

160
File Organization

Program Files

Program files contain controller information, the main ladder program, interrupt
subroutines, and any subroutine programs. These files are:

• System Program (file 0) - This file contains various system related information and user-
programmed information such as processor type, I/O configuration, processor file name,
and password.

• Reserved (file 1) - This file is reserved.

• Main Ladder Program (file 2) - This file contains user-programmed instructions defining
how the controller is to operate.

• Subroutine Ladder Program (file 3-255) - These files are user-created and accessed
according to subroutine instructions residing in the main ladder program file.

Data Files

Data files contain the status information associated with external I/O and all other
instructions you use in your main and subroutine ladder program files. In addition, these
files store information concerning processor operation. You can also use the files to store
"recipes" and look-up tables if needed. These files are organized by the type of data they
contain. The data file types are:

• Output (file 0) - This file stores


the state of the output terminals Size in
Address Range File
for the controller. Elements

O:000 - O:037 Output Image File 32


• Input (file 1) - This file stores
the status of the input terminals
for the controller. I:000 - I:037 Input Image File 32

S:000 - S:031 Processor Status 32


• Status (file 2) - This file stores
controller operation information,
B3:000 - B3:999 Bit File 1 - 1000
This file is useful for
troubleshooting controller and
program operation. T4:000 - T4:999 Timer File 1 - 1000

C5:000 - C5:999 Counter File 1 - 1000

161
Instruction Set Reference R6:000 - R6:999 Control File 1 - 1000

N7:000 - N7:999 Integer File 1 - 1000


• Bit (file 3) - This file is used for
internal relay logic storage. F8:000 - F8:999 Floating Point File 1 - 1000
B3:1/0 or B3/16
1 - 1000
9 - 999 Files to be assigned
• Timer (file 4) - This file stores per file
the timer accumulator and
preset values and status bits.
T4:0.PRE, T4:0.ACC, T4:0/DN,
T4:0/TT, T4:0/EN

• Counter (file 5) - This file


stores the counter accumulator
and preset values and the
status bits. C5:0.PRE,
C5:0.ACC, C5:0/DN, C5:0/CU,
C5:0/CD, C5:0/OV, C5:0/UN

• Control (file 6) This file stores


the length, pointer position, and
status bits for specific
instructions such as shift
registers and sequencers. R6:0,
R6:0.Len (Length), R6:0.Pos
(Position)

• Integer (file 7) - This file is used


to store numeric values or bit
information. N7:1/3

• Floating Point (file 8) - This file


stores single precision non-
extended 32-bit numbers.
Applies to SLC 5/03 and SLC
5/04 processors.F8:000 to
F8:9999

162
Valid Addressing Modes and File Types

Addressing Modes File Types

Addressing Mode Example O Output

Direct N7:O I Input

Indexed Direct #N7:O S Status

Indexed N7:[N10:3] B Binary

Indexed Indirect #N7:[N1O:3] T Timer

C Counter

R Control

N Integer

F Float

A ASCII

ST String

M M0/M1

Direct Addressing

• The data stored in the specified address is used in the instruction. For example:

• N7:0, T4:8.ACC, T4:8.PRE, ST20:5

Indexed Addressing
• You may specify an address as being indexed by placing the "#" character in front of the
address. When an address of this form is encountered in the program, the processor
takes the element number of the address and adds to it the value contained in the Index
Register S:24, then uses the result as the actual address. For example:

• #N7:l0 where S:24= 15, The actual address used by the instruction is N7:25.

Indirect Addressing
• You may specify an address as being indirect by replacing the file number, element
number, or sub-element number with a [Xf:e.s] symbol. The word address inside of the
bracket is queried for a value. The queried value then becomes the file, element, or sub-
element portion of the indirect address. For example: B3:[N 10:2] states that the element

163
address of Bit file 3 is contained in address N10:2. Therefore, if N10:2 contains the value
5, B3:[N10:2] indirectly refers to address B3:5. Other examples include:

• N7:[N7:0], N[N7:0]:[N7:1], N7[T4:0.ACC], C5:[N7:0]

Indexed Indirect Addressing


• You may specify a combination of indirect and indexed addressing. The processor first
resolves the indirect portion of the address and then adds the offset from the Index
Register S:24 to come up with the final address. For example:

• #N7:[N10:3] where N10:3= 20 and S:24 =15 The actual address used by the instruction is
N7:35.

Troubleshooting Faults

The major error fault code, indicates the probable causes of faults, and recommends
corrective action. The following section describes the different ways to automatically clear
a fault using your programming software.

Automatically Clearing Faults: SLC Processors


• Set the Fault Override at Power up Bit S:1/8 in the status file to clear the fault when
power is cycled, assuming the user program is not corrupt.

• Set one of the auto load bits S:1/10, S:1/11, or S:1/12 in the status file of the program in
an EEPROM to automatically transfer a new non-faulted program from the memory
module to RAM when power is cycled.

• Refer to Status Bits for more information on bits S:1/13, S:1/8, S:1/10, S:1/11, S:1/12,
S:5/0-7, and S:36/0-7. You can declare your own application specific major fault by
writing your own unique value to S:6 and then setting hit S:1/I3.

164
Manually Clearing Faults: SLC Processors
• Manually clear the major fault bit S:1/13, and the minor and major error bits S:5/0-7 in the
status file, using a programming device or a Data Table Access Module. Place the
processor in the REM Program mode. Correct the condition causing the fault, then return
the processor to either REM Run or any of the REM Test modes.

• SLC 5/03 and SLC 5/04 specific - Toggle the key switch from RUN to Program and then
back to RUN.

• SLC 5/03 and SLC 5/04 specific - Clearing these bits with the keys witch in the RUN
position causes the processor to immediately enter the Run mode.

• If you are online with a SLC 5/03 or SLC 5/04 processor with the keys witch position is in
RUN and you press the clear major fault function key, you are warned that the processor
will enter the Run mode once you clear the fault

Using the Fault Routine


• When designating a subroutine file, the occurrence of recoverable or non-recoverable
user faults causes the designated subroutine to be executed for one scan. If the fault is
recoverable, the subroutine can be used to correct the problem and clear the fault bit
S:1/13. The processor then continues in the run mode. If the fault is non-recoverable, the
subroutine can send a message via the Message instruction to another DH-485 node
with error code information and/or does an orderly shutdown of the process. The
subroutine does not execute for non-user faults.

Just A "Guide" To Wiring


Wire colors are a combination of actual standards, plus additions:

Voltages AC Color

AC(-) Neutral White

120 or 220v AC(+) (Hot Wire, Line In) Black

120v AC (Control Circuits, Power) Red (common practice)

Ground Green or Green / Yellow

Black with the ends taped:


480v 3-Phase (The wires could be the actual colors:) Red/Yellow/Orange
or Red/Brown/Blue

Foreign Voltage (Outside the panel) Yellow

Temporary Jumpers Purple (easy to see)

Oddball voltages (Speed Control potentiometer wiring) Violet

165
Unspecified voltages (relay contact for customer connections) Gray

Voltages DC Color

24v DC(+) Brown

24v DC(-) Blue

DC grounded circuits White / Blue stripe

Foreign Voltage (Outside the panel) Yellow

Temporary Jumpers Purple (easy to see)

Oddball voltages (Speed Control potentiometer wiring) Violet

Unspecified voltages (relay contact for customer connections) Gray

Inside the panel UL-508 allows the following

18 AWG = 7 Amps max

16 AWG = 10 Amps max

14 AWG = 20 Amps max

12 AWG = 25 Amps max

10 AWG = 40 Amps max

The allowable Current is Lower than the above stated values when the wire is in conduit, wireway
or ductbank. Go to the NEC for these requirements.

• Most places use 14 AWG minimum for 120 VAC field wiring, regardless of amps.

• Typically, 16 AWG minimum for 24 VDC field control circuits, and 18 AWG shielded
twisted pair for 4-20 mA wires (Belden 1032A or eq.)

• Avoid using 14 or 12 AWG shielded twisted pair for 4-20 mA wiring - it adds nothing in
function, costs more, and is a pain to work with inside instrument enclosures.

• Do not allow wire nuts on 4-20 mA or other analog signal wires - they get loose, they pick
up EMI/RFI, and are just no good. Field splices should only be made at terminal strips in
junction boxes!

• It's important to note any "foreign voltage" on the panel, since "foreign" wires may still
be hot after the panel is powered down and there isn't really a standard.

166
Appendix B
Interfacing to
7-Segment Numeric Displays

7-Segment Numeric LED Displays

In industrial PLC applications, one of the old, but simpler methods of displaying numeric
information is to use one or more 7-Segment numeric displays connected to an output card of a
PLC... Although it is possible to build such a display yourself, it is far more common to employ a
pre-manufactured product such as the 4-digit panel mount unit shown at the top of this page...

To correctly interface a PLC to such a display, it helps to first understand what basic electronic
components are typically employed in their makeup, and how this effects our task of interfacing
to, and programming such a unit... Although both LED and LCD numeric displays are readily
available, and interfaced similarly, we'll concentrate on the more common LED units in the
examples to follow...

167
168
BCD to 7-Segment Decoder c/w 4-bit Latch

Once 7-Segment LED displays became readily available, a simple IC known as a "BCD to 7-
Segment decoder" was quickly developed to simplify their use... Binary formatted data presented
to this IC's inputs results in the IC's outputs being placed into the correct state to display the
equivalent numeral (0 to 9) on a 7-Segment display...

Although BCD to 7-Segment decoder ICs are available without built in latches, this particular IC
includes a built in 4-bit latch which we will make use of in later examples... For now the latch is
set to simply allow input data to freely pass through to the decoder...

In the above diagram, the 4 toggle switches, SW0 to SW3 are used to select the desired numeral
(0-9) that will appear on the 7-Segment display... By using a decoder, it's now simply a matter of
setting the correct 4-bit BCD pattern feeding the inputs of the decoder, and the decoder takes
care of the rest...

169
BCD Input Data
SW3 SW2 SW1 SW0 Numeral Displayed
0 0 0 0 0
0 0 0 1 1
0 0 1 0 2
0 0 1 1 3
0 1 0 0 4
0 1 0 1 5
0 1 1 0 6
0 1 1 1 7
1 0 0 0 8
1 0 0 1 9

The decoder section also has two additional inputs... Lamp Test (LT) turns all segments on so
you can verify at once that all display segments are working, or identify display units that need to
be replaced... This input is normally left at logic 1... The Blanking (BL) input is just the reverse; it
forces the entire display off... This is used in many cases to blank out leading or trailing zeros
from a long display... LT will override BL so you can test even blanked-out display digits...

One should also note that the same circuit could conceivably be controlled by a PLC, if 4 output
bits from a 5VDC PLC output card were used in place of the 4 switches shown... If an 8-bit output
card were available, then two such circuits (2 digits) could be controlled... A 16-bit card would in
turn allow us to control four such circuits (4 digits)..etc...

170
Parallel Non-Multiplexed Multiple Digit Display

The figure (above) on the left is taken from the LogixPro I/O simulator screen, and depicts a
common method of interfacing to a 4 digit display... The figures on the right are taken from the
data sheet of a pre-manufactured 4 digit display unit which could be readily employed in this
particular application...

The manufactured unit does contain four separate circuits, and each circuit (digit) has it's own
decoder, but compared to our earlier circuit example, this unit employs additional components
and circuitry making it far more versatile and easy to use...

Note that there are 4 "Strobe" lines shown; one for each digit... These strobe lines control built in
IC latches which provide us with the option of multiplexing the digits, or displays, if we wished to
do so... In the above non-multiplexed application, the strobes are permanently enabled allowing
data to simply pass through from the BCD inputs and be displayed as normal...

Also note that this particular unit is designed for 24VDC use... This is by far the most common DC
voltage level used in industrial installations, and PLC I/O cards designed for such use are
therefore extremely common... In comparison to 5VDC circuits, 24VDC circuits can typically
tolerate far greater supply voltage excursions, are less sensitive to the effects of contact
resistance, and more tolerant of electrically noisy environments...

171
Multiplexed Digits

By making use of the 4-bit latches that are built into the 4511 IC, we can easily multiplex the digits
if so desired... By properly controlling the state of each latch enable pin (LE) we can use the
same input data lines (4 switches) to selectively write to each 7-Segment display independently...
With just a minor modification to our circuit, we will be able to essentially treat each digit as a
unique 4-bit memory location where BCD data of our choosing can be stored and retained...

In the above schematic diagram, each display may be written to separately... First the BCD
equivalent of the desired numeral (0-9) is set using the 4 data switches... If SW1 is then closed,
the current BCD input data will enter the latch of the upper 4511 IC, and will be passed on to the
decoder causing the numeral to displayed... if SW1 is then opened, the latch will retain the
current data, but will now ignore any changes on it's inputs... The desired numeral will continue to
be displayed by the upper LED display until power is lost, or SW1 is again closed and new data is
allowed to enter it's latch...

172
The Lower 7-Segment display may be written to in a similar fashion... Set the BCD equivalent of
the desired digit using the 4 data switches, then close SW2 momentarily to store and retain the
current BCD data... We might say that we are strobing the data into the display...

We could readily replace the 4 data switches and 2 latch switches if we had 6 5VDC outputs
available on our PLC... If we wished to add additional digits, we would require 1 more PLC output
for each digit added... By multiplexing the data in this fashion we would only require 8 PLC
outputs to control a 4 digit display...

173
4 Digit Display configured for Multiplexed Digits

By using multiplexed data lines as shown above, we can dramatically reduce the number of PLC
outputs required (8) to control this 4 digit display... The down side is that writing a ladder logic
program to update a display wired in this fashion will be somewhat more complicated then one
written to control 4 digits wired in parallel...

If you have been looking closely, you may have questioned the purpose of the dual inline sockets
located on the wiring PCB of this manufactured display unit.. Well essentially the 16 data lines are
internally connected in parallel with these sockets, and this allows us to easily add additional units
by simply interconnecting them using a flat ribbon cable assembly...

174
Multiple 4 Digit Displays configured for Multiplexed Digits

For those with a fundamental knowledge of computers, you'll likely note that we have essentially
created a 4-bit data bus, and the strobe lines are in effect our address bus... We can continue to
add additional digits, and for each digit added we will require 1 additional PLC output, or 4
outputs per quad display...

175
1 Quad Display requires 4 data + 4 strobes = 8 outputs
2 Quad Displays requires 4 data + 8 strobes = 12 outputs
3 Quad Displays requires 4 data + 12 strobes = 16 outputs
4 Quad Displays requires 4 data + 16 strobes = 20 outputs

If you are reading through this tutorial because you are having difficulty determining how to
control the 4 quad displays in the Bottle Line Simulation, you may already have noted that the
displays in that simulation do not employ muxed (multiplexed) digits, but rather the quad displays
themselves are muxed... Why this method was chosen, will be investigated now...

176
Multiplexed 4 Digit Displays ..... (Bottle Line Simulation)

177
The above diagram functionally depicts how the 4 panel mounted display units in the Bottle Line
simulation are deemed to be configured... In this case, the 4 manufactured displays are wired to a
shared 16-bit data bus (wires) which is connected to a 16-bit 24VDC output card (O:4) that is
dedicated to this purpose... 4 unused outputs from card O:2 were selected, and appropriately
wired to allow control of the strobe lines associated with each display unit...

Each unit may be written to individually by first sending the 16 bit BCD representation of the 4
decimal numerals to output card O:2... If one of the four output bits 0:2/11 to O:2/14 is then taken
from an initial low, to high state, the BCD data will enter the selected latches, and the numerals
will be displayed... If this strobe line is then returned to the initial low state, the BCD data will (be
latched) remain in the latches, and continue to be displayed... Any changes in the state of the
data lines will now be ignored, and this will continue until the next low-to-high transition of this
unit's strobe line occurs...

You may have noted that this configuration requires a high level on the strobe line to allow data to
enter the latch, while some of our earlier examples required a low state... The polarity of the
strobe is non critical, and with this particular make of display, the choice of polarity is set by
simply positioning a configuration DIP switch appropriately...

Multiplexed Digits vs Displays

There are no hard and fast rules relating to this issue, but a quick look at the following chart does
provide some food for thought...

................................Muxed Digits....Muxed Displays


1 Quad Display requires.......8 outputs......16 outputs (no muxing)
2 Quad Displays requires.....12 outputs......18 outputs
3 Quad Displays requires.....16 outputs......19 outputs
4 Quad Displays requires.....20 outputs......20 outputs
5 Quad Displays requires.....24 outputs......21 outputs
6 Quad Displays requires.....28 outputs......22 outputs
10 Quad Displays requires....44 outputs......26 outputs

Another consideration relates to ease of programming... The task of writing digits one at a time is
obviously going to be a greater challenge then writing 4 digits at a time... Also, fewer instructions
typically equates to an easier to read program, plus a quicker scan... If you need to control 4 quad
displays, muxed displays would be my choice... Need 10 displays, and it might be time to
consider some other means of presenting information to the operator... HMI?...

178
Koldwater Technologies, LLC maintains a web site at
http://www.koldwater.com. Significant student discounts are available for
students enrolled in Technical Schools, Community Colleges, Universities
and Apprenticeship Schools. You must provide PROOF of enrollment to
qualify for the Student Discounts. (i.e. copy of student ID, enrollment
receipt, etc)

179

You might also like