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) at the start input. The timer expires at the end of the specified time period, even when the RLO changes to signal state "0". 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 restarted with the programmed time period. 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 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.
|
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 "Start extended pulse timer" instruction:
|
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. |
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 time value of the operand "#TagIn_Number" without being affected by a negative signal edge in the RLO.
Network 2:
As long as the timer is running, the "#TagOut" operand returns signal state "1".
Network 3:
If the signal state of the operand "#TagIn_1" changes again from "0" to "1" before the timer expires, the timer is restarted.
The figure below shows the timer diagram of the example: