Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
658 views119 pages

PLC Lab Manual: Exercises & Safety

This document provides an overview of the equipment and labs for a PLC course. The course uses a lab with 8 student workstations, each equipped with a PLC, PowerFlex, power supplies, inputs/outputs, and PanelView. Lab 1 introduces students to the rack layout and equipment. Students will learn to connect sensors and buttons to digital inputs and download/run basic programs. Subsequent labs will cover ladder logic, timers, counters, comparison instructions, arithmetic functions, PowerFlex, motors, Ethernet communication, and a final project. Safety rules are outlined to prevent electrical hazards when working with the high-voltage equipment.

Uploaded by

jorgemoody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
658 views119 pages

PLC Lab Manual: Exercises & Safety

This document provides an overview of the equipment and labs for a PLC course. The course uses a lab with 8 student workstations, each equipped with a PLC, PowerFlex, power supplies, inputs/outputs, and PanelView. Lab 1 introduces students to the rack layout and equipment. Students will learn to connect sensors and buttons to digital inputs and download/run basic programs. Subsequent labs will cover ladder logic, timers, counters, comparison instructions, arithmetic functions, PowerFlex, motors, Ethernet communication, and a final project. Safety rules are outlined to prevent electrical hazards when working with the high-voltage equipment.

Uploaded by

jorgemoody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 119

PLC Lab

Lab Manual
Table of Contents
1. Course Overview …………………………………………………………….……………
1
2. Safety Rules……………….………………………………………………………………2
3. Lab Exercises
a. Lab 1: Equipment and Software Introduction……………………………………..3
b. Lab 2: Ladder Logic
Introduction………………………………………………...11
c. Lab 3: Timers…………………………………………………………………….21
d. Lab 4: Counters…………………………………………………………………..30
e. Lab 5: PowerFlex………………………………………………………………...40
f. Lab 6: Practice Midterm
Exam…………………………………………………...51
g. Lab 7: Comparison Instructions………………………………………………….58
h. Lab 8: PowerFlex – Motor Direction…………………………………………..…
67
i. Lab 9: Arithmetic Functions Part 1 – Addition and
Subtraction………………….77
j. Lab 10: Arithmetic Functions Part 2 – Multiplication and
Division……………...85
k. Lab 11: Ethernet and SCADA Systems………………………………………..…
93
l. Lab 12: Final Project……………………………………………………………101
m. Lab 13: Final
Report…………………………………………………………….106
n. Lab 14: Practice Final
Exam…………………………………………………….108
Course Overview
Course Objectives:
The purpose of this course is to introduce students to Programmable Logic Controllers

(PLCs) and the language used to operate them. PLCs are a common tool used in industry to

control various machines and processes. Throughout this course, students will learn how to

program this equipment using ladder logic. In industry several additional pieces of equipment are

commonly used with PLCs, these include the PowerFlex, various types of motors, the PanelView

and various peripherals. An understanding of these different devices will also be provided

throughout this course in order to better prepare students for real-world situations involving this

equipment.

Content:

Throughout this course a total of 14 labs will be completed. These labs will provide

students with hands-on experience working this equipment. The labs will cover the basics of

ladder logic, such as the layout of these programs and the different standard inputs and outputs.

In addition, common tools used in these programs will be explored, specifically timers, counters,

comparison functions, move functions and arithmetic functions. These labs will also include how

to connect various peripherals, such as buttons and sensors, to the student workstations and how

to obtain the desired information from them. The process of connecting and using the PowerFlex

and two different specific types of motors will be the subject of several labs. An overview of

using Ethernet connections to communicate between different pieces of equipment will be

included in one of the exercises, as well as an introduction into SCADA systems.

Page | 1
Safety Rules
Throughout this course students will be exposed to high voltages due to the equipment
that will be used in the labs. Due to this factor, students must be cautious and pay close attention
when completing the labs and interacting with the equipment. When using the lab students must
follow the safety rules listed below.

1. No food or drinks are allowed at the workstations or in the lecture area of the room.
These items must either be left outside the door or placed on the table located on the right
of the room beside the main entrance.
2. When connecting or wiring devices make sure that the rack is turned off and that no
devices are on. There are NO EXCEPTIONS to this rule.
3. Make sure that the wires that are used are not exposed at the ends once they are
connected to the specified locations.
4. Before the station is turned on, any devices that were connected for the lab must be
tugged to make sure that the connection is secure. Loose connections could be hazardous.
5. When wiring the PowerFlex make sure to replace the front panel before the device is
powered on. This will reduce the chances of coming into contact with the connections,
screws and circuitry of the device.
Class Rules
Students must follow the Class Rules stated below when using the lab.
1. Students must be given permission by the instructor to be in the classroom any other then
the specified meeting time. A Graduate Assistant or Instructor must be present.
2. Tool kits must be placed back in their designated location. DO NOT take tools out of the
classroom.
3. When saving the files to the computer, they must be save to a folder located in “My
Documents” that is named for the class and semester. An example would include “EEC
346 FALL2018”.
4. The lab files that are saved must include the first letter of the student’s first name, their
full last name and the lab number. If multiple member are in the group the group name or
the leader’s name should be used.
5. Disconnect any devices that were connected during the lab. Make sure to leave the
workstation as you found it.

Page | 2
Lab Exercise 1
Equipment and Software Introduction
Objectives:
After the completion of this exercise students will:

1. Be familiar with the PLC racks located at each student workstation.


2. Have a basic knowledge of the equipment included in each station and the layout of the
connections.
3. Know how to make the connection between the PLC and the computer at the lab station.
4. Be able to connect sensors and buttons to the digital inputs of the racks.
5. Be able to download and run a basic program to the racks located at that stations.

Materials:
 2 Sensors
 2 Buttons
 Student Tool Kit
Description:
The Programmable Logic Controller (PLC) Lab is located in Room 311 in Lloyd Cassidy
Building and contains eight student work stations. Located at each workstation is a customized
rack that contains different pieces of equipment and a PC. Each rack contains a PLC, a
PowerFlex, two separate 24 V Power Supplies, a Power Switch, a PanelView, Digital Inputs and
Outputs and Analog Inputs and Outputs. The figure shown below, Figure 1 – 1, shows the layout
of each of the racks located at the workstations. First, there are two different Power Supplies
located on each, the first one supplies power to the PLC and the second one supplies the modules
attached to the PLC and the PanelView. The PowerFlex and both Power Supplies are connected
directly to the Power Switch shown on the left. The purpose of the PowerFlex is to control
different aspects of the motor, specifically the speed and direction at which it turns. (The
PowerFlex will explored in more detail in during Lab 5.) The PanelView is an interactive
touchscreen that can be utilized in several different ways, for example it can display buttons
which can be used and inputs for a program.

Page | 3
Figure 1 – 1

The digital and analog inputs and outputs that are displayed at the bottom of the rack are
each labeled and connected individually to the PLC. These terminals are the ones that will be
used in each lab to make all of the connections to the PLC. The terminals are clustered in groups
of three, which are the specified input or output terminal, a positive voltage and a negative
voltage. The positive voltage will be located first on the left, the input or output will be located in
the center and the negative voltage will be located on the right. The input and output terminals
are labeled with a specific address which will be used in the next lab when creating the tags for
the program.

There are two common peripherals that will be used in these labs, which are buttons and
sensors. Buttons have two wires one must be connected to the input terminal (which is the
signal) and the other must be connected to the positive voltage, it doesn’t matter which wire is
connected to which terminal. There are two different types of sensors that will be used the most
often in these labs, they are inductive and capacitive sensors. Inductive sensors must make
contact with metal devices in order to send a signal. Capacitive sensors are used to detect if
something in present in a designated area, which can be altered by adjusting a terminal on the
side of the sensor. The capacitive sensors that will be used throughout this course have three
wires while the inductive sensors will have two. Sensors typically have either two or three wires,
these wires are black, blue or white and brown. The two wires that will always be present in a

Page | 4
sensor are the signal and the positive voltage, the negative voltage will not always be present.
The colors in the table below, Table 1 – 1, show which value that the colors above will always
represent.

Table 1 – 1
Sensor Wire Color Code
Value Color
Signal Black
Positive Voltage Blue or White
Negative Voltage Brown

There are two primary programs that will be used for labs, they are Studio 5000 and
RSLinx Classic. The first program will be used to created ladder logic programs, which will be
introduced in the next lab. The second program is used to establish communication between the
PC at the station and the equipment on the rack. The icons for these programs should either be
located on the desktop or on the Start menu of the computers located at each workstation.

Procedure:

1. Turn on the computer at your designated workstation.


2. Acquire the specified materials that are listed at the beginning of this lab. Use one of the
flat head screwdriver located in the student tool kit to connect the acquired buttons and
sensors to the racks. The color code information found in Table 1 – 1 should be used
when connecting the sensors. Use the table located below, Table 1 – 2, to determine
which terminals to connect each of the devices to.

Table 1 – 2
Device Terminal Address
Button 1 (Start Button) DI: O/00
Button 2 (Stop Button) DI: O/01
Sensor 1 DI: O/02
Sensor 2 DI: O/03
3. Turn the rack located at the workstation on using the switch found on the rack. Once all
of the different pieces of equipment are completely booted, open the program RSLinx
Classic. If your workstation is setup correctly, then the screen seen in Figure 1 – 2
should be seen. If the screen that appears has any red X’s on any of the pieces of

Page | 5
equipment, please make sure all equipment is completely booted, then contact your
instructor.

Figure 1 – 2
4. Minimize RSLinx Classic and open Studio 5000. The screen shown in Figure 1 – 3 will
appear and the “New File” option should be selected. In the pop-up window that appears,
the controller that should be selected is 1769-L18ER-BB1B and the file should be named
“LastNameLab1”. Please referred to the Class Rules section of this manual for instruction
on how to name and where to save your files. Once the file is named, press the next
button.

Figure 1 – 3

5. In the window that appears, which is seen in Figure 1 – 4, select 4 modules. Each of the
racks have four modules and this is the number that should ALWAYS be selected when
opening the program.

Page | 6
Figure 1 – 4

6. Once the mains screen of this program has loaded, go to the menu located at the left of
the screen and right click on “Expansion I/Om, 4 Modules”, and select “New Modules”.
A new menu will appear, which is shown in Figure 1 – 5, is used to add each of the
individual modules into the software.

