0% found this document useful (0 votes)
37 views

Lab 01 - Sealing Vs Latching - 2020

Uploaded by

teamladhub2
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)
37 views

Lab 01 - Sealing Vs Latching - 2020

Uploaded by

teamladhub2
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/ 18

Lab 01 – Sealing vs.

Latching
ELN9207

Objectives:
- To review, understand and use the “Sealing” technique,
- To review, understand and use “Latching” instructions,
- To learn the difference between “sealing” and “latching” and to establish which should be used in
specific practical applications,
- To enter, compile, download, run and debug a ladder logic program,
- To create memory assignments and to assign tags.
Pre-lab: There is no way you can finish this lab on time unless you attend the lectures and invest
at least 2 hours in the pre-lab. Note that labs may not be demoed for marks beyond the
due date specified for your group on the BrightSpace website.
The 5 Lab Marks are assigned as follows:
A BrightSpace test worth 1.5 of the 5 lab marks MUST be done by its due date.
A fully functional demoed program is worth 1 of the 5 lab marks.
A flawless demo presentation is worth 2.5 of the 5 lab marks (see demo requirements on page 13).

There are three parts to this document (this document is hyperlinked):


1- Review of theory - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 2
- Provides a concise explanation of all the theory that you need to complete the lab.
You will not be able to do the lab unless you fully understand this theory.
- This review will provide some of the information you need to write the on-line test.
- Note that you will probably be able to zoom through this if you have been attending
classes and if you already understand all the material. However, you should at least read
about the Basic Tank System (see page 5).
Using a PLC to Replace Hardware Logic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 2
Implementing a Seal Program - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 3
Using XIC (Examine-If-Closed) Instructions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 3
Power Failure with a Seal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 4
Implementing a Latch - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 5
The Basic Tank System - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 5
Using XIO (Examine-if-Open) Instructions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 5

2- The Lab Assignment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 7


A pre-lab test (worth 30% of the lab mark) must be completed before your Lab START date.
In order to finish your lab on time, examine the requirements of the practical design BEFORE
going to the lab. It may take you a while before you figure out how the program works. It is
necessary that you thoroughly understand how the practical tank control program works to get
good marks on your demo.
You must understand some of the material explained in this section to write the on-line test.
Using a Qualifier - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 8
Entering a Ladder Logic Program - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 8
Using Tags - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 9
Creating and Managing Tags - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 9
Testing the Program - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 10
Creating a Memory Tag - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 11
Demo Requirements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 12

3- Additional Practice Questions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 14

Page 1 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Review of the Theory


Sealing (sometimes called “Seal-in”) and Latching operations are used to remember that an event has
already happened. The PLC memory is used to implement the memorization. It is important to note that it
is your program running on the PLC that decides which technique, Sealing or Latching, will be used.
Typical and common applications include:
- Remembering that a momentary-contact switch has already been closed (or opened) at least once.
- Allowing the system to remember that some process event has already happened.
Example: An empty box has already been positioned on a conveyor belt.
- Making it possible for the system to remember/forget the system states when power is lost.
L1 N
As an example of the sealing technique, you have certainly
been exposed to the important electro-mechanical circuit
shown at right. S top S tart
M OVL

As you know, this hardware circuit will seal-in the momentary-


contact Start switch. It provides triple protection for M
emergencies (Stop), equipment failure (OVL) or hydro power
failure (seal). It maintains the motor coil M energized until either
the Stop button is pressed, an overload occurs or power is lost.
Using a PLC to Replace Hardware Logic
In the following example, we will show how to reproduce the functionality of the above HARDWARE seal
circuit using a ladder logic SOFTWARE program running on a PLC.
Program instructions will be used to manage inputs and outputs wired to the PLC modules.
- To monitor the state of “input” devices (such as switches or contacts), which are located outside
the PLC, the input device needs to be physically wired to a PLC input module terminal.
- To energize “output” devices (such as coils or lamps), which are located outside the PLC, the
output device needs to be wired to a PLC output module terminal.
Examine the wiring diagram shown at right: P LC system
- The Start and Stop momentary-contact switches L1
In p u t m o d u le O u tp ut m o d ule
N

are wired to two PLC input terminals. term in als term in al


- A motor overload relay (normally-closed
S top
contact) is connected to a third PLC input M
(R ela y c o il)
terminal. S tart
Yo u r P L C p ro g ram
- A motor relay coil is connected to one of the w ill m o n ito r in p u ts
PLC output terminals. OVL
a n d e n e rg ize o u tp u ts

