lecture 7 timers

21
ECT 464 ECT 464 Lecture 7 Lecture 7 Timers Timers

Upload: abdulla-barre

Post on 08-Apr-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 1/21

ECT 464ECT 464

Lecture 7Lecture 7

TimersTimers

Page 2: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 2/21

Sorrow looks back.  Sorrow looks back.  

Worry looks around.Worry looks around.Faith looks up.Faith looks up.

L et us fix our eyes on Jesus, the author andL et us fix our eyes on Jesus, the author andperfecter of our faith, who f or the j oy set bef oreperfecter of our faith, who f or the j oy set bef orehim endured the cross, scorning its shame, andhim endured the cross, scorning its shame, and

sat down at the right hand of the throne of G od.sat down at the right hand of the throne of G od.H ebrews 12:2 H ebrews 12:2 

Page 3: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 3/21

Timer Data File ElementsTimer Data File Elements

ENEN timer enabledtimer enabled

TTTT timer timing timer timing 

DNDN done bit done bit 

PREPRE Preset value wordPreset value word

ACCACC Accumulated valuewo

rdAccumulated valuewo

rd

Page 4: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 4/21

Word valuesWord values

Accumulat or ValueAccumulat or Value Number of clock Number of clock cycles that have occurred since the timercycles that have occurred since the timer

was enabled.  was enabled.  

Preset ValuePreset Value Value which the timer must Value which the timer must count up t o until the PLC sets the donecount up t o until the PLC sets the done

bit .bit . Values bet ween 0 and 32,767Values bet ween 0 and 32,767

Page 5: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 5/21

Time BaseTime Base The timers have a time base by whichThe timers have a time base by which

they are clocked.they are clocked.

Valid Time Bases are:Valid Time Bases are:

1 second1 second

0.1 seconds0.1 seconds

0.01 seconds0.01 seconds

Page 6: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 6/21

Address StructureAddress Structure

The Timer uses the typical element The Timer uses the typical element addressing scheme.addressing scheme.

Examples:Examples: T4:0.ACCT4:0.ACC

T11:33/DNT11:33/DN

T4:2/TTT4:2/TT

T12:4/ENT12:4/EN

T15:56.1/0 = T15:56.PRE/0T15:56.1/0 = T15:56.PRE/0

T16:29.2/15 = T16:29.ACC/15T16:29.2/15 = T16:29.ACC/15

Page 7: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 7/21

Timer On Delay (TON)Timer On Delay (TON)

EnableEnable Set whenever the input rung isSet whenever the input rung istruetrue

Timer Timing Timer Timing Set when enable is trueSet when enable is trueand accumulated value is less than theand accumulated value is less than thepreset value.preset value.

DoneDone Set when the enable is true andSet when the enable is true andthe accumulated value is greater than orthe accumulated value is greater than orequal t o the preset value.equal t o the preset value.

Page 8: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 8/21

Timer Off Delay (TOF)Timer Off Delay (TOF)

EnableEnable Set whenever the input rung isSet whenever the input rung istruetrue

Timer Timing Timer Timing Set when enable g oesSet when enable g oesf alse and accumulated value is less thanf alse and accumulated value is less thanthe preset value.the preset value.

DoneDone Set when the enable or timerSet when the enable or timertiming bit is true.timing bit is true.

Page 9: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 9/21

Retentive Timer (RTO)Retentive Timer (RTO)

EnableEnable Set whenever the input rung isSet whenever the input rung istruetrue

Timer Timing Timer Timing Set when enable g oes trueSet when enable g oes trueand accumulated value is less than theand accumulated value is less than thepreset value.preset value.

DoneDone Set when the enable is true andSet when the enable is true andthe accumulated value is greater than orthe accumulated value is greater than orequal t o the preset value. Does not reset equal t o the preset value. Does not reset 

accumulated value when enable is f alse.accumulated value when enable is f alse.

Page 10: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 10/21

Timer UsesTimer Uses Use t o count timeUse t o count time

Extend push butt on inputsExtend push butt on inputs

Delay inputsDelay inputs

Assembly line product controlAssembly line product control

Page 11: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 11/21

Timer ExamplesTimer ExamplesOn Delay: Output B comes on at a specif ic set time af ter

output A is turned on. When A is turned off, B g oes off.

Off Delay: Both A and B have been turned on at thesame time. Both are in operation. When A is turned off, Bremains on for a specif ic set time period before g oing off.

Limited On Time: A and B g o on at the same time. Bg oes off af ter specif ic set time period, but A remains on.

Repeat Cycling : An output pulses on and quickly off at aconstant preset time interval.

One-Shot Operation: Output B g oes on for a specif iedtime af ter output A is turned on. Output B will run for itsspecif ied time interval even if A is turned off during the Btiming interval.

Page 12: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 12/21

Timer ExamplesTimer ExamplesAlternate on and off  of t wo outputs: Two alternately

f lashing lights. The time for the t wo lights could bediff erent .

Multiple On Delay: Two diff erent events start at diff erent 

time intervals af ter an initial starting time ref erence point .

Multiple Off Delay: Two diff erent f unctions remain on fort wo diff erent time intervals af ter a process is turned off.

Interval time within a cycle: We may require that anoutput come on 7.5 seconds af ter system start up, remainon for 4.5 seconds, and then g o off and stay off. 

Page 13: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 13/21

Timer Example 1Timer Example 1

On Delay:  Output B comes on at a specific set time after 

output A is turned on.  When A is turned off, B goes off.

Page 14: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 14/21

Timer Example 2Timer Example 2

Off Delay:  Both A and B have been turned on at the same

time. Both are in operation.  When A is turned off, B

remains on for a specific set time period before going off.

Page 15: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 15/21

Timer Example 3Timer Example 3

Limited On Time: A and B go on at the same time.  B goes

off after specific set time period, but A remains on.

Page 16: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 16/21

Timer Example 4Timer Example 4

R epeat Cycling: An output pulses on and quickly off at a

constant preset time interval.

Page 17: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 17/21

Timer Example 5Timer Example 5

One-Shot Operation: Output B goes on for a specified time

after output A is turned on.  Output B will run for its

specified time interval even if A is turned off during the B

timing interval.

Page 18: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 18/21

Timer Example 6Timer Example 6

Alternate on and off of two outputs: Two alternately

flashing lights.  The time for the two lights could be

different.

Page 19: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 19/21

Timer Example 7Timer Example 7

Multiple On Delay: Two different events start at different

time intervals after an initial starting time reference point.

Page 20: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 20/21

Timer Example 8Timer Example 8

Multiple Off Delay: Two different functions remain on for 

two different time intervals after a process is turned off.

Page 21: Lecture 7 Timers

8/7/2019 Lecture 7 Timers

http://slidepdf.com/reader/full/lecture-7-timers 21/21

Timer Example 9Timer Example 9

Interval time within a cycle: We may require that an output

come on 7.5 seconds after system start up, remain on for 

4.5 seconds, and then go off and stay off.