Figure 1 – 5

Page | 7
Each module has a serial number and the type of module listed on the front of them, a
diagram of the layout of this information can be seen below, Figure 1 – 6. Each serial
number is added to the search bar, the correct option is selected, named according to the
module type and then the “Create” button is selected. This process MUST BE
COMPLETED each time a new file is created.

Figure 1 – 6
7. The program is then closed, and a then a file that is provided by the instructor should be
opened. On the main menu of Studio 5000, the “Open File” option should be selected and
the provided program should be chosen.
8. Once the file has loaded, go to the options bar at the top of the screen and select
“Communications”, then “Who Active”. Then, the popup window shown in Figure 1 – 7
will appear. The second option in the list, which is 1769-L18ER-BB1B, should be
chosen, then “Download” should be selected and the next two pop-up menus that appear,
which will send your program to the PLC.

Page | 8
Figure 1 – 7
A pop-up window will appear and ask if you would like to run your program, “OK”
should be selected.

9. Activate the different sensors, and notice how the program responds. Watch the Input and
Output Lights on the PLC to see which ones are activated. Complete Table 1 – 3 below
based on your observations.
Table 1 – 3
Input Output

Page | 9
Evaluation and Review Questions:
1. What equipment is located on each of the racks? What is the purpose of each piece?

2. What do each of colors four colors (black, blue or white, and brown) of wire
represent?

3. How many wires do the Inductive sensors that will be used have and what colors are
they? How many wires do the Capacitive sensors have and what colors are they?

4. What program should be opened first on the PC at each workstation and what is the
purpose of this program?

5. How many external modules are attached to each of the PLC’s? What modules are
located at your workstation? Write the Serial Number and Module Type in the space
below.

Page | 10
Lab Exercise 2
Ladder Logic Introduction
Objectives:
After the completion of this exercise students will:
1. Have acquired a basic understanding of ladder logic programming.
2. Know how to utilize a standard output, normally open and normally closed inputs.
3. Know how to create Tags.
Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
Ladder logic is the primary method used to control PLCs and is based on relay logic. This
method of programming uses specific symbols instead of scripted text. The lines of a ladder logic
program are referred to as rungs. These program are created vertically one rung at a time and
each rung of the program is read from left to right. The rungs will contain symbols that the
program will interpret as instructions. There are two different basic types of symbols that are
essential to every program, they are inputs and outputs. The inputs are always located on the left
side of the rung and the outputs are always located on the right.

Two of the most common input instructions are Examine If Closed (XIC) and Examine If
Open (XIO). The XIC instruction is used to determine if a specified bit is ON, which is
represented by a binary 1. For this command if the bit is ON it is read as TRUE and a 1 is
produced, if the bit is not ON then it is read as FALSE and a 0 is produced. The XIO instruction
is used determine if a specified bit is OFF, which is represented by a binary 0. If the specified bit
is OFF then the statement is TRUE and a one is produced, if the device is ON then the statement
is FALSE and a 0 is produced. Figure 2 – 1 shown below contains the symbol used to represent
the XIC instruction and Figure 2 – 2 shows the symbol used to depict the XIO instruction.

Figure 2 – 1: XIC Input Figure 2 – 2: XIO Input

Page | 11
There are three basic output instructions, these include Output Energize (OTE), Output
Latch (OTL), Output Unlatch (OTU). The OTE instruction tells the PLC to either turn the
designated output ON or OFF if the required input instruction on that designated rung are TRUE.
The OTL instruction turns the designated output ON, and keeps it ON even if the rung goes
FALSE. The OUT instruction turns the designated output OFF, and keeps it OFF even if the rung
goes FALSE. The most commonly used output instruction is OTE, which is the one that will be
used the most often during this course. The symbol of OTE can be seen in Figure 2 – 3, the
symbol for OTL can be seen in Figure 2 – 4, and the symbol for OTU can be seen in Figure 2 –
5.

Figure 2 – 3: OTE Figure 2 – 4: OTL Figure 2 – 5: OTU

When creating a ladder logic program, the symbols can be placed on the rungs in series
or parallel relationships. A series relationship means that all of the instructions located on rung
must be TRUE in order for the output to be activated. A parallel relationship means that the only
one of the inputs has to be TRUE. To create this type of relationship the input instructions must
be shunted together, how to create this type of relationship will be explained later in the
procedure section of this handout. If all of required input instructions on the rung are TRUE, then
the output will be activated. If the required inputs are not TRUE, then the rung will remain
FALSE and the output will remain unchanged.

The method that will be used to create programs throughout this course involves the use
of states. The states will be used to control each of the physical outputs and each on will be
controlled by specified inputs. When using this method of programming, there are some steps
that must always be completed. First the Enable bit (EN) must always be latched to the start
button on the first line. Enable must always be the first output in any program and is the first
input on every line in the main body of the program, but not the portion that programs the states.
When starting the program, the first step is write the standard first rung, and then put each of the
physical outputs on their own individual rung, these rungs make up the main body of the code.
The rungs that determine each state will be located after these lines. When writing the rungs that
involve the states, the first step is to call the previous state. Then, the current state that you are on

Page | 12
must be latched as an input to any of the other inputs of that line, besides the first one that calls
the previous state. The current state that is being written will be listed as the output at the end of
its designated rung.

Prompt 1: The image below, Figure 2 – 6, depicts the process of filling containers on a
conveyor belt. Senor 1 is used to determine if the container is in the correct place, if it is then
Valve A will open to fill the bottle. When the bottle is full, then Sensor 2 will be activated and
the Conveyor will start. The process should be repeated until the Stop button is pressed.

Figure 2 – 6
Procedure:
1. Read the prompt above and analyze the diagram of the situation, Figure 2 – 6. Examine
the prompt to determine the number of states that this scenario has. The states represent
each of the actions that need to be performed. By examining this prompt it is determined
that there are three state. These include what is happening when the program starts, filling
the container and moving the conveyor. The diagram shown, Figure 2 – 7, below will
help explain the layout of the states.

Figure 2 – 7

Page | 13
2. Using the information provided above the following ladder logic program, shown in
Figure 2 – 8, can be written.

Figure 2 – 8

3. Open Studio 5000 using the process discussed in the previous lab. Follow the guidelines
in the “Class Rules” section of this manual to save files by the proper name and at the
proper location. Once the program is opened, go to the menu on the left side of the
screen, expand the main program folder and select “Main Routine”.
4. On the menu located at the right, click on “Controller Tags”. A window like the one
shown in Figure 2 – 9 should appear. Select the “Edit Tags” option at the bottom of the
screen.

Page | 14
Figure 2 – 9
5. Scroll to the top of the screen and select “Local:1: I”, then select “Local: 1: I. Data”. For
this prompt there are four physical inputs: two sensors and two buttons. Use the first four
inputs, and name them based on the prompt and type the name of each in their designated
“Description” box. For example, one button will be connected to the first port, DI: O/00
on the rack, so the address will be “Local: 1: I. Data.0” in the program and the
description will read “Start”. Repeat this process of all four physical inputs.
6. Select “Local: 1: O”, then “Local: 1: O. Data” and use the first two addresses for the
physical outputs. These outputs will be Valve A and Conveyor. The complete process of
naming these tags can be seen in Figure 2 – 10.

Page | 15
Figure 2 – 10
7. Scroll down to the bottom of the screen to create the tags for the other aspects of the
program. These tags represent aspects of the program that are not physical, such as the
states and the enable bit. Make sure all of the inputs are Boolean, “BOOL” will be
present in the “Data Type” column.
8. Go to the “Main Routine” and click on the first rung. At the top of the screen is a menu,
on that menu is a box that contains all of the different types of inputs, outputs, tools and
functions that are available. This menu can be seen below in Figure 2 – 11. On the
“Favorites” tab, select XIC symbol and then click and drag the symbol to the first rung.
Then, select the “Branch” option and drag this feature from one side of the XIC symbol
to the other, this creates the shunt that acts as a parallel relationship. Then drag one of
OTE symbols to the right side of the first rung to create the first output.

Figure 2 – 11

Page | 16
9. Select the first input on the rung, then double click on the top box that appears when the
input is selected. Then select the same source as before, which is “Local: 1: I. Data”. A
drop down arrow will appear and then the address that was chosen for this particular
input should be selected. The process can be seen in Figure 2 – 12 below.

Figure 2 – 12
10. The above process is repeated for all other inputs and outputs with physical addresses.
When selecting a software-based component, the symbol is selected and the box is double
clicked. The different tags that were available in the Control Tags menu will be displayed
in alphabetical order. The desired tag should then be selected.
11. The process described above is then repeated until the entire code is created.
12. Connect the buttons and sensors to the specified port addresses that were selected when
the program was created.
13. Power on the rack once the physical connections have been made. Establish the
connection between the rack and the computer as directed in the previous lab.
14. Activate the required sensors and test the code that was created.

Page | 17
Evaluation and Review Questions:

1. What are the two main instructions used for inputs?

2. What are the three different instructions used for outputs? Which one is the most
commonly used?

3. What are the two different types of relationships that make up a ladder logic program?
Briefly explain each one.

4. Briefly describe the method that will be used throughout this course to create ladder logic
programs.

5. What steps must always be performed when creating a ladder logic program?

Page | 18
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should be
created in Studio 5000 and ran using the racks located at the stations. Complete Figure 2 – 13
below to help determine the states.

Figure 2 – 13

Hint: Write your program in the space provided below before entering it into the computer.

Prompt 2: A container is used to mix to different products, one comes from Valve A and the
othe comes from Valve B. Valve C is located at the bottom of the tank and is used to empty the
contents of the tank. There are three different sensors located on the tank, one at the bottom to
detect if the tank is empty and two dectect different fill levels. The layout of the sensors can be
seen in Figure 2 – 14. When the process starts the tank must be emptied, then Valve A will stay
on till Sensor 2 is triggered. Then, Valve A will shut off and Valve B will turn on until Sensor 3
is activated. The tank should be emptied and the process should be repeated until the Stop button
is pressed.

Figure 2 – 14

