Sunteți pe pagina 1din 2

___________________________________________________________________________

1/ 10
Þ
1.3-2 Timer function bIock %TMi
Timers have three operating modes :
· TON : this mode is used to control
on-del ay acti ons. Thi s del ay i s
programmable and can be modified via
the terminal.
· TOF : this mode is used to control
off-del ay acti ons. This del ay i s
programmable and can be modified via
the terminal.
· TP : this mode is used to create a pulse
of an exact duration. This duration is
programmable and can be modified via
the terminal.
Characteristics
Timer number %TMi 0 to 63 for a TSX 37, 0 to 254 for a TSX 57
Mode TON · on-delay (default)
TOF · off-delay
TP · monostable
Time base TB 1min (default), 1s, 100ms, 10ms (max of
16 timers when 10ms). The smaller the time
base, the greater the accuracy of the timer.
Current value %TMi.V Word which increments from 0 to %TMi.P when
the timer is running. Can be read and tested
but not written by the program (1).
Preset value %TMi.P 0}%TMi.P}9999. Word which can be read,
tested and written by the program. Ìt is set to
9999 by default. The time period or delay
generated is equal to %TMi.P x TB.
Adjust via the terminal Y/N Y : the preset value can be modified %TMi.P
(MODÌF) in adjust mode.
N : no access in adjust mode.
Setting input IN The timer starts on a rising edge (TON or TP
(instruction) mode) or a falling edge (TOF mode).
Timer output Q Associated bit %TMi.Q is set to 1 depending on
the function performed TON, TOF or TP.
(1) %TMi.V can be modified via the terminal.
Timer block
IN
MODE:TON
MODIF:Y
Q
%TMi
TB: 1mn
TM.P:9999
1
___________________________________________________________________________
1/ 11
Þ
Using as an on-deIay timer : TON mode
The timer is started on a rising edge at
input ÌN : its current value %TMi.V increases
from 0 to %TMi.P by one unit on each
pulse of the time base TB. Output bit
%TMi.Q changes to 1 when the current
value reaches %TMi.P and then remains
at 1 as long as input ÌN is at 1.
When input ÌN is at 0, the timer is stopped,
even if its value is still changing : %TMi.V
takes the value 0.
Using as an off-deIay timer : TOF mode
The current value %TMi.V is set to 0 on a
rising edge at input ÌN (even if the timer is
still running). The timer is started on a
falling edge at input ÌN.
The current value increases to %TMi.P by
one unit on each pulse of the time base TB.
Output bit %TMi.Q changes to 1 when a
rising edge is detected on input ÌN and the
timer returns to 0 when the current value
reaches %TMi.P.
Using as a monostabIe : TP mode
The timer is started on a rising edge at
input ÌN : (if the timer has not already
started) its current value %TMi.V increases
from 0 to %TMi.P by one unit on each
pulse of the time base TB. Output bit
%TMi.Q changes to 1 when the timer is
started and returns to 0 when the current
value reaches %TMi.P.
When input ÌN and output %TMi.Q are at 0,
TMi.V takes the value 0.
This monostable cannot be reset.
IN
Q
%TMi.V
%TMi.P
IN
Q
%TMi.V
%TMi.P
IN
Q
%TMi.V
%TMi.P
___________________________________________________________________________
1/ 12
Þ
Programming and configuration
Timer function blocks are programmed in the same way, irrespective of the mode of use
selected. TON, TOF or TP mode can be chosen in the variables editor.
· Configuration
The following parameters must be entered in the variables editor :
- Mode : TON, TOF or TP.
- TB : 1min, 1s, 100ms or 10ms.
- %TMi.P : 0 to 9999.
- MODÌF : Y or N.
· Programming
Ladder language Ìnstruction list language
LD %Ì1.1
IN %TM1
LD %TM1.Q
ST %Q2.3
%Q2.3 %I1.1
IN Q
%TM1
Structured text language
ÌF RE %Ì1.1 THEN
START %TM1 ;
ELSÌF FE %Ì1.1 THEN
DOWN %TM1 ;
END_ÌF ;
%Q2.3 := %TM1.Q ;
The START %TMi instruction generates a rising edge on the timer block input ÌN (Mode
TON and TP) or a falling edge on the timer block input ÌN (Mode TOF).
The DOWN %TMi instruction generates a falling edge on the timer block input ÌN (Mode
TON and TP) or a rising edge on the timer block input ÌN (Mode TOF).
TON
1
___________________________________________________________________________
1/ 13
Þ
SpeciaI cases
· Effect of a coId restart : (%S0=1) forces the current value to 0, sets output %TMi.Q
to 0 and the preset value is reset to the value defined during configuration.
· Effect of a warm restart : (%S1=1) has no effect on the current value of the timer nor
on the preset value. The current value does not change during a power outage.
· Effect of a PLC stop, de-activation of a task or execution of a break point : does
not freeze the current value.
· Effect of a program jump : the fact of not scanning the instructions where the timer
block is programmed does not freeze the current value %TMi.V, which continues to
increment to %TMi.P. Similarly, bit %TMi.Q associated with output Q of the timer block
maintains its normal operation and can thus be tested by another instruction.
However, the output wired directly to the block output is neither activated nor scanned
by the PLC.
· Testing bit %TMi.Q : it is advisable to test bit %TMi.Q once only in the program.
· Effect of modifying the preset %TMi.P : modifying the preset value via an instruction
or in adjust mode only takes effect when the timer is next activated : modifying the
preset value in the variables editor is only taken into account after a cold restart
(%S0=1).

S-ar putea să vă placă și