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) at the start input. The timer expires with the specified duration. As long as the timer is running, the query of timer status "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 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 queries of the timer status for "1" return the query result "1" if the signal state of the result of logic operation is "1" at the execution of the instruction. If the RLO is "0", queries of the timer status for "1" return the query result "0".
The "Start off-delay timer" instruction requires a preceding logic operation for the edge evaluation and can only be placed at the right side of the network.
|
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 here: L: Load timer value |
Parameters
The following table shows the parameters of the instruction "Start off-delay timer":
|
Parameters |
Declaration |
Data type |
Memory area |
Description |
|---|---|---|---|---|
|
<Operand> |
Input |
BOOL |
I, Q, M, T, C, D, L, P |
Start input |
|
TV |
Input |
S5TIME, WORD |
I, Q, M, D, L or constant |
Time duration |
|
<Timer> |
Input |
TIMER |
T |
Timer which is started. The number of timers depends on the CPU. |
You can find more information on the valid data types under "See also".
Example
The following example shows how the instruction works:
Network 1:
"#Timer_1" starts when the signal state of the "#TagIn_1" operand changes from "1" to "0". The timer expires with the value of operand "#TagIn_Number".
Network 2:
As long as the timer is running, the "#TagOut" operand is set to "1".
Network 3:
If the signal state at the "#TagIn_1" operand 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 time value to "0".
The figure below shows the timer diagram of the example: