Timer Off Delay (TOF)
The TOF instruction is a non-retentive timer that accumulates time when the instruction is enabled (rung-condition-in is false).
The TOF instruction accumulates time until:
- The timer is disabled
- The timer completes
The time base is always 1 millisecond. For example, for a 2 second timer, enter 2000 for the .PRE value.
The timer will clear the .DN bit to false when the timer completes.
When enabled, timing can be paused by clearing the .DN bit to false and resumed by setting the .DN bit to true.
Available Languages
Ladder Diagram
Operands
IMPORTANT:
Unexpected operation may occur if:
- Output tag operands are overwritten.
- Members of a structure operand are overwritten.
- Except when specified, structure operands are shared by multiple instructions.
Ladder Diagram
Operand | Data Type | Format | Description |
---|---|---|---|
Timer | TIMER | tag | Timer structure |
Preset | DINT | immediate | Value of Timer.PRE. |
Accum | DINT | immediate | Value of Timer.ACC. |
TIMER Structure
Mnemonic | Data Type | Description |
---|---|---|
.EN | BOOL | The enable bit contains rung-condition-in when the instruction was last executed. |
.TT | BOOL | The timing bit when set indicates the timing operation is in process. |
.DN | BOOL | The done bit when cleared indicates the timing operation is complete (or paused). |
.PRE | DINT | The preset value specifies the value (1 millisecond units) which the accumulated value must reach before the instruction indicates it is done. |
.ACC | DINT | The accumulated value specifies the number of milliseconds that have elapsed since the TOF instruction was enabled. |
How a Timer Runs
A timer runs by subtracting the time of its last scan from the current time:
ACC = ACC + (current_time - last_time_scanned)
After it updates the ACC, the timer sets last_time_scanned = current_time. This gets the timer ready for the next scan.
Affects Math Status Flags
No
Major/Minor Faults
A major fault will occur if: | Fault type | Fault code |
---|---|---|
.PRE < 0 | 4 | 34 |
.ACC < 0 | 4 | 34 |
See Index through arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State | Action Taken |
---|---|
Prescan | The .EN bit is cleared to false. The .TT bit is cleared to false. The .DN bit is cleared to false. The .ACC value is set to equal the .PRE value. |
Rung-condition-in is false | Set Rung-condition-out to Rung-condition-in See TOF Flow Chart (False). |
Rung-condition-in is true | Set Rung-condition-out to Rung-condition-in The .EN bit is set to true. The .TT bit is cleared to false. The .DN bit is set to true. The .ACC value is cleared to zero. |
Postscan | The .EN bit is cleared to false. The .TT bit is cleared to false. The .DN bit is cleared to false. The .ACC value is set to equal the .PRE value. |
TOF Flow Chart (False)
Example
Ladder Diagram
When limit_switch_9 is cleared, light_8 is on for 180 milliseconds (timer_2 is timing). When timer_2.acc reaches 180, light_8 goes off and light_4 goes on. Light_4 remains on until the TOF instruction is enabled. If limit_switch_9 is true while timer_2 is timing, light_8 goes off.
Provide Feedback