Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
SIMATIC Timers
This chapter contains the following information:
Parameter
The following table shows the parameters of the instruction "Assign pulse timer parameters and start":
Parameter
Declaration
Data type
Memory area
Descripti
<Timer>
InOut/Input
TIMER
on
Timer of
the
instruction
The number of
timers depends
on the CPU.
S
Input
BOOL
I, Q, M, D, L
Start input
TV
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Preset timer
value
Input
BOOL
I, Q, M, T, C, D, L, P
or constant
Reset input
BI
Outpu
t
WORD
I, Q, M, D, L, P
BCD
Outpu
t
WORD
I, Q, M, D, L, P
Outpu
t
BOOL
I, Q, M, D, L
Current timer
value
(BI-coded)
Current timer
value
(BCD format)
Status of the
timer
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number" as long as the operand "TagIn_1" has the
signal state "1". If the signal state of the operand "TagIn_1" changes from "1" to "0" before the timer expires,
the timer "Timer_1" is stopped. The operand "TagOut" is reset to "0" in this case.
The operand "TagOut" has the signal state "1" as long as the timer is running and the operand "TagIn_1" has
the signal state
"1". When the timer expires or is reset, the operand "TagOut" is reset to "0".
Parameter
The following table shows the parameters of the instruction "Assign extended pulse timer parameters and
start":
Parameter
Description
Declaration
Data type
Memory area
<Timer>
InOut/Input
TIMER
Timer of
the
instruction
The number of
timers depends
on the CPU.
Input
BOOL
I, Q, M, D, L
Start input
TV
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Preset timer
value
Input
BOOL
I, Q, M, T, C, D, L, P
or constant
Reset input
BI
Output
WORD
I, Q, M, D, L, P
BCD
Output
WORD
I, Q, M, D, L, P
Output
BOOL
I, Q, M, D, L
Current timer
value
(BI-coded)
Current timer
value
(BCD format)
Status of the
timer
Examp
le
The following example shows how the instruction
works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number" without being afected by a negative edge
at input S. If the signal state of the operand "TagIn_1" changes from "0" to "1" before the timer expires, the
timer is restarted.
The operand "TagOut" has the signal state "1" as long as the timer is running. When the timer expires
or is reset, the operand "TagOut" is reset to "0".
Parameter
The following table shows the parameters of the "Assign on-delay timer parameters and start" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Timer>
InOut/Input
TIMER
Timer of the
instruction
The number of
timers depends
on the CPU.
Input
BOOL
I, Q, M, D, L
Start input
TV
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Preset timer
value
Input
BOOL
I, Q, M, T, C, D, L, P
or constant
Reset input
BI
Output
WORD
I, Q, M, D, L, P
BCD
Output
WORD
I, Q, M, D, L, P
Output
BOOL
I, Q, M, D, L
Current timer
value
(BI-coded)
Current timer
value
(BCD format)
Status of the
timer
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number". If the timer expires and the operand has
the signal state "1", the operand "TagOut" is set to "1". If the signal state of the operand "TagIn_1" changes
from "1" to "0" before the timer expires, the timer
is stopped. The operand "TagOut" has the signal state "0" in this case.
Parameter
The following table shows the parameters of the "Assign retentive on-delay timer parameters and start"
instruction:
Parameter
Declaration
Data type
Memory area
Descripti
<Timer>
InOut/Input
TIMER
on
Timer of
the
instruction
The number of
Input
BOOL
I, Q, M, D, L
timers depends
on
the CPU.
Start input
TV
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Preset timer
value
Input
BOOL
I, Q, M, T, C, D, L, P
or constant
Reset input
BI
Outpu
t
WORD
I, Q, M, D, L, P
BCD
Outpu
t
WORD
I, Q, M, D, L, P
Outpu
t
BOOL
I, Q, M, D, L
Current timer
value
(BI-coded)
Current timer
value
(BCD format)
Status of the
timer
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number", even if the signal state of the operand
"TagIn_1" changes to "0". When the timer expires, the operand "TagOut" is set to "1". If the signal state of
the operand "TagIn_1" changes from "0" to "1" while
the timer is running, the timer is restarted.
Parameter
The following table shows the parameters of the "Assign off-delay timer parameters and start" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Timer>
InOut/Input
TIMER
Timer of the
instruction
The number of
timers depends
on the CPU.
Input
BOOL
I, Q, M, D, L
Start input
TV
Input
S5TIME, WORD
I, Q, M, D, L or
Preset timer
value
constant
R
Input
BOOL
I, Q, M, T, C, D, L, P
or constant
Reset input
BI
Outpu
t
WORD
I, Q, M, D, L, P
BCD
Outpu
t
WORD
I, Q, M, D, L, P
Outpu
t
BOOL
I, Q, M, D, L
Current timer
value
(BI-coded)
Current timer
value
(BCD format)
Status of the
timer
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "1" to "0". The
timer expires with
the timer value of the operand "TagIn_Number". The operand "TagOut" is set to "1" when the timer is running
and when the
operand "TagIn_1" has the signal state "0". If the signal state of the operand "TagIn_1" changes from "0" to
"1" while the
timer is running, the timer is reset.
Parameter
The following table shows the parameters of the "Start pulse timer" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Time duration>
Input
S5TIME, WORD
I, Q, M, D, L or
Duration with
which
the timer
expires.
Timer which
is started.
constant
<Timer>
InOut/Input
TIMER
The number of
timers depends
on the CPU.
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with
the timer value of the operand "TagIn_Number" as long as the signal state of the operand "TagIn_1" is "1". If
the signal state
of the operand "TagIn_1" changes from "1" to "0" before the timer expires, the timer is stopped. As long as
the timer is
running, the operand "TagOut" has the signal state "1". A signal state change of the operand "TagIn_1" from
"0" to "1" resets
the timer, which stops the timer and sets the current timer value to "0".
Parameter
The following table shows the parameters of the "Start extended pulse timer" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Time duration>
Input
S5TIME, WORD
I, Q, M, D, L or
Duration with
which
the timer
expires.
Timer which
is started.
constant
<Timer>
InOut/Input
TIMER
The number of
timers depends
on the CPU.
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number" without being afected by a negative edge
in the RLO. As long as the timer is running, the operand "TagOut" has the signal state "1". If the signal state
of the operand "TagIn_1" changes from "0" to "1" before the timer expires, the timer is restarted.
Parameter
The following table shows the parameters of the "Start on-delay timer" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Time duration>
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Duration with
which the timer
expires.
<Timer>
InOut/Input
TIMER
Timer which
is started.
The number of
timers depends on
the CPU.
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number". If the timer expires and the RLO has the
signal state "1", the operand "TagOut" is set to "1". If the signal state of the operand "TagIn_1" changes from
"1" to "0" before the timer expires, the timer
is stopped. If the signal state of the operand "TagIn_2" is "1", the timer "Timer_1" is reset, which stops the
timer and sets the current timer value to "0".
Parameter
The following table shows the parameters of the "Start retentive on-delay timer" instruction:
Parameter
Description
Declaration
Data type
Memory area
<Time duration>
Input
S5TIME, WORD
I, Q, M, D, L
or constant
Duration with
which the timer
expires.
<Timer>
InOut/Input
TIMER
Timer which
is started.
The number of
timers depends
on the CPU.
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "0" to "1". The
timer expires with the timer value of the operand "TagIn_Number". When the timer expires, the operand
"TagOut" is set to "1". If the signal
state of the operand "TagIn_1" changes from "0" to "1" while the timer is running, the timer is restarted. If the
signal state of
the operand "TagIn_2" is "1", the timer "Timer_1" is reset, which stops the timer and sets the current timer
value to "0".
Parameter
The following table shows the parameters of the "Start off-delay timer" instruction:
Parameter
Declaration
Data type
Memory area
Description
<Time duration>
Input
S5TIME, WORD
I, Q, M, D, L or
Duration with
which
the timer
expires.
Timer which
is started.
constant
<Timer>
InOut/Input
TIMER
The number of
timers depends
on the CPU.
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
The timer "Timer_1" is started when the signal state of the operand "TagIn_1" changes from "1" to "0". The
timer expires with the timer value of the operand "TagIn_Number". As long as the timer is running, the
operand "TagOut" is set to "1". If the signal state of the operand "TagIn_1" changes from "1" to "0" while the
timer is running, the timer is restarted. If the signal state of the operand "TagIn_2" is "1", the timer "Timer_1"
is reset, which stops the timer and sets the current timer value to "0".