Page | 19
Page | 20
Lab Exercise 3
Timers
Objectives:
After the completion of this exercise students will:
1. Have a basic understanding of timers and the types that are available.
2. Know how to use the different aspects of a timer in a ladder logic program.
3. Know how to create a timer using Studio 5000.
Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
A common feature used in ladder logic programs is the timer. The timer is a software
function and will not have a physical address. There are three different types of timers that are
used for the PLC, they are Timer Off Delay (TOF), Timer On Delay (TON), and the Retentive
Timer On (RTO). The TOF delay counts while the instruction is FALSE, while the TON delay
operates while the instruction is TRUE. These two types of timers will reset automatically
whenever voltage is added or removed, while the RTO timer stores the information until it is
manually reset. This instruction is activated when the statement or conditions are TRUE, and will
retain that information after the condition goes FALSE. The most commonly used type of timer
is the TON, which is the one that will be used the most often throughout this course.

The program that is being used throughout this course, Studio 5000, uses tags to create
timers. The process for creating a timer is similar to the process described in the previous lab, but
instead of the “Type” being Boolean (BOOL) it will be TIMER. The symbol for TON can be
seen below in Figure 3 – 1. The “Timer” portion of the symbol refers to the name of the timer,
which will be created using the “Controller Tags” menu. The “Preset” value is also included in
the controller tags; this is the amount of time that the timer will be set to run. Older versions of
RSLogix allowed the user to determine the time base that would be used. The time base is the
unit of measurements, such as seconds and milliseconds. The software that is used during this
course uses a time base of 1 millisecond and does not allow the user to change this setting. The
time values that are given to students in prompt are typically in seconds, meaning that students

Page | 21
will have to multiply the specified value by 1,000 and enter that value in the “Preset” of the
timer. The “Accumulated” value shown in the symbol for the timer will update automatically
whenever the timer is activated and show the current value of the timer.

Figure 3 – 1
There are three different control bits that are used with a timer, these include timer
Enable (EN), Timer – timing (TT) and Timer Done (DN). The first bit, EN is only TRUE when
the specified conditions needed to activate the timer are TRUE. Once the timer EN bit becomes
TRUE then the timer will start counting, which will activate the Timer – timing bit and cause it
to remain TRUE for the specified duration of the timer. The last bit is timer DN, which becomes
TRUE once the timer has run for the specified amount of time. The bits that are most commonly
used in ladder logic programs are the timer EN and timer DN bits, the TT bit is rarely used. The
timer symbol is considered an output and is always located on the right side of the rung. The bits
that are specified above are considered inputs, and the process of creating them will be explained
in detail in the next section of this handout. When using that state method of coding that is used
throughout this course, the timers will be locates in the “State” section of the code and not in the
main body.

Prompt 1: A large container is used to mix two different products. There are three sensors, three
valves and one mixer used in this process. The layout of these components can be seen in Figure
3 – 2. First, the container is emptied of any contents that might have remained from the last run.
Next, Valve A is opened until Sensor 2 is activated. Then, Valve B opens and remains so until
Sensor 3 is activated. Lastly, the mixer is activated and ran for a total of 10 seconds.

Page | 22
Figure 3 – 2
Procedure:
1. Examine the prompt above and determine the number of states that will be included in
this ladder logic program.
Number of States: __________________
2. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
3. Once the code has been written compare that program to the one that is shown below in
Figure 3 – 3.

Figure 3 – 3

Page | 23
4. Open Studio 5000 and create a new program. Using the information gained in the
previous lab, name the required physical inputs and outputs. Create the state and general
EN software variables. (The process of creating the timer EN and DN will be explained
in the next steps).
5. Go to “Controller Tags” and select the “Edit Tags” tab at the bottom of the screen. Type
the name of the first timer that should be created in the designated space provided. In the
“Data Type” field either type “TIMER” or select it from the list provided by clicking on
the “…” symbol in the designated box. Press “Enter” to finish creating the timer. If a
popup window appears stating that the tag value will be truncated, select “OK”.
6. Select the “Monitor Tags” tab at the bottom of the window. Select the “+” sign next to
the name of the timer. In the “Value” column type the desired value for the timer in the
box across from “Timer.PRE”. Remember the time base is in milliseconds, so make sure
to multiply the given value by 1,000 to acquire the correct value. No other values should
be added to this section. This process is shown below in Figure 3 – 4.

Figure 3 – 4

Page | 24
7. Go to the “Main Routine” and create the rungs of the program until the one containing
the timer has been reached. Create a shunt, as instructed in the previous lab, with the
“State 2” output as shown in the code provided. Then go to the menu at the top of the
screen, select the “Timer/Counter” tab and drag a TON symbol to the designated
location. Inside of the timer, select the box next to “Timer”. From the dropdown menu
select “Timer1” from the list, the one with not suffixes. When you click out of the popup
window, the “Preset Value” will be automatically set to the value that was specified in
the “Controller Tags”. This process can be seen below in Figure 3 – 5.

Figure 3 – 5
8. Create a new rung and add the State 3 XIC input, then insert another XIC input. In the
blue box that appears when the input is selected, press the down arrow to see all of the
tags that had been created. Press the “+” next to the name of the timer, and from this drop
down menu select “Timer1.DN”. This process that is used to create the Timer DN bit can
be seen below in Figure 3 – 6.

Page | 25
Figure 3 – 6
9. Complete the rest of the program and then attach the required buttons and sensors to the
rack.
10. Turn on the rack and establish the required connections. Then, press the “Start” button to
run the program. Observe the program to make sure that the required actions are
completed correctly.

Page | 26
Evaluation and Review Questions:

1. Name the three different types of timers and their purposes.

2. Briefly explain the process of creating a timer in the “Controller Tags” menu. What data
type is used for this process?

3. What is the time base that is used for this program? Convert the following times to the
required time base.
a. 5 seconds
b. 30 seconds
c. 18 milliseconds
d. 0.5 seconds

4. Explain the purpose of the three different bits associated with a TON. Which of these bits
are the most common?

5. In PLC programs are timers considered a software or physical component? The timer
symbol must be located on which side of the rung?

Page | 27
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations. Only the Start and Stop
buttons will be used for this lab, no sensors are needed.

Prompt 2: A process consists of the use of two different pistons. The first piston takes five
seconds to extend and the second piston takes three seconds to extend. The program should
extend the first piston, and activate the second piston once the first is fully extended. Make the
program repeat itself until the Stop button is pressed. When creating the timers, add an extra
second to each one to make sure the process is complete. The process can be seen in Figure 3 –
7.

Hint: Three timers will be used. One for each piston and one on the second rung to repeat the
process.

Figure 3 – 7

Page | 28
Prompt 1

Prompt 2

Page | 29
Lab Exercise 4
Counters
Objectives:
After the completion of this exercise students will:
1. Have an understanding of counters and the different types that are available.
2. Know how to utilize the different bits of a counter in a ladder logic program.
3. Know how to create a program a counter in a ladder logic program.
Materials:
 2 Sensors
 2 Buttons
 Student Tool Kit
Description:
A counter is another common tool that is used to program PLCs. All PLCs that are
manufactured today come equipment with some form of a counter. The counters that are
typically used today in industry, as well as this class, are software based, and therefor require no
physical address. There are two different types of counters that exist, they are Count – Up (CU)
and Count – Down (CD). The up counter will increment whenever an instruction goes from
FALSE to TRUE. The down counter will decrement the total by one each time that the specified
action is performed. These two timers can be used together in a program to create an up/down
counter. This combined counter will allow an individual to keep an accurate count of a total,
when items are being both added and removed. Bother CU and CD counters can be used in
industry; however, the CU is the most widely used. The symbol for the CU counter can be seen
below in Figure 4 – 1.

Figure 4 – 1
The process of creating a counter is similar to that of a timer. They are created is the
“Controller Tags” window using the same basic steps that are used to create a time, except that
the “Data Type” will be “COUNTER”. The preset value is created in the “Monitor Tags” tab in
the “Controller Tags” window. An important fact to remember about counters is that the

Page | 30
accumulated value can go above the preset value. The counter DN bit becomes TRUE is the
accumulated value is greater or equal to the preset. When using counters in ladder logic
programs it is important to remember that they must be reset using a specified bit, which is
explained in the procedure section. Not resetting the counter can cause extensive issues in a
program, as well as provide inaccurate results in the specified process. The process of creating
and resetting the counter will be explained in detail in the Procedure section of this handout. A
counter symbol is treated like an output and must be located on the right side of the rung. In the
state method of programming the rung containing the actual timer can be located anywhere in the
state section of the code. The easiest place to create the rung that contains the timer symbol is at
the end of the code.

A counter has several different bits that can be utilized in a program, similar to those used
with timers. The bits that are associated with a counter are the Count-Up Enable bit, the Count-
Down Enable bit, the Done (DN) bit, the Overflow (OV) bit, and the Underflow (UN) bit. When
a counter is created in the tags, which will be explained step by step in the Procedure section,
both the CU and CD bits are created, the type of counter isn’t determined until the symbol is
inserted into the program. The DN bit is only true when the accumulated value of the counter is
greater or equal to the preset value, this is true for both CU and CD counters. The OV is true
when the counter has accumulated a number that is larger than the maximum amount of a
counter, which is 32,767. Once the maximum is reach the counter will increment one more time
and then start to decrement each time the FALSE to TRUE condition of a CU counter is met
until 0 is reached. The UN bit is the minimum amount that a counter can contain, which is
32,768. If that number is reached the counter will wrap around to +32,767 and will decrement to
0 each time that the action required to activate the CD counter occurs. The most common bit of
all of the ones mentioned is the DN bit. These bits are generated automatically for each counter
whenever it is created, the utilizing these bits will be explained later.

Prompt 1: A conveyor belt that contains empty boxes is located at the bottom a chute. Each box
must contain five items that will be deposited in the box from the chute. A sensor is located on
the conveyor belt to determine when the box is in place. Another sensor is located at the end of
valve A and will count whenever an item exits the chute and enters the box. The conveyor belt
will be activated whenever the specified number of items is located in the box. This process

Page | 31
should be repeated until the stop button is pressed. A layout of this process can be seen in Figure
4 – 2.

Figure 4 – 2
Procedure:
1. Examine the prompt above and determine the number of states that will be included in
this ladder logic program.
Number of States: __________________
2. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
3. Once the code has been written compare that program to the one that is shown below in
Figure 4 – 3.

Figure 4 – 3 Page | 32
4. Open Studio 5000 and create a new program. Create the all the tags for the physical and
software variables that are needed for this program. Do not create the counter, that
process will be explained next.
5. In the “Edit Tags” tab of the “Controller Tags” window, type the name of the counter in
the designated location. In that same line either type “COUNTER” or click the “…”
button and select that option from that pop-up window. The process can be seen in Figure
4 – 4.

Figure 4 – 4
6. Go to the “Monitor Tags” tab and press the “+” button next to the name of the counter. In
the “Value” column next to the “Counter1.PRE” type the preset value of the counter. The
process can be seen in Figure 4 – 5 below.

Figure 4 – 5
7. In the “Main Routine” create the ladder logic until the stage the state that contains the
counter DN bit is reached.

Page | 33
8. Create the designated input and output symbols on the rung that contains the counter DN
bit. Select the input symbol that will be the DN bit and double click on the blue box
above the symbol. On the menu that appears, scroll down till “Coutner1” is seen and
click the “+”. From the expanded menu, double click “Counter1.DN” to create the
counter done bit. This process can be seen in Figure 4 – 6.

Figure 4 – 6
9. In the rung of the program that contains the counter reset, create all of the other inputs.
Create the first output on this rung, then create the specified shunt. Go to the menu at the
top of the screen, click on the “Timer/Counter” tab and click and drag the “RES” symbol
to desired location. Once the symbol is placed, click on the blue box, to drop down the
menu and select “Counter1” with no suffixes. This process can be seen in Figure 4 – 7
below.

Figure 4 – 7
Page | 34
10. On the last line of the program create the three designated inputs. Then go to the menu at
the top of the screen and select the “Timer/Counter” tab. From that menu click and drag
the CU symbol to the output side of the rung. In the space next to “Counter” in the
symbol, double click on the blue box and select “Counter1” from the menu. Make sure
that the option selected does not contain a suffix. The process is shown in Figure 4 – 8.

Figure 4 – 9
11. Connect the required sensors and buttons. Then establish the connection between the PC
and the workstation rack.
12. Run the program and activate the specified buttons and sensors. Make sure that the
second sensor is pressed 5 times to increment the counter and trigger the DN bit.

Evaluation and Review Questions:

1. What are the two different types of counters? How do they operate?

Page | 35
2. Determine the number of objects that would be detected if an CU was used.
a. Sensor Off, Sensor On:
b. Sensor Off, Sensor On, Sensor Off, Sensor On:
c. Sensor Off, Sensor On, Sensor Off:
d. Sensor On, Sensor Off, Sensor On, Sensor Off:
3. What are the different bits that are associated with a counter? What do each of them do?

4. Does the placement of the counter symbol in the PLC program matter? If not, where is
the best location to place it?

5. Explain how the counter in this program operates. Which sensor is used to increment the
counter? What does the done bit trigger? Why is the “Reset” located at its given position?

Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Page | 36
Prompt 2: A large container is used to mix three different substances. One substances is released
from Valve A, another is released from Valve B. The third substance will be dropped form the
conveyor belt. To start the process, Valve C is opened to make sure that the tank is empty before
the any other contents are added. Then Valve A is opened, and remains so for 10 seconds. Valve
A then closes and Valve B opens and remains so for 10 seconds. The conveyor then runs and
drops three products, one at a time, into the container. Once the specified numbers of products
are added to the container, the mixer turns on and remain on for 10 seconds. The entire process
should be complete three times. The process can be seen in Figure 4 – 9.

Hint: Two counters will be used for this process: one to count the number of products and one to
count the number of times that the process ran. Each timer must have its own reset.

Figure 4 – 9

Page | 37
Prompt 1

Page | 38
Prompt 2

Page | 39
Lab Exercise 5
PowerFlex and Move Function
Objectives:
After the completion of this exercise students will:
1. Have a basic understanding of the PowerFlex and how to control it.
2. Know how to correctly wire the PowerFlex in order to control it using the PLC’s analog
connections.
3. Understand the purpose of the Analog Output External Module and how to utilize it.
4. Know how to use the “Move” function in Studio 5000.
Materials:
 3 Sensors
 2 Buttons
 5 Long Pieces of Stranded Wire – Both Ends Must be Stripped
 Student Tool Kit
 PowerFlex 520 Quick Start Manual
 Voltage Output Analog Module Manual
Description:
The PowerFlex is a type of AC Driver that is produced by Allan Bradley. An AC driver
is a device that is used to control different features of a motor, such as power, direction, and
speed. The speed of the motor is controlled by a frequency, which can either be determined by a
ladder logic program or programmed directly into the device. The direction, which is either
clockwise or counterclockwise, is controller in the same manner. There are ports located on the
front of the PowerFlex that can be accessed once the front panel is removed. These ports will be
utilized to control the different factors mentioned above. The diagram of the ports can be seen in
Figure 5 – 1 below. A copy of this diagram can also be found on the back side of the front panel.

Figure 5 – 1
Page | 40
The PowerFlex can communicate with external devices using several different methods, the
most common are through USB connections, Ethernet Connections or Analog using wires and
direct connections. During this course students will be taught how to utilize both the Ethernet
and Analog communication methods.

One purpose of this lab is for students to become familiar with the process of making the
connections needed to communicate between the PLC and the PowerFlex using the Analog
method. For this communication method, one of the external modules connected to the PLC must
be used. The module that will be used is the third one to the right on the racks, the serial number
is 1734-OE2V, and the name is Analog Voltage Output. The connections diagram for this
module can be seen in the figure below, Figure 5 – 2, that was taken from the instruction manual
for this module.

Figure 5 – 2

Only two of the ports shown in this diagram will be utilized in this lab. The first port 0 which is
“Out 0”, this is the channel that will be used in the ladder logic program to send commands from
the PLC to the PowerFlex. A wire will be used to connect this port to port 13 of the PowerFlex,
which is the 0 ~ ±10V Input. The second port that is used is Port 4, which is the Common and
will be connected to the Analog Common (Port 14) of the PowerFlex. There are three additional

Page | 41
connections that will be made directly from the PowerFlex to some of the Digital Outputs of the
PLC racks. First, Port 01 of the PowerFlex will be connected to a Digital Output, this port will be
used to stop the motor. The second port that is used is Port 02, which controls the start and
forward direction of the motor. This port should also be connected to a Digital Output terminal.
The last connection that should be made is between the Digital Common of the PowerFlex and
any of the common ground connections on the Digital Output side of the terminals located on the
rack. The process of making these connections will be explained in detail in the Procedure
section of this lab.

When writing a ladder logic program in Studio 5000 that controls the motor, two new
features must be utilized. The first feature is the Move (MOV) function, which transports data
from one designated location to another. MOV acts like an output and should be located on the
right side of the rung. The symbol for MOV can be seen below in Figure 5 – 3. The Source is the
file that the information is taken from, and the space directly below that shows the value found at
that location.

Figure 5 – 3
The “Dest” is the location where the data will be moved to and the space below shows the data
that will be located at that new location. This value is displayed after the instruction is executed.
The second feature that is used is a different Data Type that is utilized when creating the tags.
The new data type is an Integer or “INT”, and is used to store a designated value and is read like
a normal number by the program. Utilizing these two new features will be explained in detail in
the Procedure section.

Prompt 1: A large container is used to mix products together. For this process there are two
valves, Valve A is used to fill the tank and Valve C is used to empty it. A mixer is used to
thoroughly blend the mixture. Valve A should open and fill the rank until Sensor 2 is activated.
Once Sensor 2 is activated, the mixer should turn on and run at a speed of 30 HZ for 20 seconds.
After the Mixer has stopped, Valve A will open again and will fill the tank until Sensor 3 is

Page | 42
activated. The Mixer will then turn on and run for 10 seconds at a speed of 60 HZ. The process
can be seen below in Figure 5 – 4.

Figure 5 – 4
Procedure:

1. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
2. Once the code has been written compare that program to the one that is shown below in
Figure 5 – 5.

Page | 43
Figure 5 – 5
3. Open Studio 5000 and create a new program. Name the addresses for the Sensors,
Buttons and Valves. For this lab the “Mixer” output that is used in the Main Body of the
code will be a software tag. Create the software tags for the States and Mixer. Also,
create the timers that will be needed for this program. Make sure to change the value of
the timer to the correct time base, if you don’t this will cause problems in the future.

Page | 44
4. Create a tag named “Low Speed” and change the “Data Type” to “INT”. Then, go to the
“Monitor Tag” tab and set the value of this tag to 30 Hz. Repeat this process to create a
tag for the “High Speed” value.
5. Take the 8 wires that were obtained and use them to make the connections specified in
Table 5 – 1 below. Use the references diagrams, Figure 5 – 1 and Figure 5 – 2, to make
the connections.
Table 5 – 1
Location 1 Location 2
Analog Module Port 0 PowerFlex Port 13
Analog Module Port 4 PowerFlex Port 14
PowerFlex Port 01 Digital Output “Local 1:O: Data 4”
PowerFlex Port 02 Digital Output “Local 1:O: Data 5”
Connect to Any Common (-24 V) of
PowerFlex Port 04
Digital Output that is not in use

6. Once the connections have been made, go to “Controller Tags” and name the two digital
output addresses that were used above. The address connected to PowerFlex Port 01 will
be used to stop the motor, while the address connected to PowerFlex Port 02 will be used
to start it.
7. Go to the menu at the left side of the screen and Select Module 4 from the Expansion I/O
Modules list. Select the “Configuration” tab and change the “High Engineering” value to
the largest value that will be used. For Prompt 1 the highest speed that will be used is 60
Hz. The Module 4 menu can be seen below in Figure 5 – 6.

Figure 5 – 6

Page | 45
8. Go to “Main Routine” and create the first rungs of the program until you reach the rung
that controls State 1. Add and name all the components to the rung, until the “Move”
instruction is reached. Create a second shunt to the output on this rung, select the “Move”
symbol from the “Move/Logical” tab of the menu at the top of the screen, and drag it
onto the shunt that was just create. In the box next to “Source” select the “Low Speed”
tag that was created. In the box next to “Destination”, press the “+” button next to “Local:
4:O” and select “Channel 0”. The process can be seen below in Figure 5 – 7. The same
process is completed for the second “Move” instruction that is created, except “High
Speed” is used for the source. Complete the rest of the program except for the last rung.

Figure 5 – 7
9. Create and name the specified bits on the last rung. The two outputs on this rung are the
digital output addresses that you specified as the “Motor Start” and “Motor Stop” earlier
in this lab.
10. Turn on the rack located at your student workstation and make the connection between
the rack and the PC. Run the program and monitor to see how the motor operates when
the required instructions become true. Make sure to examine how the speed, which is
shown on both the “Move” commands in the program and on the screen of the
PowerFlex.

Page | 46
Evaluation and Review Questions:

1. What is the purpose of an AC Driver? What is the exact model of the one located on the
racks?

2. What is the name and serial number of the external module that was used for this lab?
What is the purpose of that module?

3. What are the three different ports that are used on the PowerFlex and what is the purpose
of each?

4. Name the two different ports of the external module that are used, provide a description
of each one.

5. What was the new instruction that was introduced in this lab? Explain the purpose of this
instruction and how it was utilized in this lab.

Page | 47
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A large container is used to mix two different substances. One substance comes from
Valve A and other comes from the Conveyor. The container must be empty whenever the
process starts, which is done by opening Valve C. For the process, the first step is to open Valve
A for 10 seconds, then turn the Mixer on for 10 seconds at 30 Hz. Next, the Conveyor will drop
4 products into the container. Then, Valve A will open and run for 5 seconds. Lastly, the motor
will run at 50 Hz for 20 seconds. The process should repeat until the stop button is pressed. The
diagram for this process can be seen below in Figure 5 – 8.

Figure 5 –8

Page | 48
Prompt 1

Page | 49
Prompt 2

Page | 50
Lab Exercise 6
Practice Midterm Exam
Objectives:
After the completion of this exercise students will:
1. Have an understanding of what is expected on the Midterm Exam.
2. Be able to complete an example prompt, with no specific instructions.
Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
The Midterm Exam is designed to test students’ knowledge on some of the key
components of ladder logic that have been covered up to this point in the course. Students will be
given a prompt similar to the ones that have been seen in the lab. Students will be expected to
know how to do the following:

1. How to Connect sensors and buttons correctly to the PLC racks.


2. Establish the connection between the rack and the PC located at the workstation.
3. Create the needed software tags for the program and name the physical components.
4. Write a ladder logic program that contains XIC and XIO inputs, and OTE outputs.
5. Use TON timers and CU counters in a ladder logic program.
6. How to download and run the created ladder logic program to the PLC.

This lab contains two prompts that are examples of the Midterm Exam. The first prompt will
show the completed code and have students recreate it and establish the appropriate connections.
At the beginning of this lab all of the buttons and sensors will be disconnected so students must
reconnect them appropriately. The second prompt will have students write the code and
download it to the student work station.

Prompt 1: A large tank is used to mix three different products coming from three different
locations. The tank must be emptied using Valve C before the process starts. First, Valve A
should open for 10 seconds. Next, Conveyor 1 will run and drop two products into the container
and the Mixer should run for 10 seconds. Then, Conveyor 2 will drop three products into the

Page | 51
container. Lastly, the Mixer will run for 5 seconds. The process should continue to run until the
Stop button is pressed. The process can be seen below in Figure 6 – 1.

Figure 6 – 1
Procedure:

1. Read Prompt 1 and write the ladder logic program in the space provided below.
2. Compare the code that was written to the completed one shown below in Figure 6 – 2.
Open Studio 5000, create a New Project and write the program.

Page | 52
Figure 6 – 2

Page | 53
3. Connect the required buttons and sensors needed for this program.
4. Establish the connection between the rack and the workstation PC.
5. Download and execute the program.

Evaluation and Review Questions:

1. How many states are in this program? Complete the chart shown below in Table 6 – 1.
Table 6 – 1
State 0
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 1
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 2
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 3
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 4
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 5
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 6
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:

2. Explain the location of the counter symbol in the program.

3. Explain the purpose of each reset used in this program. What instruction used in this
program requires a reset?

4. How many timers are used in this program? What does each one control?

Page | 54
5. What are the topics and skills that students are expected to know for the Midterm Exam?

Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A tank is used to mix three different products. When the process starts Valve C must
be used to empty the tank. First, Valve A will open for 10 seconds. Next, the Conveyor will drop
three products into the tank. Then, Valve B will open until Sensor 2 is activated. The Mixer will
run for 10 seconds and then two more products will be dropped into the tank. Lastly, the Mixer
will run for 10 more seconds. The process can be seen below in Figure 6 – 3.

Figure 6 – 3
Page | 55
Prompt 1

Page | 56
Prompt 2

Page | 57
Lab Exercise 7
Comparison Instructions
Objectives:
After the completion of this exercise students will:
1. Understand the six different commonly used comparison functions and the purpose of
each one.
2. Know how to utilize these instructions in a ladder logic program.
Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
Comparison instructions are used to analyze and compare two different values. The
concepts that these instructions use are very common and are often used in mathematics. These
instructions can be used to compare a variety of different values, such as the speed of the motor
or values accumulated by a counter. When programming using these specific instructions, it is
important to remember that these symbols are treated as inputs. There are six different
commonly used comparison functions, these include Equal (EQU), Not Equal (NEQ), Less Than
(LES), Greater Than (GRT), Less Than or Equal To (LEQ), and Greater Than or Equal To
(GEQ).

The first instruction, EQU, is used to determine if two specified values are the same. If
the statement is correct, then a logical one is produced and the rung becomes TRUE, if not then
the rung remains FALSE. The NEQ function is used to determine if two specified values are
different and if they are then the instruction becomes TRUE. The next instruction, LES, is used
to determine is a value from one source is smaller than a value from another source. If the
statement is correct, then the instruction becomes TRUE, otherwise the instruction remains
FALSE. The GRT function is used to determine if the value from Source A is larger than the
value from Source B. If the statement is accurate then the instruction becomes TRUE and the
specified action can take place, otherwise the instruction will remain FALSE. The last group of
statement includes LEQ and GEQ. For the LEQ instruction, data from Source A is compared
with data from Source B. If the value of Source A is the same or less than the value from Source

Page | 58
B, then instruction becomes TRUE, if not the instructions remains FALSE. The GEQ functions
determine if a value obtained from Source A is the same or larger than the value obtained from
Source B. If the expression is incorrect, then the rung remains FALSE, however if the statement
is accurate then the statement becomes TRUE. The table, Table 7 – 1, shown below depicts the
symbol that corresponds to each of the different instructions.

Table 7 – 1
Symbol Instruction Symbol Instruction Symbol Instruction

Less Than
Equal Less Than
or Equal To

Greater
Greater
Not Equal Than or
Than
Equal To

When using comparison functions in Studio 5000 there are several different sources that
can be used. First, if one of the values that is going to be compared is always going to remain a
constant predetermined value, then a tag with an INT data type should be created and the
“Value” should be set to the specified number. Another method, is to use the data that is being
obtained by a counter or timer, specifically the accumulating value. The last method is to use the
data that is being obtained from a specified channel, such as Channel 0 that was used in an
earlier lab. This concept will be explored further in the next lab, Lab 8. The different symbols
that are used for these instructions can be found in the “Compare” tab in the menu at the top of
the screen. These instructions are considered inputs; therefore, they must be located on the right
side of the rung. The blue boxes that are located directly across from “Source A” and “Source B”
are the locations of the sources. The space below these values will automatically show the value
that is located at the specified address. The process of setting the location value is similar to that
of naming all of the other inputs and outputs, the same selection menu will appear when the
down arrow symbol is selected. The process of creating and naming these values will be
explained in more detail in the Procedure section.

Prompt 1: A large container is used to mix a product. The product will be emptied into to a large
container that will stir the mixture for 10 seconds. Before the process begins, Valve C will open
to release any material that is in the container. The contents are detected by Sensor 1. Then,

Page | 59
Valve A will open and remain open until the Mixer has been running for 5 seconds. The Mixer is
activated when Sensor 2 is activated. The process should be repeated until the Stop button is
pressed.

Figure 7 – 1
Procedure:

1. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
2. Once the code has been written compare that program to the one that is shown below in
Figure 7 – 2.

Page | 60
Figure 7 – 2
3. Open Studio 5000 and name the required input and output addresses that are needed for
this program. Next, create the required software tags for each of the states and the EN.
Then, create the counter that is needed for this program.
4. In the monitor tags menu create the specified value that will be used to compare the
accumulated value of the counter to. Remember, this tag should be an INT data type.
Refer to Lab 5 for specific instructions on how to create this type of tag.
5. Start creating this program until the state containing the comparison instruction is
reached.
6. Drag the specified comparison instruction to the designated rung. Select the value that
will be monitored for Source A, which for this program is the accumulated value of
Timer 1. Then, select the value that the accumulated value will be compared to for

Page | 61
Source B, which will be the INT tag that was created. The process for creating this
instruction can be seen in Figure 7 – 3.

Figure 7 – 3
7. Finish creating the rest of the program and then connect the sensors and buttons that are
needed to run this program.
8. Turn on the rack and make the needed communication connections. Download and run
the program by activating the buttons and sensors the required amount of times. Monitor
the process, make sure to note how the comparison function interacts with the code.

Page | 62
Evaluation and Review Questions:

1. What are comparison instructions? What are they used for?

2. List the six different types of comparison instructions that were mentioned at the
beginning of this handout.

3. What are the three different sources of information that can be used for these functions?

4. Explain the purpose of Source A. Explain the purpose of Source B. How are these
locations determined?

5. Describe how the comparison function affected the program that was created based on
Prompt 1.

Page | 63
Further Investigation: Using the information provided at the beginning of this handout, and the
knowledge gained from completing Prompt 1, create a ladder logic program based on Prompt 2.
The program should first be written on the template located at the end of this section, and then
created in Studio 5000. The program should then be ran using the racks located at the stations.

Prompt 2: A container is used to mix two different products. One product is supplied by a valve
and the other is supplied by the conveyor belt. The tank should be emptied using Valve C before
the process begins. Once the tank is completely empty, Valve A will open and remain open until
Sensor 2 is activated. Next, the Mixer will turn on and run for five seconds. Then, the conveyor
will turn on and drop three products into the container. Once the required amounts of products
are in the container Valve A will turn on again and remain on for eight seconds while the Mixer
runs a second time. The process can be seen below in Figure 7 – 4.

Figure 7 – 4

Page | 64
Prompt 1

Page | 65
Prompt 2

Page | 66
Lab Exercise 8
PowerFlex: Motor Direction
Objectives:
After the completion of this exercise students will:
1. Know how to make the connections needed to control the direction of a motor using the
PowerFlex.
2. Know how to change the direction of a motor using a ladder logic program.
Materials:
 2 Sensors
 2 Buttons
 10 Long Pieces of Stranded Wire – Both Ends Must be Stripped
 Student Tool Kit
 PowerFlex 520 Quick Start Manual
 Voltage Output Analog Module Manual
Description:
An AC Driver can be used to control many different characteristics of a motor. In a
previous lab (Lab 5), the process of connecting the PowerFlex and Analog Module to control
when the motor would run, as well as at what speed, was explained. An additional characteristic
that can be controlled by the PowerFlex is the direction in which the motor turns. The two
different directions in which the motor can operate are Forward and Reverse. To control this
features, a connection must be made from the “Reverse” Port of the PowerFlex to a Digital
Output terminal. The diagram shown in Figure 8 – 1 below, which is also featured in Lab 5,
shows the layout of the different ports on the PowerFlex.

Figure 8 – 1

Page | 67
The communication between PLC and the PowerFlex will be made through the analog
connections that was described in Lab 5. The same connections that were used to establish this
communication method must be reestablished for this lab. The “DIR-RUN REV” is the only new
connection that must be made. A chart will be provided in the Procedure section detailing all of
the connections that must be made to complete this lab.

Another new concept for this lab will be to monitor the current speed of the motor in
Studio 5000. Then, the value that is obtained will then be used in various instructions to
accomplish designated tasks. To obtain this information one of the external modules connected
to the PLC found on the racks at the student workstations. The module that will be used to
accomplish this task is Module 5, which is the Analog Input Module 1734 – IE2C. The
connection diagram for this module can be seen below in Figure 8 – 2, which was taken from the
instruction manual for this module.

Figure 8 – 2

For this lab, only one of the ports located on the module will be utilized, which is Port 0. This
port will be connected to Port 16, which is the Analog Output of the PowerFlex. By creating this
connection, the current speed of the motor will be stored in Channel 0 of Module 5. The process
of making this connection and obtaining the data will be discussed in the Procedure section.

Page | 68
Prompt 1: A large container is used to mix two different products that come from Valve A and
Valve B. First, Valve A will open and remain open for 5 seconds. Next, the Motor will run in the
Forward Direction for 15 seconds at 30 Hz. Then, Valve B will open for 5 seconds. Once Valve
B has closed, and the Motor’s current speed is less then 5 Hz, the Motor will run in the Reverse
Direction at 60 Hz for 15 seconds. Lastly, Valve C will open and remain so for 5 seconds to
empty the tank. The process should continue until the Stop button is pressed. The process can be
seen below in Figure 8 – 3.

Figure 8 – 3
Procedure:

1. In the designated ladder logic template that is provided, write the corresponding code for
the prompt shown above.
2. Once the code has been written compare that program to the one that is shown below in
Figure 8 – 4.

Page | 69
Figure 8 – 4
Page | 70
3. Open Studio 500 and create a new project. Name all of the physical Input and Output
Addresses that will be used for this program. Remember that the Forward Direction,
Reverse Direction, and Motor Stop will all have physical addresses.
4. Create the software tags that will be used for this code, these include the States and EN.
A software tag for the Motor and Motor Direction will be created, they will be used to
control the actual function of the physical motor. Remember to create software tags with
the INT data type for the each of the different speeds of the motor and the minimum limit
that will be used in the comparison function.
5. Based on the information given in Table 8 – 1, and the knowledge gained in Lab 5, make
the connections needed to establish analog communication between the PLC and the
PowerFlex. The fifth entry in the table depicts the connection that will be used to control
the reverse direction of the motor.
Table 8 – 1
Location 1 Location 2
Analog Output Module Port 0 PowerFlex Port 13
Analog Output Module Port 4 PowerFlex Port 14
PowerFlex Port 01 Digital Output “Local 1:O: Data 0”
PowerFlex Port 02 Digital Output “Local 1:O: Data 1”
PowerFlex Port 03 Digital Output “Local 1: O: Data 2”
Connect to Any Common (-24 V) of
PowerFlex Port 04
Digital Output that is not in use

6. Take a piece of wire and make the connection between Port 15 of the PowerFlex and Port
0 of the Analog Input Module.
7. Set the “High Engineering Value” for the motor to the maximum speed using the
“Configuration” tab that is found when selecting “Module 4”. (See Lab 5 for screenshots
and specific directions.)
8. Create the ladder logic program in the “Main Routine”. Remember to send the speed
information to Channel 0 of Module 4 using Move functions.
9. Create a comparison instruction that will compare the current speed of the motor to the
minimum specified limit. The current speed source can be found by pressing “+” by
“Local: 5: I”. From the options that appear select “Local: 5: I: Ch0Data”. The process can
be seen below in Figure 8 – 5.

Page | 71
Figure 8 – 5
10. Open RSLinx Classic and turn on the rack at the student work station. Make the
connections needed to establish communication and then run the program. Observe which
direction the motor is turning in during different stages of the program.

Evaluation and Review Questions:

1. What ports of the PowerFlex are needed to control the direction of the motor?

2. What is the purpose of Module 5? What is the model name and serial number?

3. What ports from that module are used in this program? What is the purpose of each of
those ports and what do each of them control?

Page | 72
4. Change the Preset value for the timer that is used to control the motor at 60 Hz to 10
seconds. Run the program again and monitor the speed that is displayed on the
PowerFlex screen. Does the speed reach 60 Hz? Why or why not?

5. Change the Preset value for the timer that controls Valve B, decrease the time to 1
second. Monitor the comparison function that is being executed. Does changing this timer
affect the comparison function?

Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A large container is used to combine three different products. For this process the
tank must be checked using Sensor 1 to determine if the tank is empty. If Sensor 1 is activated,
open Valve C before the rest of the process starts. The process consists of opening Valve A until
Sensor 2 is activated and then activating Valve B for 5 seconds. Once the timer is complete, run
the motor for 20 seconds in the Reverse Direction at 50 Hz. Next, run the Conveyor for 4
products. Lastly, run the mixer, when the speed is less than 5 Hz, for 10 second at 25 Hz in the
Forward Direction. The entire process should be repeated 3 times. The process can be seen
below in Figure 8 – 6.
Page | 73
Figure 8 – 6

Page | 74
Prompt 1

Page | 75
Prompt 2

Page | 76
Lab Exercise 9
Arithmetic Functions Part 1: Addition and Subtraction
Objectives:
After the completion of this exercise students will:

1. Understand the Addition and Subtraction Arithmetic Instructions used for PLCs.
2. Know how to incorporate the Addition and Subtraction Instructions into a ladder logic
program.

Materials:
 2 Sensors
 2 Buttons
 Student Tool Kit
Description:
Another common set of instructions that are used in ladder logic programs are
Arithmetic or Math instructions. There are four commonly used instructions that come from this
category, these include Addition, Subtraction, Multiplication and Division instructions. Over the
course of the next two labs, all four of these instructions will be explained in detail and example
programs that utilize them will be included. The main focus of this lab is Addition and
Subtraction instructions.

The basic concept behind these functions is very simple, they are just basic math
operations. The first instruction is Addition, which will take the value that is found at Source A
and add it to Source B. The sum of these two values is then stored in a specified location. The
second instruction is Subtraction, which takes the value that is detected at Source B and subtracts
it from Source A. The difference is then stored in a specified location. A variety of different
types of sources can be used in these functions. Some examples include fixed values that are
created using INT tags, accumulated values from counters, and values obtained from various
outputs that are connected to the system. The symbol for the Addition (ADD) Instruction can be
seen in Figure 9 – 1 and the symbol for the Subtraction Instruction can be seen in Figure 9 – 2.

Page | 77
Figure 9 – 1 Figure 9 – 2

Using these instructions in Studio 5000 is different the previous instructions that have
been discussed throughout this course. One of the major differences is that a tag with the same
Data Type as the instructions, such as Addition, does not have to be created. To create these
functions in a program, the symbol is added to the desired location in the code. Another major
difference is that a specific location must be created where the result of this instruction will be
stored. A tag must be created that will be used for the Destination, the Data Type of this tag must
be INT. When utilizing these instructions, they are treated like an output and they should be
located on the right side of the rung. Also, the values for the different Sources can be seen in the
instruction symbol below their corresponding location.

Prompt 1: Two chutes drop products on a constantly moving conveyor belt. First, Chute A
opens for 10 seconds, where Sensor 1 is used to count the number of products that are dropped.
Then, after 15 seconds, Chute 2 will open and remain open for 5 seconds, where Sensor B counts
the number of products dropped. The process should only be completed once and will stop when
the total number of products located on the conveyor belt is Less Than 10 products. The process
can be seen below in Figure 9 – 3.

Figure 9 – 3
Procedure:

1. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
2. Once the code has been written compare that program to the one that is shown below in
Figure 9 – 4.
Page | 78
Figure 9 – 4
Page | 79
3. Open Studio 5000 and create a New Project. Create all of the tags that will be needed for
this program. Remember to create a tag with a Data Type of INT to use with the math
instruction for this process.
4. Go to the “Main Routine” and start to create the program based on Figure 9 – 4. When
creating the Add instruction, the process of selecting the source is the same as selecting
the values for the Comparison and Move instructions that were discussed in past labs. Set
the Destination Source the same way, except remember that it must be an exact location.
The process of creating this instruction can be seen in Figure 9 – 5.

Figure 9 – 5

5. Finish creating the rest of the program and then connect the sensors and buttons that are
needed to run this program.
6. Turn on the rack and make the needed communication connections. Download and run
the program by activating the buttons and sensors the required amount of times. Examine
how the Add instruction and the Comparison function affect the overall code.

