Professional Documents
Culture Documents
Timer Iec
Timer Iec
1500)
Timer operations
IEC Timers
Note
If the timer is not called in the program because it is skipped, for example, the ET output returns a constant
value as
soon as the timer has expired.
When you insert the instruction in the program, the "Call options" dialog opens in which you can specify
whether the IEC timer is stored in its own data block (single instance) or as a local tag (multiple instance) in
the block interface. If you create a separate data block, you will find it in the project tree in the "Program
resources" folder under "Program blocks > System blocks". For additional information on this topic, refer to
"See also".
The instruction data is updated both when the instruction is called and also each time the outputs Q or ET
are accessed. The execution of the "Generate pulse" instruction requires a preceding logic operation. It can
be placed within or at the end
of the network.
Parameter
The following table shows the parameters of the "Generate pulse" instruction:
S7-1200 S7-
1500
Input BOOL I, Q, M, D, L Start input
IN BOOL
Input I, Q, M, D, L or Duration of the
TIME TIME, LTIME
PT
constant pulse.
The value of
the PT
parameter
must be
positive.
Q Output BOOL BOOL I, Q, M, D, L Pulse output
Timing diagram
The following figure shows the timing diagram of the "Generate pulse" instruction:
Timer operations (S7-1200, S7-
1500)
Note
If the timer is not called in the program because it is skipped, for example, the ET output returns a constant
value as
soon as the timer has expired.
When you insert the instruction in the program, the "Call options" dialog opens in which you can specify
whether the IEC
timer is stored in its own data block (single instance) or as a local tag (multiple instance) in the block
interface. If you create
a separate data block, you will find it in the project tree in the "Program resources" folder under "Program
blocks > System
blocks". For additional information on this topic, refer to "See also".
The instruction data is updated both when the instruction is called and also each time the outputs Q or ET
are accessed. The execution of the "Generate on-delay" instruction requires a preceding logic operation. It
can be placed within or at the
end of the network.
Parameter
The following table shows the parameters of the "Generate on-delay" instruction:
S7-1200 S7-
1500
Input BOOL I, Q, M, D, L Start input
IN BOOL
Input I, Q, M, D, L or Duration of the
TIME TIME, LTIME
PT
constant on-delay
The value of
the PT
parameter
must be
positive.
Q Output BOOL BOOL I, Q, M, D, L Output that is
set when the
PT
time expires.
Timing diagram
The following figure shows the timing diagram of the "Generate on-delay" instruction:
Timer operations (S7-1200, S7-
1500)
Note
If the timer is not called in the program because it is skipped, for example, the ET output returns a constant
value as
soon as the timer has expired.
Declaration of a data block of system data type IEC_TIMER or IEC_LTIMER (for example, "MyIEC_TIMER")
Declaration as a local tag of the type TOF_TIME, TOF_LTIME, IEC_TIMER or IEC_LTIMER in the "Static"
section of a block (for example, #MyIEC_TIMER)
When you insert the instruction in the program, the "Call options" dialog opens in which you can specify
whether the IEC timer is stored in its own data block (single instance) or as a local tag (multiple instance) in
the block interface. If you create a separate data block, you will find it in the project tree in the "Program
resources" folder under "Program blocks > System blocks". For additional information on this topic, refer to
"See also".
The instruction data is updated both when the instruction is called and also each time the outputs Q or ET
are accessed. The execution of the "Generate off-delay" instruction requires a preceding logic operation. It
can be placed within or at the
end of the network.
Parameter
The following table shows the parameters of the "Generate off-delay" instruction:
S7-1200 S7-
1500
Input BOOL I, Q, M, D, L Start input
IN BOOL
Input I, Q, M, D, L or Duration of the
TIME TIME, LTIME
PT
constant of delay
The value of
the PT
parameter
must be
positive.
Q Output BOOL BOOL I, Q, M, D, L Output that is
reset when the
timer PT
expires.
Timing diagram
The following figure shows the timing diagram of the "Generate off-delay" instruction:
Timer operations (S7-1200, S7-
1500)
When you insert the instruction in the program, the "Call options" dialog opens in which you can specify
whether the IEC timer is stored in its own data block (single instance) or as a local tag (multiple instance) in
the block interface. If you create a separate data block, you will find it in the project tree in the "Program
resources" folder under "Program blocks > System blocks". For additional information on this topic, refer to
"See also".
Timer operations (S7-1200, S7-
1500)
The instruction data is updated both when the instruction is called and also each time the outputs Q or ET are
accessed.
The execution of the Time accumulator" instruction requires a preceding logic operation. It can be placed
within or at the end of the network.
Parameter
The following table shows the parameters of the "Time accumulator" instruction:
S7-1200 S7-
1500
Input BOOL I, Q, M, D, L Start input
IN
BOOL
Input I, Q, M, D, L or Reset input
BOOL
R
BOOL
constant
PT Input TIME TIME, LTIME I, Q, M, D, L Maximum
or constant duration of
time
recording
The value of
the PT
parameter
must be
positive.
Q Output BOOL BOOL I, Q, M, D, L Output that is
set when the
PT
time expires.
Timing diagram
The following figure shows the timing diagram of the "Time accumulator" instruction:
Timer operations (S7-1200, S7-
1500)
Note
You can start and query the IEC timer at various execution levels, as each querying of the outputs Q or ET
updates the
IEC_TIMER structure.
Declaration as a local tag of the type TP_TIME, TP_LTIME, IEC_TIMER or IEC_LTIMER in the "Static" section
of a block
(for example, #MyIEC_TIMER)
The instruction data is updated both when the instruction is called and also each time the assigned timer
is accessed. The current timer status is stored in the Q structure component of the IEC timer. You can use
a normally open contact to
query timer status for "1" or a normally closed contact for "0". The query on Q or ET (for example,
"MyTimer".Q or
"MyTimer".ET) updates the IEC_TIMER
structure.
The execution of the "Start pulse timer" instruction assumes a preceding logic operation. It can be placed
only at the end of the network.
Paramet
er
The following table shows the parameters of the "Start pulse timer"
instruction:
S7-1200 S7-1500
Examp
le
The following example shows how the instruction
works:
The "Start pulse timer" instruction is executed when the signal state of the operand "Tag_Input" changes
from "0" to "1". The timer "DB1".MyIEC_TIMER is started for the time stored in the operand "TagTime".
As long as the timer "DB1". MyIEC_TIMER is running, the timer status ("DB1".MyIEC_TIMER.Q) has signal state
"1" and the operand "Tag_Output" is set. When the IEC timer has expired, the signal state of the time status
changes back to "0" and the "Tag_Output" operand is reset.
time. The output returns the signal state "1" if the RLO at the input of the instruction has the signal state "1".
If the RLO
changes to "0" before the time expires, the IEC timer is reset. In this case, querying the timer status for "1"
returns signal
state "0". The IEC timer restarts when the next positive signal edge is detected at the input of the instruction.
Note
You can start and query the IEC timer at various execution levels, as each querying of the outputs Q or ET
updates the
IEC_TIMER structure.
The instruction data is updated both when the instruction is called and also each time the assigned timer is
accessed.
The current timer status is stored in the ET structure component of the IEC timer. You can use a normally
open contact to query timer status for "1" or a normally closed contact for "0". The query on Q or ET (for
example, "MyTimer".Q or "MyTimer".ET) updates the IEC_TIMER structure.
The execution of the "Start on-delay timer" instruction assumes a preceding logic operation. It can be
placed only at the end of the network.
Parameter
The following table shows the parameters of the "Start on-delay timer" instruction:
S7-1200 S7-1500
Example
The following example shows how the instruction works:
Timer operations (S7-1200, S7-
1500)
The "Start on-delay timer" instruction is executed when the signal state of the operand "Tag_Input"
changes from "0" to "1". The "MyIEC_TIMER timer is started for the time stored in the "TagTime" operand.
If the timer "MyIEC_TIMER" has expired and the operand "Tag_Input" has the signal state "1", querying
the timer status ("MyIEC_TIMER).Q) returns signal state "1" and the "Tag_Output" operand is set. When
the signal state of the operand "Tag_Input" changes to "0", the querying of the timer status returns the
signal state "0" and the operand "Tag_Output" is reset.
Note
You can start and query the IEC timer at various execution levels, as each querying of the outputs Q or ET
updates the
IEC_TIMER structure.
The instruction data is updated both when the instruction is called and also each time the assigned timer is
accessed.
The current timer status is stored in the ET structure component of the IEC timer. You can use a normally
open contact to query timer status for "1" or a normally closed contact for "0". The query on Q or ET (for
example, "MyTimer".Q or "MyTimer".ET) updates the IEC_TIMER structure.
The execution of the "Start off-delay timer" instruction assumes a preceding logic operation. It can be placed
only at the end
Timer operations (S7-1200, S7-
1500)
of the network.
Parameters
The following table shows the parameters of the "Start off-delay timer" instruction:
S7-1200 S7-1500
Example
The following example shows how the instruction works:
The "Start off-delay timer" instruction is executed when the signal state of the operand "Tag_Input"
changes from "1" to "0". The timer #MyIEC_TIMER is started for the time stored in the operand "TagTime".
As long as timer #MyIEC_TIMER is running, the query of the time status (#MyIEC_TIMER.Q) returns the signal
state "1" and operand "Tag_Output" is set. If the timer has expired and the operand "Tag_Input" has the
signal state "0", the query of the timer status returns the signal state "0". If the signal state of the operand
"Tag_Input" changes to "1" before timer
#MyIEC_TIMER expires, the timer is reset. When the signal state of the operand "Tag_Input" is "1", the
query of the timer status returns the signal state "1".
Note
You can start and query the IEC timer at various execution levels, as each querying of the outputs Q or
ET updates the
Timer operations (S7-1200, S7-
1500)
IEC_TIMER structure.
The instruction data is updated both when the instruction is called and also each time the assigned timer is
accessed.
The current timer status is stored in the ET structure component of the IEC timer. You can use a normally
open contact to query timer status for "1" or a normally closed contact for "0". The query on Q or ET (for
example, "MyTimer".Q or "MyTimer".ET) updates the IEC_TIMER structure.
The execution of the Time accumulator" instruction requires a preceding logic operation. It can be placed
only at the end of the network.
Parameter
The following table shows the parameters of the "Time accumulator" instruction:
S7-1200 S7-1500
Example
The following example shows how the instruction works:
The "Time accumulator" instruction executes on a positive signal edge in the RLO. The time is recorded
as long as the operand "Tag_Input" has the signal state "1".
Timer operations (S7-1200, S7-
1500)
If the recorded time exceeds the value of the operand "TagTime", then the query of the timer status
("MyIEC_TIMER".Q) will return the signal state "1" and the operand "Tag_Output" will be set.
Parameters
The following table shows the parameters of the "Reset timer" instruction":
S7-1200 S7-1500
IEC_TIMER, IEC_TIMER,
<IEC timer> Output D, L IEC timer that
is
TP_TIME, IEC_LTIMER, reset.
TON_TIME, TP_TIME,
TOF_TIME, TP_LTIME,
TONR_TIME TON_TIME,
TON_LTIME,
TOF_TIME,
TOF_LTIME,
TONR_TIME,
TONR_LTIME
For additional information on valid data types, refer to "See also".
Example
The following example shows how the instruction works:
The "Generate on-delay" instruction executes when the signal state of the "Tag_Input_1" operand changes
from "0" to "1". The timer stored in the "TON_DB" instance data block starts running for the time duration
specified by operand "Tag_PT".
Timer operations (S7-1200, S7-
1500)
If operands "Tag_Input_2" and "Tag_Input_3" have the signal state "1", the "Reset timer" instruction is
executed and the timer stored in the "TON_DB" data block.
Note
If the specified IEC timer is running while the instruction executes, the instruction overwrites the current
time of the
specified IEC timer. This can change the timer status of the IEC timer.
You assign an IEC timer declared in the program to the "Load time duration" instruction.
The instruction data is updated only when the instruction is called and each time the assigned IEC timer is
accessed. The query on Q or ET (for example, "MyTimer".Q or "MyTimer".ET) updates the IEC_TIMER
structure.
Parameter
The following table shows the parameters of the "Load time duration" instruction:
S7-1200 S7-
1500
<Time duration> Input TIME TIME, LTIME I, Q, Duration with
M, D, L or which the IEC
constant timer runs.
Example
The following example shows how the instruction works:
The "Generate on-delay" instruction executes when the signal state of the "Tag_Input_1" operand changes
from "0" to "1".
The IEC timer stored in the instance data block "TON_DB" is started with the time duration that is specified by
the operand
"Tag_PT".
The "Load time duration" instruction is executed when the operand "Tag_Input_2" has the signal state "1".
The instruction writes the time duration "Tag_PT_2" in the instance data block "TON_DB" and at the same
time overwrites the value of the operand "Tag_PT" within the data block. The signal state of the timer status
may therefore change at the next query or when "MyTimer".Q or "MyTimer".ET are accessed.
SIMATIC Timers
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the instruction "Assign pulse timer parameters and start":
instruction
The number of
timers depends
on the CPU.
Timing diagram
The following figure shows the timing diagram of the instruction "Assign pulse timer parameters and start":
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".
The "Assign extended pulse timer parameters and start" instruction starts a programmed timer when a
change from "0" to
"1" (positive signal edge) is detected in the result of logic operation (RLO) at input S. The timer expires with
the programmed
duration (TV), even if the signal state at input S changes to "0". As long as the timer is running, the output Q
has the signal
state "1". When the timer expires, the output Q is reset to "0". If the signal state at input S changes from "0"
to "1" while the
timer is running, the timer is restarted with the duration programmed at input TV.
The duration is made up internally of a timer value and a time base and is programmed at parameter TV.
When the instruction is started, the programmed timer value is counted down towards zero. The time
base indicates the time period with which the timer value is changed. The current timer value is output
BI-coded at output BI and BCD-coded at output BCD.
If the timer is running and the signal state at input R changes to "1" then the current timer value and the
time base are also set to zero. If the timer is not running, the signal state "1" at the R input has no efect.
The "Assign extended pulse timer parameters and start" instruction requires a preceding logic operation for
edge evaluation and can be placed within or at the end of the network.
The instruction data is updated at every access. It can therefore happen that the query of the data at the
start of the cycle returns diferent values than at the end of the cycle.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the instruction "Assign extended pulse timer parameters and
start":
instruction
The number of
timers depends
on the CPU.
Timing diagram
The following figure shows the timing diagram of the "Assign extended pulse timer parameters and start"
instruction:
Timer operations (S7-1200, S7- Page 2121 of
1500) 33
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".
duration (TV) as soon as the signal state at input S is "1". If the timer has expired correctly and input S still
has signal state
"1" then output Q returns signal state "1". If the signal state at input S changes from "1" to "0" while the timer
is running, the
timer is stopped. In this case, output Q is reset to signal state "0".
The duration is made up internally of a timer value and a time base and is programmed at parameter TV.
When the instruction is started, the programmed timer value is counted down towards zero. The time
base indicates the time period with which the timer value is changed. The current timer value is output
BI-coded at output BI and BCD-coded at output BCD.
If the time is running and the signal state at input R changes from "0" to "1" then the current timer value
and the time base are also set to zero. In this case, the signal state at output Q is "0". The timer is reset if
the signal state is "1" at the R input even if the timer is not running and the RLO at input S is "1".
Specify the timer of the instruction in the placeholder above the box. The timer must be declared with the
data type TIMER. The "Assign on-delay timer parameters and start" instruction requires a preceding logic
operation for edge evaluation and
can be placed within or at the end of the network.
The instruction data is updated at every access. It can therefore happen that the query of the data at the
start of the cycle returns diferent values than at the end of the cycle.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Assign on-delay timer parameters and start" instruction:
instruction
The number of
timers depends
on the CPU.
Timing diagram
The following figure shows the timing diagram of the "Assign on-delay timer parameters and start"
instruction:
Timer operations (S7-1200, S7- Page 2323 of
1500) 33
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.
instruction is started, the programmed timer value is counted down towards zero. The time base indicates the
time period
with which the timer value is changed. The current timer value is output BI-coded at output BI and BCD-coded
at output
BCD.
Signal state "1" at input R resets the current timer value and time base to "0" regardless of the signal state
at start input S. In this case, the signal state at output Q is "0".
The "Assign retentive on-delay timer parameters and start" instruction requires a preceding logic
operation for edge evaluation and can be placed within or at the end of the network.
The instruction data is updated at every access. It can therefore happen that the query of the data at the
start of the cycle returns diferent values than at the end of the cycle.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Assign retentive on-delay timer parameters and start"
instruction:
instruction
The number of
timers depends
on the CPU.
Timing diagram
The following figure shows the timing diagram of the "Assign retentive on-delay timer parameters and start"
instruction:
Timer operations (S7-1200, S7- Page 2525 of
1500) 33
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.
BCD.
Signal state "1" at input R resets the current timer value and time base to "0". In this case, the signal state
at output Q is "0". The "Assign off-delay timer parameters and start" instruction requires a preceding logic
operation for edge evaluation and
can be placed within or at the end of the network.
The instruction data is updated at every access. It can therefore happen that the query of the data at the
start of the cycle returns diferent values than at the end of the cycle.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Assign off-delay timer parameters and start" instruction:
instruction
The number of
timers depends
on the CPU.
Timing diagram
The following figure shows the timing diagram of the "Assign off-delay timer parameters and start"
instruction:
Timer operations (S7-1200, S7- Page 2727 of
1500) 33
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.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Start pulse timer" instruction:
The number of
timers depends
on the CPU.
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".
The duration is made up internally of a timer value and a time base. When the instruction is started, the
programmed timer
value is counted down towards zero. The time base indicates the time period with which the timer value is
changed.
The "Start extended pulse timer" instruction requires a preceding logic operation for edge evaluation and
can only be placed at the right side of the network.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Start extended pulse timer" instruction:
The number of
timers depends
on the CPU.
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" 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.
has expired and the RLO still has the signal state "1", the query of the timer status for "1" returns the signal
state "1". If the
RLO changes from "1" to "0" while the timer is running, the timer is stopped. In this case, the querying of the
timer status for
"1" returns the signal state "0".
The duration is made up internally of a timer value and a time base. When the instruction is started, the
programmed timer value is counted down towards zero. The time base indicates the time period with
which the timer value is changed.
The "Start on-delay timer" instruction requires a preceding logic operation for edge evaluation and can only
be placed at the right side of the network.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Start on-delay timer" instruction:
The number of
timers depends
on the CPU.
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".
Description
The "Start retentive on-delay timer" instruction starts a programmed timer when a change from "0" to "1"
(positive signal edge) is detected in the result of logic operation (RLO). The timer expires with the
specified duration, even if the RLO changes to the signal state "0". When the timer expires, the querying
of the timer status for "1" returns the signal state "1". After expiry of the timer, the timer can only be
restarted if it is explicitly reset.
The duration is made up internally of a timer value and a time base. When the instruction is started, the
programmed timer value is counted down towards zero. The time base indicates the time period with
which the timer value is changed.
The "Start retentive on-delay timer" instruction requires a preceding logic operation for edge evaluation
and can only be placed at the right side of the network.
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Start retentive on-delay timer" instruction:
The number of
timers depends
on the CPU.
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". 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".
Timer operations (S7-1200, S7- Page 3232 of
1500) 33
Note
In each case, the instruction decrements a specific value by one unit in an interval that is defined by its time
basis until
the time value is equal to "0". The decrementation takes place asynchronous to the user program. The
resulting timer is
therefore always up to one time interval shorter than the time base.
Parameter
The following table shows the parameters of the "Start off-delay timer" instruction:
The number of
timers depends
on the CPU.
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
Timer operations (S7-1200, S7- Page 3333 of
1500) 33
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".