Description
The "Assign extended pulse timer parameters and start" instruction starts a programmed timer when a transition 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, output Q has the signal state "1". When the timer has expired, 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 time value and a time base and is programmed at parameter TV. When the instruction is started, the programmed time value is counted down to zero. The time base determines the time period of the time value. The current time value is output binary-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", the current time 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 effect.
The "Assign extended pulse timer parameters and start" instruction needs a preceding logic operation for the edge evaluation and can be placed within or at the end of the network.
The instruction data is updated with each access. It can therefore happen that the query of the data at the start of the cycle returns different values than at the end of the cycle.
|
Note In the time cell, the operating system reduces the time value in an interval specified by the time base by one unit until the value equals "0". The decrementation is performed asynchronously to the user program. The resulting timer is therefore at maximum up to one time interval shorter than the desired time base. |
You can find an example of how a time cell can be formed under: See also "L: Load timer value".
Parameters
The following table shows the parameters of the "Assign extended pulse timer parameters and start" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
<Timer> |
InOut/Input |
TIMER |
T |
Time of the instruction The number of timers depends on the CPU. |
|
S |
Input |
BOOL |
I, Q, M, T, C, D, L, P or constant |
Start input |
|
TV |
Input |
S5TIME, WORD |
I, Q, M, D, L or constant |
Time duration |
|
R |
Input |
BOOL |
I, Q, M, T, C, D, L, P or constant |
Reset input |
|
BI |
Output |
WORD |
I, Q, M, D, L, P |
Current time value (binary-coded) |
|
BCD |
Output |
WORD |
I, Q, M, D, L, P |
Current time value (BCD format) |
|
Q |
Output |
BOOL |
I, Q, M, D, L, P |
Status of the timer |
For additional information on valid data types, refer to "See also".
Pulse timing diagram
The following figure shows the pulse timing diagram of the "Assign extended pulse timer parameters and start" instruction:
Example
The following example shows how the instruction works:
"Timer_1" starts when the signal state of the "TagIn_1" operand changes from "0" to "1". The timer runs for the time value of the "TagIn_Number" operand without being affected by a negative edge at the S input. If the signal state at the "TagIn_1" operand changes from "0" to "1" before the timer expires, the timer is restarted.
The "TagOut" operand has the signal state "1" as long as the timer is running. When the time has expired or is reset, the "TagOut" operand is reset to "0".