Looking at the wiring shown on the above PLC wiring diagram, we can see that the switches and overload
relay are not directly connected to the motor relay coil.

The functionality, which defines how the system works,


is now controlled by the intervening PLC system...

It is the program running inside the PLC system that decides how the input terminals (Start, Stop and OVL
contact) are used to energize the output terminal (Relay coil M).
IMPORTANT NOTE: The functionality of the system can be altered by changing the program; no need to
change any wiring!!! This is the main reason why programmable logic systems are so popular today.

Page 2 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Implementing a Seal Program OVL


S top S tart M
The ladder logic program shown at right implements
(X IC ) (X IC ) (X IC ) (O E)
a SEAL which reproduces the functionality of the
standard Start/Stop/OVL hardware circuit presented M
above. The following pages examine and explain the (X IC )
technicalities of this very important ladder logic
program.
A Start/Stop/Overload seal is used in almost all industrial applications because it
provides the safety features mandatory in industrial applications.

YOU WILL NEED TO USE THE ABOVE SEALING PROGRAM STRUCTURE IN MOST LABS!
Although the symbols used to represent the ladder logic instructions resemble electrical symbols, THEY
ARE NOT THE SAME THING. Notice that the programming symbols are drawn slightly different from
their electrical symbol counterparts.
IMPORTANT: You must not confuse hardware symbols and ladder logic symbols.

Using XIC (Examine-If-Closed) instructions


The ladder logic software actively detects if a switch is closed by monitoring if electrical current flows at
its corresponding PLC input module terminal. The input module terminals may be configured to sink or to
source current when it is installed. Closing a switch makes current flow to/from the PLC input module
terminal to which it is connected.
PLC Input m odule PLC Input m odule
+ term inal sinking term inal sourcing

C ontact C losed C ontact C losed

An XIC (Examine-If-Closed) instruction becomes TRUE when current flows

The Stop, Start and OVL Examine-If-Closed (XIC) input instructions, shown in the above SEAL program,
will respectively examine the state of the PLC input terminals that are connected to the Stop and Start
momentary-contact switches and to the normally-closed OVL contact. This allows the program to
determine whether these device contacts are in the closed (True) or open (False) state.
Note that from a programming point of view it doesn’t really matter if the input terminal is sourcing or
sinking current; what matter is to detect if the device contact is open or closed.
Contact Closed (input active) Current flows (sourcing or sinking) XIC yields True
Contact Open (input inactive) Current does not flow XIC yields False

You may wonder about the “M” XIC instruction which is a used to seal the OE (Output-Energize)
instruction… No input terminal is actually associated with that XIC instructions so, exactly what condition
is this XIC instruction examining? Since the tag name M of this XIC instruction is the same as that of the OE
instruction, the XIC instruction will be examining the state of the OE instruction. An XIC instruction may
also be looked at as checking if something is True or False (XIC = examine if True). Consequently, when
the OE becomes True, the sealing XIC instruction will also become True. The XIC instruction is therefore
not limited to testing only module inputs! It may be used to test any Boolean that can be True or False (and
this includes memory bits).

Page 3 of 18
Lab 01 – Sealing vs. Latching
ELN9207

How the Seal Program Works


Let’s analyze what happens when we run the program for the seal program.
1- The Stop switch and OVL contact are normally-
S top S tart OVL M
closed contacts (making both their respective XIC
instructions True).
(True) (False) (True) (False)
The Start switch is normally-open (making its XIC
instruction False). M
The OE instruction is False because there is no
continuous true path leading to it. (False)

The M XIC instruction (associated with the OE S top S tart OVL M


instruction) is consequently also False.
(True) (True) (True) (True)
2- When somebody actually closes the Start
momentary-contact switch, the Start XIC M
instruction becomes True. This establishes a
(True)
continuous True path leading to the OE instruction.
Since OE is now True, this also makes the M XIC S top S tart OVL M
instruction True which seals-in the start condition.
(True) (False) (True) (True)
3- When the Start switch is released the Start XIC
M
instruction becomes False but, the True M XIC
instruction maintains a continuous true path to the
(True)
OE instruction.
4- Pressing the normally-closed Stop switch or opening the OVL contact would break the continuous True
path which would make the OE instruction go back to False.
This would break the seal (the M XIC instruction becomes False) which would bring us back to step 1.
Power Failure with a Seal
At this point it is important to ask yourself what happens if power is lost when the Start condition is
already sealed-in by the M XIC instruction… If the system loses power, the OE output would become False
(since the output would no longer be energized). This means that when power is restored, the M XIC
instruction would reflect the False state of the OE and consequently, the sealed-in state would be cleared.
We call this a volatile memory location.
Important conclusion: Memory seals are CLEARED when power fails

In some cases, the fact that a sealed-in condition is cleared by a loss of power may be a GOOD thing:
When power is lost, safety dictates that motor coils must be left de-energized until the Start button is
manually pressed again. Leaving motor coils energized would result in the motor unexpectedly
restarting when power is restored and this would obviously create a safety hazard.
In some cases, the fact that a sealed-in condition is cleared by a loss of power may be a BAD thing:
If a process demands that some past events or steps be remembered then memory must be maintained
during power loss. When persistent memory is used to record events and steps, the system can
resume the process from where it was interrupted when power was lost. Consequently, if we need
persistent memory, the sealing technique should not be used since a power loss would clear these
memory seals.
For example if we need to remember that a bottle has already been filled, we can’t use a seal to memorize
this since a power loss would make the system forget that the bottle has already been filled.

Page 4 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Implementing a Latch
The ladder logic language provides latch-type instructions which are available to maintain memorized
conditions when power is lost. A latch provides one bit of the microcontroller non-volatile memory.

Important: " non-volatile" means that latch states are MAINTAINED even when power fails

L
Programming the latch bit requires two instructions: the “Output Latch” instruction ( ) which, when
true, will “set” the latch bit (1) and the “Output Unlatch” instruction ( U ) which, when true, will
“clear” the latch bit (0).
As an example of a system requiring a latch, consider a system that controls a pump which fills a container
with some liquid. Such a system is shown below. The system includes two float-switch sensors mounted
on the container.
Important: These sensors are of the type that close a contact when the presence of a liquid is detected.
The Basic Tank System
Upper Shown
The Upper sensor detects a full Open PLC system N
Input module Output module
tank condition and the Lower Pump terminals terminals
sensor detects an empty tank
condition indicating that the Lower
Pump Coil
container needs to be filled again. Shown
Closed

The pump should: Solenoid


S actuator
- Automatically start when the liquid Drain valve
goes below the Lower float switch actuated by solenoid
level.
- Automatically stop when the liquid reaches the Upper level.
Once a process starts, the requirement is that the tank system must either complete a filling process or
complete a draining process. Consequently the following behaviour must be implemented:
1. Once the pump starts pumping, it must keep pumping until the Upper float switch closes because the
filling process must complete so that a full tank of liquid may be used.
2. If power fails in the middle of a fill operation, the system must remember that the tank was filling so
that filling the tank may be resumed when power is restored.
3. Similarly if power fails when the tank was draining, the system must remember that the tank was
draining so that it may continue draining the contents once power is restored.
Using XIO (Examine-If-Open) instructions
The ladder logic programming software provides an XIO instruction to detect if a switch is open. It does
this by monitoring that no current is flowing at the PLC input module terminals (input is inactive).
(see the description of current flow)
An XIO (Examine-If-Open) instruction becomes TRUE when no current flows

The XIO instruction therefore provides the reverse logic of the XIC instruction (the XIO instruction
becomes True when a contact is NOT closed).
The following ladder logic program will control the operation of the pump in the above tank system.

Page 5 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Step 1 At the beginning, the tank is full and therefore both Pump
Lower
float switches are closed (current flows). False Step 1
L
- The Lower XIO (Examine-If-Open) instruction is False. Latch is
- The Upper XIC (Examine-If-Closed) instruction is True. Upper Pump cleared
True
U
In this case, the Unlatch ( U ) instruction is True which
clears the Latch bit (0). The Pump coil is de-energized.
Note: Assume that something automatically actuates the Lower Pump
drain solenoid once the tank is full. False Step 2
L
Latch stays
Step 2 When the tank begins draining, the upper float switch cleared
opens and this results in the following: Upper Pump
False
- The Upper XIC (Examine-If-Closed) instruction becomes U
False (and the Lower XIO instruction remains False).
However, since the latch is a non-volatile bit of memory, it
remembers that it is in the unlatched state (0) and the Pump
coil remains de-energized.
Step 3 When the liquid level becomes too low, the Lower Pump
True Step 3
Lower sensor becomes inactive (it opens). L
- The Lower XIO instruction then becomes True. Latch
Upper Pump is set
The Latch ( L ) instruction is therefore driven True and False
U
the latch bit becomes set (1) to energize the pump coil.
Note: Assume that something automatically de-energises the
drain solenoid once the tank reaches the Lower level.
Step 4 When the tank starts filling, the Lower sensor will Lower Pump
False Step 4
close as soon as the water level rises. L
- The Lower XIO instruction then becomes False. Latch stays
set
However, since the non-volatile latch bit remembers its Upper Pump
False
state, it remains set (1) which keeps the Pump energized. U
Because we’re using a latch, if power fails at this point,
the Pump remains energized when power is eventually
restored.
When the tank eventually becomes full, the Upper float closes and the XIC instruction becomes True. This
activates the unlatch instruction which resets (0) the latch bit and de-energizes the pump coil. This then
brings us back to the beginning of the sequence (Step 1).
Basically the pump latch bit is cleared (False) when the tank becomes full and the latch bit is set (True)
when the Lower sensor opens showing that the tank is empty.
You may be wondering what would happen to the latch state if the sensor conditions were such that both
Latch and Unlatch instructions were True simultaneously due to some sensor malfunction.
Since ladder logic programs are evaluated from top to bottom, the Unlatch would be evaluated last and
would prevail. Therefore the pump would NOT run in the case of such malfunction. The order in which
the instructions are positioned is therefore very important to ensure safe operation if a malfunction occurs.
The designer should keep this in mind when programming latches.

Page 6 of 18
Lab 01 – Sealing vs. Latching
ELN9207

The system that we have described above suffers from three flaws:
1- If the pump overloads there is no mechanism to de-energize the pump to prevent a fire.
2- If a major problem occurs and the system must be shut down, there is no emergency stop button.
3- The system would not pass a safety inspection because the pump may restart unexpectedly if power
fails and is then restored.
Additionally, no mechanism is provided to automatically control the drain valve solenoid so that fill
and drain cycles alternate continuously.

Page 7 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Lab Assignment
To implement an improved basic tank system (see Basic Tank System).
As a minimum, you will need to include pump overload protection, an emergency Stop button and you
must ensure that the pump can’t restart unexpectedly if power fails and is then restored.

The above diagram shows that the following inputs are added to the PLC input module terminals:
- A normally-closed pump-overload contact (PumpOVL) [you will simulate it using a panel switch].
- A normally-closed /momentary-contact Stop pushbutton.
- A normally-open/momentary-contact “Resume” pushbutton to safely:
a) Resume the system operation at the beginning of the workday,
b) Resume the system operation after a pump overload condition has been cleared,
c) Resume the system operation after the emergency Stop has been used,
d) Resume the system operation when power is restored after a power failure.
You are given the following ladder logic program that you must enter into you PLC system (see
instructions below) to implement the tank system.

The latch must be


tagged
to a memory
location

The Activate seal


“qualifies“ the pump
coil operation

Page 8 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Using a Qualifier
Examining the above ladder logic program, you will note that the PumpCoil is no longer driven directly by
the latch. Instead, the latch is now called Filltank and, on the last rung, a FillTank XIC instruction is now
placed in series with the Activate seal to qualify the operation of the PumpCoil OE instruction.
Putting an Activate seal in series with all power coils is a common technique used to add Start/Stop
and/or Overload protection to any output device that can be energized by the PLC

Entering a Ladder Logic Program


The following instructions will help you to enter the above ladder logic program in RSLogix5000.
When you enter a program, the worst thing that you can do is
to enter the whole program and then start testing.

If you enter too much programming before testing, too much functionality needs to be debugged and bugs
in one section will interact with bugs in another section making your debugging very complex and time
consuming.
If you think that you are spending too much time on PLC programming
assignments it is probably because you didn’t understand the above paragraph.

The standard engineering approach is to divide and conquer. Build a small part (usually less than 4 rungs)
and test it. Once that part works, save it; you may then add and test another small part. Keep doing this, a
small part at a time, saving your work under a new name every time a new part is debugged.
Important: When using this approach, bugs will be easy to find since only a small amount of untested
functionality exists.
Once that part works DO NOT MODIFY IT ANYMORE ! ! !
Students often complain that they spend way too many hours working on a lab and it
is unfortunately the direct result of not following the above practice. Be smart and
save yourself time and aggravation. Go through your programming exercises
methodically, a small part at-a-time.

1- Begin with a blank program from the template you saved in Lab 00 and immediately save it as Lab 01.
2- Enter a blank rung by clicking the rung icon ( ).
3- All programs must display your name on the top rung. Right-click the rung on the left side and select
“Edit rung comment” to insert your name.
4- On Rung 1 you need to add a parallel branch.
Select Rung 1 by clicking on it and then click the branch icon ( ) to create a first branch. In order to
create a branch within a branch, drag a second branch icon to the lower part of the first branch.

5- Insert the XIC ( ), XIO ( ) and OE ( ) instructions by dragging the appropriate instruction icon
where required.

Tricks to speed up your programming:


a) You may use CTRL-Z anytime to undo an operation.
b) You may drag any instruction icon to any position on any rung.
c) You may duplicate an instruction icon by Ctrl-dragging it to any position on any rung.
d) You may modify an instruction (XIO <=> XIC) by double-clicking on it.

Page 9 of 18
Lab 01 – Sealing vs. Latching
ELN9207

6- Using Tags
Tags are names that tell the program which memory location is targeted by a particular instruction. All
controllable parts of you PLC correspond to a particular memory location. This includes the input and
output module terminals connected to external sensors and actuators.
- The PLC in the WT228 lab accesses memory locations consisting of 32-bit words. This means that
each memory location gives access to 32-bit words (32 Boolean values that may each be 0 or 1).
- Note that the PLC in the CA119E lab accesses memory consisting of 16-bit words.
The system automatically assigns “base tag” names to identify each input and output module.
For example, the 16 Rockwell panel switches are respectively wired to the 16 terminals on the input
module. These inputs provide 16 bits of information which are available to your program at the
address assigned by the compiler to this input module. The compiler automatically assigns the base
tag name Local:1:I.data to this input module and you can’t change it. Note that the actual memory
address is irrelevant. In the case of a processor that has 32-bit words, the 16 inputs of the I/O module
are mapped to bits 0 through 15 (bits 16 through 31 are simply not used).
Some XIO and XIC instructions in our program are used to check the state of specific panel switches
connected to input terminals. Since the state of each input terminal is mirrored to a specific bit of the
input module base tag (Local:1:I.data), you can refer to a specific bit by appending a number to the input
module base tag. For example Local:1:I.data.3 refers to bit 3 holding the state of panel switch 3.
Local:1:I.data refers to the complete data word (32 bits in WT228 and 16 bits in CA119E)
Local:1:I.data.3 refers to a specific bit in the data word (it is a Boolean that may be True or False)
You will certainly agree that the base tag name that the system uses is rather cryptic. The base tag name
doesn’t describe what the switch is used for. It is preferable to associate cryptic tag name such as
Local:1:I.data.3 to your own alias tag names. An alias tag is a second name which you create to provide
functional information about the memory location.
Example: Local:1:I.data.3 could be assigned the alias name “Upper” to show that it is connected to
the Upper float switch.
Creating alias tags will ensure that your programs can be easily and clearly understood

Each of your inputs and output terminals must be assigned a representative alias tag.
Do not use base tags in your program.
Alias tags are necessary to make your programs easy to understand.

Creating and Managing Tags


To define, edit or monitor tag names double-click the “Program Tags”
item located just above the MainRoutine item in the project tree.

This window is useful to enter all the program tags for a new lab.
You will also need to use the Program Tags window when you
migrate a program to and from labs CA119 and WT228.
All base tags aliases need to be re-assigned when changing labs because the I/O modules
are different and because the switch configuration and availability is different.
Notes: - The actual base tag names (such as Local:1:I.data) are assigned by the compiler and may not
be changed.

Page 10 of 18
Lab 01 – Sealing vs. Latching
ELN9207

- You can have more than one alias name for a specific base tag. However, it would make
absolutely no sense to have two different base tags assigned to the same alias tag name. This
would generate a program error.

To create or edit a tag ensure that the “Edit


Tags” tab is selected.
To create an alias tag name, click on the blank
white box under the “Name” column.
Type your alias name (Stop in this example).
Press “Tab” or click on the corresponding “Alias for” box
(located immediately to the right). This box allows you to tell
the program which specific base tag will be associated with
your alias name “Stop”.
Notes: The WT228 system only has one stop switch
assigned base tag Local:1:I.data.0
The CA119 system has three stop switches
respectively assigned base tags Local:1:I.data.8,
Local:1:I.data.9 and Local:1:I.data.10
Following the above procedure and referring to the table CA119 WT228
shown at right, create the alias tag names for the tank input Stop Switch 8 Switch 0
signals: Stop, Resume, Lower, Upper and PumpOVL. Resume Switch 11 Switch 1
Similarly, create an alias tag name for the “PumpCoil Upper Switch 6 Switch 3
which will be associated with panel light 0. Lower Switch 14 Switch 7
(Alias) PumpCoil  Local:2:O.data.0 (base tag) PumpOVL Switch 0 Switch 4
Once your alias tag names have been declared, go back to the MainRoutine window to assign them to
your instructions on Rung 1 (XIC and OE). To assign a tag, double-click the question mark (?) above
the instruction icon, click on the down arrow and select the appropriate alias tag.
For example, double-click the XIC instruction associated with the Stop switch. Click on the down arrow
to reveal the available tags and select the “Stop” tag (you may have to scroll to find it).

7- Testing the Program


At this point do not program more. You are ready to test the functionality of Rung 1 in your program.
You may verify your program for errors by clicking the “Verify Routine” icon located on the
toolbar. When you do this, pay attention to the bottom of the screen where relevant messages are
displayed.
Click on “Download” to send your error-free program to the PLC processor.
You will probably be asked if you want to change the mode to “Remote Run”. Accept this to run your
program.
IMPORTANT: If you are not asked to “Remote Run” you will have to manually put the
processor in “Run Mode” to begin running your program.

Test the functionality of Rung 1. Ensure that it does what you think it should do. Use a logical
combination of switches for Resume, Stop and PumpOvl to see what happens to the Activate seal. It is
important that you test all cases that could happen in reality.

Page 11 of 18
Lab 01 – Sealing vs. Latching
ELN9207

For example, the system should begin operation with both the Stop switch and PumpOvl contact closed;
the Resume switch should be open. The next logical step would be to close the Resume switch to see
what will happen.
Some combinations would not happen in a real system. For example, if the Activate seal is not
energized, the pump can’t be running and therefore the PumpOvl contact can’t trip open since the pump
motor can’t overload (it is not energized).
Once you are certain that Rung 1 is operating as predicted, save the program under a new name (such
as Lab01a).
8- Once Rung 1 has been debugged, insert Rungs 2 & 3 (for the complete latch section) and the
corresponding instructions. You can immediately tag the Lower ( ) and Upper ( ) instructions but,
the Latch and Unlatch instructions will require an internal memory tag as explained in step 9.
9- The following procedure explains how to assign tags to processor internal memory locations which are
not related to an I/O module.
Creating a Memory Tag
The latch instructions require the implementation of the FillTank tag. This tag needs to refer to a PLC
memory location which will be used to implement the latch. A latch requires a Boolean element which
can adopt the state of 1 (set) or 0 (reset). The PLC is equipped with a large amount of internal memory
which you can use to store values. One of these many memory locations may be used to implement the
“FillTank” tag. You need to reserve a specific memory location and either declare that memory location
to behave as a single Boolean (uses up all the bits in the word) or use only one bit of that memory
location as explained below.
Open the “Logic/Edit Tags” menu. In the white blank box at the bottom left of the window, reserve a
memory location by typing the alias name FillTank and press Enter. This reserves one word of memory
which defaults as a DINT data type which represents a numerical value. We need to change this since
the latch requires a Boolean type. There are two ways of getting a Boolean:
a) The simplest way is to change the DINT data type to “Boolean” so that the whole word is limited to
assuming the values 0 or 1. To do this, double-click the DINT and change it to BOOL.
b) If you don’t want to “waste” all the bits in the memory word, there is an optional alternative to a).
Create a DINT alias name (LatchMemory) which gives you access to the numerous bits making up
that memory word.
Go back to your FillTank “Alias” and make it an Alias for one of the bits in the LatchMemory word.
You can do this by selecting LatchMemory and expanding it to select one of the available bits. For
example: LatchMemory.0
(this would leave the other bits of the LatchMemory word to be used by other latches if any).
You may now go back to the MainRoutine window and assign your new FillTank tag to the
Latch L
and Unlatch U program instructions.
Either: a) A FillTank alias referring to a Boolean memory location (simple and preferred approach)
b) A FillTank alias referring to a specific bit in a DINT memory word: LatchMemory.0
Please understand that the Latch and Unlatch instructions are both tagged to the same FillTank alias.
The Latch instruction is used to set the FillTank Boolean value to “1” and the Unlatch instruction is
used to reset that same FillTank Boolean to “0”.
Important note: In future labs you will need to associate such Boolean memory tags with OE
instructions that are not associated with output terminals. This will allow you to
create “flags” that may be used to remember that certain steps have already been
taken.
Page 12 of 18
Lab 01 – Sealing vs. Latching
ELN9207

10- At this point you are ready to test the functionality of Rungs 2 & 3 in your program.
Remember that you should verify your program for errors by clicking the “Verify Routine”
icon located on the toolbar.
Click on “Download” to send your error-free program to the PLC processor and run the program.
Test the functionality of Rungs 2 & 3 by trying logical sequences for the state of the Lower and Upper
float switches as if the tank was filling and emptying. Beware of logical combinations that are
impossible. For example, can the Lower float switch be open while the Upper float switch is closed?
Important note: Once you are certain that Rungs 2 & 3 are working properly, save your program under
a new name such as Lab01b.
11- Insert Rung 4 and assign tags to the program instructions which correspond to: FillTank, Activate and
PumpCoil.
Test the operation of the complete system. Set up the float switches to start with a full tank. You should
then actuate the switches to show what happens when the tank drains to reach a low-level. Follow by
showing the related float switch action when the tank fills to reach a full level again.
Try the Stop switch and the PumpOVL switch at various logical points during the sequence of events.
Use the Resume button when appropriate. Try to cover all possibilities in a logical sequence.

12- Optional bonus (1 mark) Add the programmed logic necessary to automatically control the drain
valve solenoid. The system should always be either pumping or draining.
Use a panel light to simulate the operation of the drain valve solenoid.
Demo Requirements
Demo Notes: You need to demo the operation of your tank program. During the demo you must
verbally describe the operation of the system while manually actuating the Lower and
Upper float switches in a logical sequence of operations. Your demo should simulate the tank starting
full, then draining, then reaching the empty level, then filling and finally getting full again.
During the process you must use proper technical vocabulary and demonstrate what happens if power
is lost, if Stop is pushed or if the PumpOVL relay trips. All possibilities MUST be covered.
Proper technical vocabulary means that you use the proper names to describe the switches (for
example, a Stop switch is a “normally-closed pushbutton”)... You could say something like “I want to
stop the system operation so I’m pushing the normally-closed Stop pushbutton to open its contact”.
Ensure that your sequence is logical! You may lose marks if your sequence makes no sense.
For example, it makes no sense to trip the PumpOVL relay if the pump is not running.
During your demo it must be clear to the instructor that you understand:
- The type of switches and float-switch sensors that you are using.
(refer to the lab assignment electrical wiring diagram).
- If the switches are open or closed at any point during the demo.
- What is happening in the tank (is the tank filling or emptying) as your demo progresses.
The instructor will allow for a reasonable number of mistakes but marks will be subtracted if too many
mistakes are made.
To maximize your marks during a demo it is recommended that:
- You practice and predict the operation of the program with a classmate before the demo.
- You understand the switch and float sensor states (open or closed) necessary to test the system.
(tank full, tank is in the process of emptying, tank empty, tank is in the process of filling)
- You may want to make notes to remember proper technical terms during the demo.
You are allowed to refer to your notes at any time during the demo as long as your answers are
provided in a reasonable amount of time with minimum hesitation.

Page 13 of 18
Lab 01 – Sealing vs. Latching
ELN9207

- You may want to bring masking tape to help you identify switches during the demo.
WARNING: YOU WILL SUFFER THE WRATH OF THE LAB TECHNICIAN IF YOU WRITE DIRECTLY ON THE PANELS!
The demo totals 3.5 of the 5 lab marks allotted as follows (the remaining 1.5 marks are for the on-line test):
- A maximum of 1 marks for a program that is perfectly functional.
- A maximum of 2.5 marks for the verbal demo and for answering questions about the state of switches
or state of the tank using proper technical vocabulary.

Prepare the following check receipt by inking your name, the date and the mark you obtained on
the pre-lab test.
Some of the following questions could be asked during the demo or during the on-line test:
1- In what practical situations should Sealing or Latching techniques be used?
2- Why would it be very dangerous to use a latch (instead of a seal) to implement a Start/Stop system?
3- Why should the operation of motor coils be qualified by the Start/Stop seal?
4- How many bits are there in a memory word? (it will depends on the processor you are using)
5- What is an alias tag? What is a base tag?
6- How many values can a Boolean variable adopt? What are these values?
7- What actual hardware in the lab do the following tags refer to?
Local:1:I.data.2 , Local:2:O.data.5, LatchMemory.2
8- The tag Local:1:I.data.0 refers to a switch. Is this switch normally-open or normally-closed?
9- What condition will cause an XIO instruction to be True:
a) If the XIO is tagged to Local:1:I.data.0
b) If the XIO is tagged to Local:1:I.data.1
c) If the XIO is tagged to Local:1:I.data.2
d) If the XIO is tagged to Local:2:O.data.2
e) If the XIO is tagged to LatchMemory.5
10- An overload relay is a “normally-closed” or a “normally-open” contact?
11- In each case, what kind of electrical switches should typically be selected to implement Stop and Start
operations.
12- In each case, which ladder logic instruction (XIC or XIO) should be used to monitor the operation of typical
Start switches, Stop switches and overload relays.
13- Imagine that the tank system that you built in the lab today exists in practice. What physical actions would
you need to perform to restart the system if:
a) The Stop button has been pressed.
b) Power has failed.
c) An overload has occurred.
14- What is the symbol for an XIO instruction?
15- For each of the two programs shown below, given the switch sequence shown, determine the missing states
of the memory latch (set or reset).

