Description
The "Start on-delay timer" instruction starts a programmed timer when the signal state "1" is detected at the start input. As long as this signal state remains "1", the timer expires with the specified duration. When the timer expires and the signal state at the start input is still "1", the query for timer status also returns "1". If the signal at the start input is "0", the timer is reset. In this case, querying the timer status returns the signal state "0". As soon as the signal at the start input changes to "1" again, the timer starts running again.
The signal state of the timer output is identical to the signal state of the start input. The start input is directly interconnected to the output and is not linked to the timer.
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.
|
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 on-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 "0" to "1". The timer expires with the value of operand "#TagIn_Number". If the signal state of the "#TagIn_1" operand changes from "1" to "0" before the timer expires, the timer is reset.
Network 2:
When the timer has expired, the operand #TagIn_1 at the start input has the signal state"1" and timer was not reset, the operand #TagOut is set to "1".
Network 3:
When the signal state of the #TagIn_2 operand has signal state "1", the timer #Timer_1 and the output #TagOut are reset.
If you want to restart #Timer_1, the signal state at the #TagIn_2 operand must be "0" and the signal state at the start input #TagIn_1 must change from "0" to "1".
The figure below shows the timer diagram of the example: