Vous êtes sur la page 1sur 16

SIMATIC Timers (S7-1500)

SIMATIC Timers
This chapter contains the following information:

S_PULSE: Assign pulse timer parameters and start (S7-1500)

S_PEXT: Assign extended pulse timer parameters and start (S7-1500)

S_ODT: Assign on-delay timer parameters and start (S7-1500)

S_ODTS: Assign retentive on-delay timer parameters and start (S7-1500)

S_OFFDT: Assign off-delay timer parameters and start (S7-1500)

---( SP ): Start pulse timer (S7-1500)

---( SE ): Start extended pulse timer (S7-1500)

---( SD ): Start on-delay timer (S7-1500)

---( SS ): Start retentive on-delay timer (S7-1500)

---( SF ): Start off-delay timer (S7-1500)

S_PULSE: Assign pulse timer parameters and start


Description
The "Assign 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) as soon as the signal state at input S is "1". If the signal state at input S changes to "0" before the
programmed duration expires, the timer is stopped. In this case, the signal state at output Q is "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 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 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 pulse timer parameters and start":
Parameter

Declaration

Data type

Memory area

Descripti

<Timer>

InOut/Input

TIMER

on
Timer of
the
instruction

SIMATIC Timers (S7-1500)

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

For additional information on valid data types, refer to "See also".


Timing diagram
The following figure shows the timing diagram of the instruction "Assign pulse timer parameters and start":

SIMATIC Timers (S7-1500)

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".

S_PEXT: Assign extended pulse timer parameters and


start
Description
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":
Parameter
Description

Declaration

Data type

Memory area

SIMATIC Timers (S7-1500)

<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

For additional information on valid data types, refer to "See also".


Timing diagram
The following figure shows the timing diagram of the "Assign extended pulse timer parameters and start"
instruction:

SIMATIC Timers (S7-1500)

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".

S_ODT: Assign on-delay timer parameters and start


Description
The "Assign on-delay 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) 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:

SIMATIC Timers (S7-1500)

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

For additional information on valid data types, refer to "See also".


Timing diagram
The following figure shows the timing diagram of the "Assign on-delay timer parameters and start"
instruction:

SIMATIC Timers (S7-1500)

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.

S_ODTS: Assign retentive on-delay timer parameters and


start
Description
The "Assign retentive on-delay 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". If the
timer has expired, the "Q" output returns signal state
"1" regardless of the signal state at input "S". 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.
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:
Parameter

Declaration

Data type

Memory area

Descripti

<Timer>

InOut/Input

TIMER

on
Timer of
the

SIMATIC Timers (S7-1500)

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

For additional information on valid data types, refer to "See also".


Timing diagram
The following figure shows the timing diagram of the "Assign retentive on-delay timer parameters and start"
instruction:

Example
The following example shows how the instruction works:

SIMATIC Timers (S7-1500)

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.

S_OFFDT: Assign off-delay timer parameters and start


Description
The "Assign off-delay timer parameters and start" instruction starts a programmed timer when a change
from "1" to "0" (negative signal edge) is detected in the result of logic operation (RLO) at input S. The timer
expires with the programmed duration (TV). As long as the timer is running or input S returns signal state
"1", then output Q has signal state
"1". When the timer expires and the signal state at input S is "0", output Q is reset to the signal state "0". If
the signal state at
input S changes from "0" to "1" while the timer is running, the timer is stopped. The timer is only restarted
after a falling
signal edge is detected at input S.
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.
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:
Parameter

Declaration

Data type

Memory area

Description

<Timer>

InOut/Input

TIMER

Timer of the
instruction
The number of
timers depends
on the CPU.

SIMATIC Timers (S7-1500)

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

For additional information on valid data types, refer to "See also".


Timing diagram
The following figure shows the timing diagram of the "Assign off-delay timer parameters and start"
instruction:

Example
The following example shows how the instruction works:

SIMATIC Timers (S7-1500)

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.

---( SP ): Start pulse timer


Description
The "Start pulse 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 time runs with the specified duration as
long as the RLO has the signal state "1". As long as the timer is running, the querying of the timer status for
"1" returns the signal state "1". If there is a change from "1" to "0" in the RLO before the timer value has
elapsed, the timer stops. 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 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 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:

SIMATIC Timers (S7-1500)

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".

---( SE ): Start extended pulse timer


Description
The "Start extended pulse 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". As long as the timer is running, the querying of the
timer status for "1" returns the signal state "1". If the RLO changes from "0" to "1" while the timer is
running, the timer is restarted with the programmed duration. The querying of the timer status for "1"
returns the signal state "0" when the timer expires.
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:
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.

SIMATIC Timers (S7-1500)

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" 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.

---( SD ): Start on-delay timer


Description
The "Start 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 runs for the specified duration as
long as the RLO is "1". If the timer 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:
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.

SIMATIC Timers (S7-1500)

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".

---( SS ): Start retentive on-delay timer


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:
Parameter
Description

Declaration

Data type

Memory area

SIMATIC Timers (S7-1500)

<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". 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".

---( SF ): Start off-delay timer


Description
The "Start off-delay timer" instruction starts a programmed timer when a change from "1" to "0" (negative
signal edge) is detected in the result of logic operation (RLO). The timer expires with the specified duration.
As long as the timer is running, the querying of the timer status for "1" returns the signal state "1". If the
RLO changes from "0" to "1" while the timer is running, the timer is reset. The timer is always restarted
when the RLO changes from "1" 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 off-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

SIMATIC Timers (S7-1500)

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".

Vous aimerez peut-être aussi