Rung order has been reversed

Memory Memory
L Switch1 Switch2 Latch U Switch1 Switch2 Latch
Switch1 Memory Switch2 Memory
Latch Open Open Reset Latch Open Open Reset
Open Closed Open Closed
U Closed Open L Closed Open
Switch2 Memory Switch1 Memory
Latch Closed Closed Set Latch Closed Closed Set

Page 14 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Field
Wiring
Diagram –
This
diagram

Page 15 of 18
Lab 01 – Sealing vs. Latching
ELN9207

You may not demo unless your name and date are written in ink below

When you are ready for the demo, put your name on the white board demo list.

You must remind the instructor to sign your demo receipt. This is your proof that you demoed!

Note: No report is required

Lab 01: Name: ____________________________ Date: _____________


(must be in ink) (must be in ink)

System Functionality Mark: ______ /1.5 Verbal demo Mark: _____ /2.5
Instructor initials: ________________ Date: __________________ MH, AS or LP

Additional Practice Questions


Not all students progress at the same rate and not all students have the same interest in going beyond the basic
PLC labs. Because of this, the following additional non-compulsory practice examples are available. You may
choose to try to solve these example problems on paper or implement the ladder logic solutions in the lab if you
finish your labs early. Solving these example problems will provide great practice to prepare for tests and will
certainly help improve your design skills.
A blank ladder logic template is available on page 17 to draft your answers.

Problem 1-1
Examine the ladder logic program shown at S top S tart OVL M
right for the control of a motor system:
(X IC ) (X IC ) (X IC ) (O E)

M
Q1- If you were to add programming for a
second Stop button where would you (X IC )
position the instruction?
Q2- If you were to add programming for a second Start button where would you position the instruction?
Q3- What is that state of the Motor relay coil after Start is pressed?
Q4- What will be the state of the Motor relay coil after O/L trips?
Q5- What would happen is an XIO instruction would be used to monitor the normally-closed stop switch.
Problem 1-2
Examine the electrical schematic
for a 2-motor system shown at
right:
Q1- Can Motor1 be started if
Motor2 is not running? Briefly
explain.
Q2- Can Motor2 be started Motor1
is not running? Briefly explain.
Q3- What happens if both motors
are running and Stop1 is

Page 16 of 18
Lab 01 – Sealing vs. Latching
ELN9207

pushed?
Briefly explain.
Q4- What happens if both motors are running and O/L1 trips?
Briefly explain.
Q5- Design a ladder logic program which will implement the same functionality given that the switches and
overload relays are connected to PLC inputs and that the motor coils are connected to PLC outputs.
You can use the ladder logic template located on the last page.
Problem 1-3
Examine the following electrical schematic for a Forward/Reverse starter with electrical interlock:

Q1- Can the F coil be energized if the R coil is energized?


Q2- What is the purpose of the normally closed contacts?
Q3- What is the purpose of the normally open R contact?
Q4- Design a ladder logic program which will implement the same functionality given that the switches, and the
overload relay are connected to PLC inputs and that the motor relay coils are connected to PLC outputs.

Problem 1-4
Consider a system that includes two separate motors.
The motors have separate individual Start buttons and Ovl contacts but they share a common Stop button.
To complicate things, the system must have interlock functionality so that Motor1 can’t start if Motor2 is
running and Motor2 can’t start if Motor1 is running.
Give a ladder logic program that implements this system.

Problem 1-5
Examine the electrical schematic
shown at right for a 2-speed starter:
Q1- Can the speed by changed from
Low to High without pushing
Stop?
Q2- Can the speed by changed from
High to Low without pushing
Stop?
Q3- Given that the switches and
Overload relay contact are wired
to the PLC inputs and that the
motor coils are wired to PLC
outputs.

Page 17 of 18
Lab 01 – Sealing vs. Latching
ELN9207

Design a ladder logic program which will allow the speed to be changed from Low to High or from High to
Low without pushing Stop.

Page 18 of 18

You might also like