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", output Q has signal state "1". If the timer expires and the signal state is "0", output Q is reset to 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 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 specifies the time period with which the time value is changed. The current time value is output binary-coded at output BI and BCD-coded at output BCD.
Signal state "1" at input R resets the current time 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 the 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 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 off-delay timer parameters and start" instruction:
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
<Timer> |
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 |
You can find more information on the valid data types under "See also".
Pulse timing diagram
The following figure shows the pulse timing diagram of the "Assign off-delay timer parameters and start" instruction:
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 time value of the operand "TagIn_Number". The operand "TagOut" is set to "1" if the timer is running or 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.