Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
E l i the
Explain th operation
ti off TON,
TON TOF,
TOF and
d RTO timers
ti
Explain
p the use of CTU and CTD timers
Ti
Timers are used
d to
t delay
d l actions
ti
Keep an output on for a specified time after an input turns off
Keep an output off for a specified time before it turns on
TON
I:2 TIMER ON DELAY EN
Timer T4:0
Time Base 0.1
Preset 50 DN
Accum 0
Ti
Timer Attributes
A ib
Time Base:
Timers are typically
yp ypprogrammed
g with several different time bases
1 second, 0.1 second, 0.01 second, 0.001 second
Suppose time base is set to 0.1 and Delay increments is set to 50
timer has 5 seconds delay (0.1 x 50)
TON
I:2 TIMER ON DELAY EN
Timer T4:0
Time Base 0.1
Preset 50 DN
Accum 0
Preset Attribute:
Preset value is the number of time increments timer must count
before changing the state of the output
Time Delay = Preset value x Time Base ( refer to previous example)
Preset can be constant or a variable
Accum Attribute:
[Rockwell] Timers have one input. When the input transits from low
to high, the timer will begin timing (Accum value)
Timers that do not lose their accumulated time when the enable input line
transitions to low again are known as Retentive Timers
Retentive Timers continue to maintain accumulated time and increment
the time when the input line goes to high again
Non-retentive Timers lose the accumulated time whenever the enable
input transitions to low
The accumulated time resets to zero
T File Type
Fil T (Timer)
(Ti )
4 File Number of the Timer
Timer T4:0 : Delimiter
0 Element (The actual timer number)
TON
I:2 TIMER ON DELAY EN
Timer T4:0
Time Base 0.1
Preset 50 DN
Accum 0
Timer On Delay
y Instruction:
Turns an output on after a Timer has been on for a preset time
interval
TON starts accumulating
g time when rung g becomes true
Continue accumulating until one of the following occurs:
Accumulated (Accum) value equals preset value
The rung conditions becomes false
Bit S t When
Set Wh R
Remains
i Set
S t Till
Timer done Bit Accumulated value is Rung conditions go false
(bit 13 or DN) equal to or greater than the
preset value
Timer Timing bit Rung conditions are true Rung conditions go false or
(bit 14 or TT) and the accumulated value when the done bit is set
is less than the preset
value
Timer enable bit Rung conditions are true Rung conditions go false
(bit 15 or EN)
Current status of timer bits (EN, TT and DN) stored in first 16 bits
PRE value is held in the second 16 bit of timer storage
Third 16 bit holds accumulated value of timer
TT 1
T4:0
O:5
2
DN
When input I:2/3 is true timer begins to increment the accumulated value of TON Timer
T4:0 in 1 second intervals
The TT bit is used in rung 2 to turn on Output O:5/1, while the timer is timing (ACC <PRE)
The DN bit of timer 4:0 is used in rung 3 to turn an output O:5/2 when the timer is done
timing (ACC = PRE)
Note: the Preset for this timer is 180 The timer will have to accumulate 180 1-second intervals to time
out
Note: This is a non-retentive timer: If Input I:2/3 goes low before 180 is reached, the accumulated value
is reset to zero
3. The timer enable bit (EN bit 15) is set when the rung becomes
true. It is reset when the rung becomes false and ACC < PRE or
the DN bit is reset (ACC = PRE)
4. The done bit (DN bit 13) is reset when the ACC value is equal to
g becomes true
the PRE value. The DN bit is set when the rung
Computer Aided Manufacturing TECH 4/53350 16
Timer Off Delay
TOF Bits
Bit S t When
Set Wh R
Remains
i Set
S t Till
Timer done Bit Rung conditions are true Rung conditions go false
(bit 13 or DN) and the accumulated value
is greater than or equal to
the preset value
Timer Timing bit Rung conditions are false Rung conditions go true or
(bit 14 or TT) and the accumulated value when the done bit is reset
is less than the preset
value
Timer enable bit Rung conditions are true Rung conditions go false
(bit 15 or EN)
TT 1
T4:0
This output is energized when the timer is done timing O:5
DN 2
To zero the ACC value, use a reset (RES) instruction in another rung with
the same address as the RTO
Timer enable bit Rung conditions are true Rung conditions go false
(bit 15 or EN)
I0:2 T4:0
RES
TON
T4:0 TIMER ON DELAY EN
Timer T4:1
Time Base 1.0
Preset 7233 DN
DN
Accum 0
23
Counters
Edge-Triggered
Edge Triggered I:2 Count Up
Counter C5:0
EN
Preset 10
Accum 0 DN
3
C5:0
O:5
Energized when the Accum >= Preset
DN 1
Input I:2/3 On
Status Of
Output O:5/1 On
Of
Status
0 1 2 10 11
C File Type
5 File Number of the counter
C5:0 : Delimiter
0 Element (The actual counter number)
Count Up
p ((CU),
), Done ((DN)) and Overflow ((OV)) bits are stored in first 16 bits
The CPU sets the OV bit when the counter exceeds upper limit +32,767
ACC wraps around to -32,767 and continues from there towards zero
PRE value is held in the second 16 bit of counter storage
Thi d 16 bit h
Third holds
ld accumulated
l t d value
l off counter
t
Bit S t When
Set Wh R
Remains
i Set
S t Till
Count-up Overflow bit Accumulated value wraps A RES instruction that has
(bit 12 or OV) around to -32,768 (from same address as the CTU
+32 767) and continues up
+32,767) instruction is executed or
from there towards zero the count is decremented
less than or equal to
+32,767 with a CTD
instruction
Done bit The accumulated value is The accumulated value
(bit 13 or DN) => the preset value becomes less than the
preset value
Count up enable bit (bit 15
Count-up Rung conditions are true Rung conditions go false or
or CU) a RES instruction that has
the same address as the
CTU instruction is enabled
Count-Up Counter CTU
Preset 4
Accum 0 DN
3
C5:0
O:5
Energized
g when the Accumulated Preset
DN 1
C5:0
Energized
g when the counter overflows O:5
OV 2
Preset 4
Accum 0 DN
3
C5:0
O:5
Energized
g when the Accumulated >= Preset
DN 1
C5:0
Energized
g when the counter overflows O:5
OV 2
I:2 C5:0
Reset
ese cou
counter
e to
o zero
eo
RES
Preset 4
Accum 0 DN
3
C5:0
O:3
Energized
g when the Accumulated Preset
DN 1
C5:0
Energized
g when the counter underflows O:3
UN 2
I:2 C5:0
Resets
ese s cou
counter
e to
o zero
eo
RES
1
Input I:2/3 is used to enable the counter
Each time input I:2/3 makes a 01 transition, the counter ACC value gets decremented by1
The DN bit is set when the ACC value the Preset value
The DN bit of C5:0 (C5:0/DN) is used to turn output O:3/1 on when Accum Preset value
The UN bit of C5:0 (C5:0/UN) is used to set OUTPUT O:3/2 ON when the ACC value
underflows (-32,768)
Input I:2/1 is used to reset the C5:0s ACC value to zero
Bit S t When
Set Wh R
Remains
i Set
S t Till
Count-down Underflow bit Accumulated value wraps A RES instruction that has
(bit 11 or UN) around to +32,768 (from: same address as the CTD
-32,767)
32 767) and continues instruction is executed or
counting from there the count is incremented
greater than or equal to
+32,767 with a CTU
instruction
Done bit The accumulated value is The accumulated value
(bit 13 or DN) the preset value becomes less than the
preset value
Count down enable bit (bit
Count-down Rung conditions are true Rung conditions go false or
14 or CD) a RES instruction that has
the same address as the
CTDinstruction is enabled
Memory Storage
CTU and CTD Counter Bits
Bits 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 Element
CU CD DN OV UN
Internal Use 0 C5:0
Preset Value 1 C5:0.PRE
Accumulated Value 2 C5:0
C5:0.ACC
ACC
Count Up (CU), Count Down (CD), Done (DN), Overflow (OV) and
Underflow (UN) bits are stored in first 16 bits
The CPU sets the OV bit when the counter exceeds upper limit +32
+32,767
767
ACC wraps around to -32,767 and continues incrementing from there towards
zero to +32,767
The CPU sets the UN bit when the counter exceeds lower limit -32,767
ACC wraps aroundd tto +32,767
32 767 and
d continues
ti d
decrementing
ti ffrom th
there ttowards
d
zero to -32,767
PRE value is held in the second 16 bit of counter storage
Third 16 bit holds accumulated value of counter
CTU
C5:0 COUNT UP EN
Counter C5:1
Preset 5000
DN
DN Accum 257
C5:0
RES
36