Lab 03 - Timers
Lab 03 - Timers
Objectives
- To learn to set up the parameters of timer instructions.
- To sequence Timer instructions in order to create a delayed response.
- To create an oscillator using coupled Timer instructions.
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.
The 5 Lab Marks are assigned as follows:
A Brightspace quiz worth 1.5 of the 5 lab marks MUST be done BEFORE starting the lab.
A fully functional program and accurate electrical diagram is worth 1.5 of the 5 lab marks.
A flawless demo presentation is worth 2 of the 5 lab marks (see Demo Requirements on page 9).
A bonus version is available for 1 extra mark.
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 understand this theory.
- This review will provide some of the information you need to write the on-line quiz.
- Note that you will probably be able to zoom through this if you have been attending classes and
if you already understand most of the material.
- Ensure that you review the Timer operations listed below.
Reading and understanding these instructions will give you the proper techniques to progress a
lot faster during the required practical lab design.
Using Timer Instructions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 2
Timer Memory Structure - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 2
Creating a Timer Tag - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 2
Experimenting with TON - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 3
Cascading Timers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 4
Retentive Timers - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 5
Experimenting with TOF - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 6
Oscillators - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 7
2- The Lab Design Assignment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 8
- BEFORE going to the lab read about the practical design described on Page 8.
This will not be easy and it may take you a while before you can design a solution. However, the
things you will learn will certainly make the effort worthwhile. It is recommended that you design
before the lab and use the precious lab time to program and debug your design.
- Plan how you will test your solution ensuring that you can quickly and efficiently demonstrate all
possible situations during your demo.
Design Assignment - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 8
Bonus version - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 8
Demo Requirements - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 9
Electrical Schematic - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page 10
3- Additional Practice Questions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Page
11
Page 1 of 11
Lab 03 - Timers
Once a timer tag is created you may assign it to a particular timer in your ladder logic program.
Page 2 of 11
Lab 03 - Timers
Page 3 of 11
Lab 03 - Timers
Cascading Timers
Most commercial automated systems need to run processes in succession.
For example, one process may have to run for some time before a second process may be allowed to
begin.
The timer done (.DN) bit is quite useful to produce delays as will be shown in this second example.
You will need to create a new memory structure timer tag for Timer2, as was shown before when
creating a Timer tag.
Add the 3 rungs shown at T2_Enable
right below your Timer1 Timer1.DN TON <Local:2:O.data.5>
program (you will have a Rung 4 Timer On Delay EN
Timer Timer2
total of 6 rungs). Preset 4000 DN
Accum 0
Notice, on the program, that
T2_Timing
Timer2 is enabled by the Timer2.TT <Local:2:O.data.6>
done bit of Timer1. Rung 5
Press and hold the Start T2_Done
Timer2.DN
switch and observe what <Local:2:O.data.7>
Page 4 of 11
Lab 03 - Timers
Retentive Timers
You certainly noticed, when experimenting with TON, that opening the “Timer On Delay” input
disables the TON timers and resets the accumulated value to zero. Retentive (RTO) timers will have a
different behavior as they maintain their accumulated value when disabled.
We will now modify the Timer1 so that it becomes a retentive timer.
- Save your existing program and then Save AS... Lab3RTO
- Double-click the TON letters on Timer1 and select RTO from the pull-down menu.
- Complete the modification by specifying the new RTO Preset value to 4000 milliseconds and
Accum value to 0.
Since RTO timers retain their
accumulated values when they are
disabled we need some mechanism
to reset their accumulated value.
The "Reset" ( ) instruction is
available to do this.
It is available as a program
instruction by clicking the
icon.
Insert a rung below the existing
Timer1 rungs, as shown on the
ladder logic program. Insert XIO
and RES instructions on that new
rung.
Note that a stop switch is used to reset Timer1 (why do we choose an XIO instruction to monitor the
stop switch?)
Download the modified program to the processor and try your new features.
Fill Table 3 with your observations.
Table 3 Timer1 RTO
Reset Preset Accum EN TT DN
Retentive Timer state value value state state state
After Downloading and then T/F T/F T/F T/F
running the program
Immediately after pressing the T/F T/F T/F T/F
Start push-button
2 seconds after pressing and T/F T/F T/F T/F
holding the start push-button
After releasing the Start push- T/F T/F T/F T/F
button from the previous step
After again pressing and holding T/F T/F T/F T/F
the start push-button for 2 seconds
After releasing the start push- T/F T/F T/F T/F
button from the previous step
After pressing and releasing the T/F T/F T/F T/F
reset button.
Page 5 of 11
Lab 03 - Timers
All timers we have looked at detect a True rung condition to start timing. The TOF does the exact
opposite: it times as long as the rung condition is False.
Save your existing program and then Save As... Lab3TOF.
Page 6 of 11
Lab 03 - Timers
Oscillators
Free-running oscillators turn a memory bit ON and OFF repeatedly without outside intervention.
Oscillators may be used to blink lights that are connected to output terminals or trigger some process to
restart periodically. Two timers may be combined to create an oscillator as is explained below.
- Specify a Preset value of 1000 milliseconds for Timer1 and 2000 milliseconds for Timer2.
- Replace the XIC instructions that were used to enable the timers with XIO.
You can do this by double-clicking on the instruction itself.
Tag these XIO instructions as shown on the program to cross-couple the timers using the T T bits.
- Keep the Reset rung and delete any unnecessary rungs.
Download the program to the processor and run it in order to test its behavior.
Fill Table 5 with your observations.
Timer1 TON Timer2 TON
Table 5
TT True DN EN TT True DN True EN
Oscillator duration True True duration duration True
duration duration duration
After downloading and
then running the
program
Oscillator period: Sec.
Oscillator frequency: Hz
Q1- What do you think happens to the Timer1.DN and Timer2.DN status bits?
Q2- What happens to the Timer1 and Timer2 accumulated values when the Reset switch is closed?
Page 7 of 11
Lab 03 - Timers
Optional extra NOT FOR BONUS: Maintain a uniform mix ratio by ensuring that the Juice to Goo mix
ratio is always exactly 3:1.5 (exactly 3 seconds for the juice and exactly 1.5 seconds for the Goo) no
Page 8 of 11
Lab 03 - Timers
matter when the tank gets full or when the system is stopped. Note that filling the tank may continue
for a short while, even when the tank is at the max level, in order to achieve the exact mix ratio.
Demo Requirements
Complete the electrical schematic on the next page showing all contacts, switches,
float switch sensors, coils and solenoids that need to be connected to the PLC.
Use proper standard electrical symbols.
Prepare the following check receipt by inking your name, the date and the mark you obtained
on the pre-lab quiz.
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.
Note: No report is required
Lab 03: Date: ____________ Name: ____________________________ Pre-lab quiz mark: _____
(must be in ink) (must be in ink)
Schematic mark: _____ /0.5 System Functionality mark: _____ /1.5 Verbal Demo mark: _____ /2
Page 9 of 11
Lab 03 - Timers
The I/O shown should be that of the application not the lamps and switches of the lab
I/O box.
Page 10 of 11
Lab 03 - Timers
Page 11 of 11