Evaluation and Review Questions:

1. What are the two math instructions that are the main focus of this lab? Explain the
purpose and function of each.

Page | 80
2. What are the two main differences between these Math Instructions and other instructions
that have been introduced in past labs?

3. What are some scenarios or real-world applications that could use Add or Subtract
Instructions?

4. Change the Preset value of one of the timers to a smaller value. Once that value is
reached, what happens to the values of the Add instruction.

5. What data type is used for the Destination Source for Prompt 1? When selecting the
sources, individuals need to examine their possible values. Why would this be important?
Which function would be affected the most by the selection of the source? Why?

Page | 81
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A forked conveyor with a swing divider is used to separate products. The process
consists of boxes moving on a conveyor belt. The main conveyor belt, Conveyor A, will run for
20 seconds. Then, the Swing Divider and Conveyor B will be activated for 5 seconds. Conveyor
A will run continuously even when the Swing Divider is open, in order to bring the products to
Conveyor B. Sensor 1 is located at the beginning of Conveyor A to count the total number of
products that are being processed. Sensor 2 is used to count the number of boxes that enter
Conveyor B. The number of products that are on Conveyor B are subtracted from the total
number of products. The process should continue until the number of products that exit
Conveyor A is less than 15 products. The process can be seen below in Figure 9 – 6.

Figure 9 – 6

Page | 82
Prompt 1

Page | 83
Prompt 2

Page | 84
Lab Exercise 10
Arithmetic Functions Part 2: Multiplication and Division
Objectives:
After the completion of this exercise students will:

1. Understand the purpose of the Multiplication and Division Instructions.


2. Know how to utilize these instructions in a ladder logic program.

Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
The previous lab introduced the concept of Math Instructions and focused on introducing
the Addition and Subtraction Functions. The focus of this lab is on two additional Arithmetic
Instructions, which are the Multiplication and Division instructions. These two functions are
used in many different tasks throughout inducstry, such as determining the total number of
products when a specific amount is found in each box or to convert a value from one unit of
measurement to another. The first function, Multiplication (MUL), is used to multiply the values
that are located at two different sources and stored the product at a designated location. The
second function is Division (DIV), which takes the value that is found at Source A and divided it
by the value found at Source B. The quotient of that expression is stored at the designated
location that is specified by the instruction. The MUL instruction symbol can be seen in Figure
10 – 1 and the DIV instruction symbol can be found in Figure 10 – 2.

Figure 10 – 1 Figure 10 – 2

Page | 85
The process of creating these two arithmetic functions is the same as creating the ADD
and SUB operations. The process of creating one of these two symbols will be explained in detail
in the Procedure section of this report. These instructions are also treated like outputs and must
be located on the right side of the rung. When creating these functions, it is important to
remember that a destination must be created where the answer to the instruction can be stored,
this location is typically an INT tag that is created in the Controller Tags menu. The order in
which the sources are selected does not matter for the MUL function, however when creating a
DIV instruction remember that the value in Source A, the dividend, will be divided by Source B
the divisor.

Prompt 1: Products are deposited on a conveyor belt from a chute, the products are then moved
under a cutting machine where they will be cut into three pieces. The process starts with the
Conveyor moving, once the tray is in the correct position, Sensor 1 will activate, and Chute A
will open. Sensor 2 will activate when the product lands on the tray, then the Conveyor will run
for 10 seconds. After the required amount of time, the Conveyor will stop. When the product is
below the Cutter, Sensor 3 will activate, and the Cutter will turn on. The process will repeat until
a total of 12 products are created. The process can be seen below in Figure 10 – 3.

Figure 10 – 3
Procedure:

1. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.
2. Once the code has been written compare that program to the one that is shown below in
Figure 10 – 4.

Page | 86
Page | 87
Figure 10 – 4
3. Open Studio 5000 and create a New Project. Create all of the tags that will be needed for
this program. Remember to create a tag with a data type of INT to use for the math
instruction for this process.
4. Create the ladder logic program seen in Figure 10 – 4 in the “Main Routine”. Once the
math instruction has been reached, select the specified locations for Source A and Source
B. Then, set the “Destination” as the specific tag was created. The process of creating this
instruction can be seen below in Figure 10 – 5.

Figure 10 – 5
5. Finish creating the rest of the program based on the example provided.
6. Connect the required buttons and sensors needed for this prompt. Make the connections
required and download the program to the PLC rack. Activate the peripherals whenever
the code requires and watch how the MUL function interacts with the code.

Page | 88
Evaluation and Review Questions:

1. What were the two main Math Instructions that were the focus of this lab? Explain the
purpose and function of each.

2. Does the order of the sources matter for the execution of these instructions?

3. Lower the Preset value of the Counter. What happens to the program when the Preset
value is reached?

4. Leave the Preset value unchanged and remove the Reset. What happens to the program?
How does this differ from the previous scenario?

5. What are some possible real-world applications for Multiplication and Division
Instructions? Describe three scenarios below.

Page | 89
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A process is used to fill bottles and deposit them into boxes. A large container is used
to mix the contents that will be deposited into the bottles. The mixing process is conducted first,
where Valve A will open for 5 seconds and then Valve B will open for 7 seconds. The Mixer will
then turn on and remain on for 10 seconds. The contents of the tank will then be emptied into
three bottles on the conveyor belt. The Conveyor will turn on for 10 seconds after the three
bottles are filled. Sensor 1 will be used to determine when the bottle is in place and Sensor 2 will
be used to determine the fill level of the bottle. Sensor 3 will be used to count the number of
bottles that are filled. Each box contains four bottles and a total of 12 box are needed. The
process will continue until the required number of boxes is met. The process can be seen below
in Figure 10 – 6.

Figure 10 – 6

Page | 90
Prompt 1

Page | 91
Prompt 2

Page | 92
Lab Exercise 11
Ethernet and SCADA Systems
Objectives:
After the completion of this exercise students will:

1. Have a basic understanding of the concept of SCADA systems.


2. Understand the benefits of utilizing Ethernet and Scada Systems in industry.
3. Know how to control the PowerFlex using Ethernet connections.

Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
During previous labs students have established and used analog communications to send
commands to the PowerFlex. When utilizing this communication method, a minimum of eight
wires was needed to transfer all the needed information. As students have experienced in the past
few labs, using all of these wire, even for short distances, can cause lots of issues. Some common
issues are tangled wires, lack of space, loose connections and even wrong connections. All of
these problems can cause issues when just one device is utilizing analog communication, many
companies and processes will use multiple devices. Due to the factors and problems listed above,
analog communication is not a practical means of communication for these devices in industry.
A method that is commonly used to replace this method is the use of Ethernet cables. One cable
can be used to transfer all of the data, as well as many other factors, from the device to a
specified location.

Many processes in industry utilize multiple devices, just like the racks constructed at your
workstation. One of the pieces of equipment that is located on the rack is an Ethernet Switch,
which contains different ports. An Ethernet cable is ran to the PowerFlex, PLC, Panel View and
the PC located at each station. Through this network that is established, all of the devices that are
connected to system can be accessed and monitored. The PLC is commonly used to control
different processes, but it can also be used to monitor a system and collect data. One of the main
tools that is used to accomplish this task is a Supervisory Control and Data Acquisition
Page | 93
(SCADA) system. Many different SCADA software exist that allows users to monitor the
devices on a system and obtain process data and capabilities.

The main focus of this lab is to transfer data commands to the PowerFlex using the
Ethernet connection that has already be established at the station. All of the equipment and PCs
located in the lab have designated IP addresses that are printed on a label that is located on each
piece of equipment. The IP addresses were assigned so that the last digit/digits located in the
address were in chronological order, starting with the PowerFlex and moving to the right. When
establishing the Ethernet connection in Studio 5000, individuals will be required to know the IP
address of the PowerFlex. The process of creating this connection is similar to the process that is
used to create the modules each time a new program is created. The process of establishing this
connection will be explained step by step in the Procedure section of this handout.

Prompt 1: A large tank is used to fill bottles located on a conveyor belt. A sensor, Sensor 1, is
used to detect when a bottle that is located under Valve A. A second sensor, Sensor 2 is used to
detect when the bottle is full. Once the bottle is full, the Conveyor will run until another bottle is
in position. For this scenario the motor will be used to represent the conveyor and it will operate
at a speed of 30 Hz. The process should repeat until the Stop button is pressed. The process can
be seen below in Figure 11 – 1.

Figure 11 – 1
Procedure:

1. In one of the ladder logic templates that is provided, write the corresponding code for this
prompt.

Page | 94
2. Once the code has been written compare that program to the one that is shown below in
Figure 11 – 4.

Figure 11 – 4
3. Disconnect all of the wires that are used to connect the PowerFlex to the Analog Input,
Analog Output, and the PLC Digital Outputs. Make sure that the Ethernet cable that is
connected to the front of the PowerFlex is connected to the Ethernet Switch on the rack.
4. Open Studio 5000 and create a “New Project”. Name the physical inputs and outputs, as
well as create the software tags that will be used. Remember that Motor should be a
software tag. The speed values when communicating through ethernet are in kHz, so the
specified value needs to be multiplied by 1,000.

Page | 95
5. Go to the menu on the left of the screen, and right click on the “Ethernet” option at the
bottom of the list. From the pop-up list that appears select the “New Module” option. A
new window will appear, similar to the menu used to add the external modules. In the
search bar type “PowerFlex”, and from the options that appear select the option that has
Embedded Ethernet. In the pop – up window that appears, type the name of the device
and the IP address that can be found on the front of the PowerFlex, select “OK”. The
process can be seen below in Figure 11 – 5.

Figure 11 – 5
6. Create the ladder logic program based on the code provided in the previous steps. Once
the move command has been reached, select “PowerFlex:O.FreqCommand” for the
destination. For the last line of the code the same process that is used to name all inputs
and output will be used to select “PowerFlex:O. Start” and ““PowerFlex:O. Stop”. These
specific options can be found selecting the “+” by the “PowerFlex” option of the menu
that appears when naming instructions.
7. Connect the required buttons and sensors needed for this lab. Turn on the rack located at
the workstation.
8. Make the connections needed in order to establish communication between the rack and
the PC located at the student workstation. Activate the specified buttons and sensors at
designated points in the program and observe the overall process.

Page | 96
Evaluation and Review Questions:

1. What is a SCADA system? What is it used for?

2. What are some of the benefits of using Ethernet communication instead of analog
connections?

3. From your experience completing both the Analog and Ethernet Labs, which
communication method was easier? Why?

4. How are the IP addresses for this laboratory organized? Which four pieces of equipment
on the rack have an IP address? Where can this value be found? What are the addresses
of the equipment located on the rack?

5. Change the speed of the motor, by changing the Source A value of the Move Function.
Decrease the value to 300, what happens to the motor.

Page | 97
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A large container is used to mix three different products. The container should be
emptied for 5 seconds before the overall process begins. First, Valve A will open until Sensor 1
is activated. Then Valve B will open and remain open until Sensor 2 is activated. The mixer is
then turned on for 15 seconds at a speed of 25 Hz. Then a conveyor turns on and operates at a
speed of 30 Hz until a total of three products have been deposited. Lastly, the Mixer turns on and
operates for 20 seconds at a speed of 60 Hz in the reverse direction. The motor will be used to
represent both the Conveyor and the Mixer for this scenario. The process should be completed
until the Stop button is pressed and the entire process can be seen below in Figure 11 – 6.

Figure 11 – 6

Page | 98
Prompt 1

Page | 99
Prompt 2

Page | 100
Lab Exercise 12
Final Project
Objectives:
After the completion of this exercise students will:

1. Know how to create a ladder logic for a complex system.

Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
Description:
The final project for this class will consists of utilizing a majority of the different
instructions that were introduced and explained throughout this course. Completing this task will
test the knowledge that students have obtained throughout the class and will help remind them of
concepts that have been introduced in previous labs. The prompt will be provided below, as well
as several tools that students must utilize to complete this project. Students will use the motor to
represent two different pieces, the Conveyor and the Mixer, in the prompt provided. Student can
choose to either use analog or Ethernet communication to send commands to the PowerFlex. The
program must be written using the pages provided at the end of this lab. The program must be
entered and ran using Studio 5000 and the racks located at the student workstations. Students will
have 2 weeks to complete this task and the Professor must see the finished program running on
the student rack.

Prompt: A process is designed to deposit bottles on a Conveyor belt, pour a combined mixture
into each bottle and deposit the products in boxes. First a piston is used to deposit bottles on the
Conveyor. The piston is extended when P1-O1 is activated and takes 5 seconds to fully extend.
The bottle is then place on the Conveyor and the piston is retracted by activating P1-O2 and the
action takes 3 seconds to complete. Once the Piston 1 is retracted, the Conveyor will start and
run at a speed of 30 Hz until Sensor 1 is activated. Valve A will the open and run for 5 seconds
and then the Mixer will run for 15 seconds at 25 Hz. Then Valve B will open for 8 seconds and
then the Mixer will run for 15 seconds at 25 Hz in the reverse direction. Valve C will then open
and fill three bottles until Sensor 2 is activated. The Conveyor will run for 10 seconds at 30 Hz.
Page | 101
Piston 2 is then used to deposit the three bottles into a box. P2-O1 is extended, which takes 4
seconds, then Piston 2 is retracted, P2-O2, which takes 8 seconds. Sensor 3 is used to count the
number of boxes that are completed, a total of 9 products are required before the process can
stop. The process can be seen in Figure 12 – 1.

Required Diagrams and Charts:

Table 12 – 1
State P1-O1 P1-02 CON. A B C MIXER P2-O1 P2-O2

Table 12 – 2
Timer/Counter
Name Preset Value Control/Purpose State Activated

Page | 102
Figure 12 - 1

Page | 103
Required Charts: Main Body

Page | 104
States

Page | 105
Lab Exercise 13
Final Report
Objectives:
After the completion of this exercise students will:

1. Have a greater understanding of the programs they created.


2. Be able to accurately explain the programs that they wrote.

Materials:
 Access to PC at Designated Workstation
 Snipping Tool
Description:
Throughout this course students have competed 12 lab activities up to this point in the
semester. To complete this course students must create a Final Report that contains screenshots
and explanations of specified programs. These reports MUST be completed INDIVIDUALY,
NO GROUP WORK ALLOWED. By completing this report students will be able to gain a
greater understanding of the programs they have created and the specific tasks each rung
performs. The programs that were created in the Further Investigation portion of the following
labs must be included in the Final Report. The labs are:

 Lab 2: Ladd Logic Introduction


 Lab 5: PowerFlex
 Lab 7: Comparison Functions
 Lab 8: Motor Direction
 Lab 9 or Lab 10: Arithmetic Functions
 Final Project

A cover page and table of contents should be included in each report. The report should be
divided into sections, one for each of the labs. The lab number and title should be located on the
first page of each section. All the names of the students who worked in the group to compete the
lab must be included at the top of the page. Each section should contain a screenshot of the entire
program that was created, and each screenshot should be numbered. An example of the naming
format expected for the figures can be seen here: “Figure – 1: Lab 2”. A table should also be
Page | 106
included that shows each state and lists all of the outputs and their current status in each state. An
example of this table can be seen in Table 13 – 1 below. Each table should be named in the same
way as the figures. A summary of the overall process that is being created should be included.
Then, students must explain the program line by line and provide detailed explanation for each.

Table 13 – 1
State 0
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 1
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 2
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 3
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 4
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 5
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 6
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:

Time should be taken during this class period to take screenshots of each specified
program. If one of the specified labs is not completed, try to finish the activity during this
secession. If students cannot complete the lab in the time allotted, permission must be granted by
the professor to substitute the program creates during “Prompt 1” of that specific lab. The
completed report will be due on the Wednesday of Final’s Week.

Page | 107
Lab Exercise 14
Practice Final Exam
Objectives:
After the completion of this exercise students will:
1. Have an understanding of what to expect on the Final Exam.
2. Be able to complete an example prompt, with no specific instructions.
Materials:
 3 Sensors
 2 Buttons
 Student Tool Kit
 PowerFlex Connection Diagram
 Analog Input Connection Diagram
 Analog Output Connection Diagram
Description:
The Final Exam is designed to tests students’ knowledge on some of the key concepts
that were covered throughout this course. Students will be given a prompt similar to the ones that
have been seen in the lab. For the exam students will be provided with a copy of the port diagram
for the PowerFlex, Analog Input Module and Analog Output Module. Students will be expected
to know how to do the following:

1. Connect sensors and buttons correctly to the PLC racks.


2. Establish the connection between the rack and the PC located at the workstation.
3. Create the needed software tags for the program and name the physical components.
4. Write a ladder logic programs that contains XIC and XIO inputs, and OTE outputs.
5. Create and use TON timers and CU counters in a ladder logic program.
6. Create and utilize a Comparison and Move instruction.
7. Create and use an INT data type tag.
8. Communicate with the PowerFlex using the Analog Output and Analog Input External
Modules.
9. Change the speed and direction of a motor using a ladder logic program and the
PowerFlex.
10. How to download and run the created ladder logic program to the PLC.

Page | 108
This lab contains to prompts that are examples of the Final Exam. The first prompt will show
the completed code and have students recreate it and establish the appropriate connects. At the
beginning of this lab all of the buttons, sensors, PowerFlex and Module connections will be
disconnected so students must reconnect them appropriately. The second prompt will have
students write the code and download it to the student work station.

Prompt 1: A large tank is used to mix three different products, coming from three different
locations. The tank must be emptied using Valve C before the process starts. First, Valve A
should open for 5 seconds. Next, Conveyor 1 will run and drop two products into the container
and the Mixer should run for 15 seconds at 30 Hz in the Forward Direction. Then, Conveyor 2
will drop three products into the container. Lastly, the Mixer, if the current speed of the motor is
less than 5 Hz, will run for 20 seconds at 60 Hz in the Reverse Direction. The process should
continue to run until the Stop button is pressed. The process can be seen below in Figure 6 – 1.

Figure 14 – 1

Page | 109
Procedure:

1. Read Prompt 1 and write the ladder logic program in the space provided below.
2. Compare the code that was written to the completed one shown below in Figure 14 – 2
and Figure 14 – 3. Open Studio 5000, create a New Project and write the program.

Figure 14 – 2

Page | 110
Figure 14 – 3

Page | 111
3. Make the required connections needed to establish analog communication between the
PLC and the PowerFlex. Remember that the motor must be able to operate in both
directions and the current speed must be obtained.
4. Connect the required buttons and sensors needed for this program.
5. Establish the connection between the rack and the workstation PC.
6. Download and execute the program.

Evaluation and Review Questions:

1. How many states are in this program? Complete the chart shown below in Table 14 –
1.
Table 14 – 1
State 0
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 1
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 2
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 3
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 4
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 5
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:
State 6
Valve A: Valve C: Conveyor 1: Conveyor 2: Mixer:

2. Explain the purpose of the two Move instructions used in the program. What was the
Source and Destination for each one? Why were those specific options chosen?

Page | 112
3. Explain the purpose of the Comparison Instruction used in this program. What is
being compared? Explain why each source was chosen.

4. Explain the last three lines of the program. What is their purpose? What does each
symbol represent?

5. What are the topics and skills that students are expected to know for the Final Exam?
What resource or references will be provided?

Page | 113
Further Investigation:

Using the information provided at the beginning of this handout, and the knowledge gained from
completing Prompt 1, create a ladder logic program based on Prompt 2. The program should first
be written on the template located at the end of this section, and then created in Studio 5000. The
program should then be ran using the racks located at the stations.

Prompt 2: A tank is used to mix three different products. When the process starts Valve C must
be opened for 10 seconds, to determine that the tank is completely empty. First, Valve A will
open for 8 seconds. Next, the conveyor will drop five products into the tank. Then, Valve B will
open for 10 seconds. The Mixer will run for 15 seconds at 25 Hz in the Reverse Direction. Then
four more products will be dropped into the tank. Lastly, the Mixer, if the current speed of the
motor is less than 5 Hz, will run for 20 seconds at 50 Hz in the Reverse Direction. The process
can be seen below in Figure 14 – 4.

Figure 6 – 3

Page | 114
Prompt 1

Page | 115
Prompt 2

Page | 116

You might also like