Off-delay timer TOF
Keeps DN on for PRE after the rung goes false.
Global.RunXIC
Global.FanRunOnTOF
PRE 5000 ACC 0 EN 0 TT 1 DN 1
| Tag | After two scans |
|---|---|
| FanRunOn | PRE 5000 ACC 0 EN 0 TT 1 DN 1 |
| Run | 0 |
How it works
DN is 1 while the rung is true. After the rung goes false it times; DN stays 1 until ACC reaches PRE, then clears.
How it's used
Use TOF to keep something on after its rung goes false, such as a cooling fan after a motor stops.
Global.MotorXIC
Global.FanRunOnTOF
PRE 5000 ACC 0 EN 0 TT 1 DN 1
Global.FanRunOn.DNXIC
Global.FanOTE
| Tag | Value |
|---|---|
| Motor | 0 |
| FanRunOn | PRE 5000 ACC 0 EN 0 TT 1 DN 1 |
| Fan | 1 |
Motor is off. Fan stays on until ACC reaches 5000.
Operands
| Operand | Data type | Read or write |
|---|---|---|
| Timer | TIMER | Reads and writes |
Inside a TIMER tag
| Member | Type | Meaning |
|---|---|---|
| .PRE | DINT | Preset: the time to reach, in ms |
| .ACC | DINT | Accumulated: the time so far, in ms |
| .EN | BOOL | On while the rung is true |
| .TT | BOOL | On while the timer is timing |
| .DN | BOOL | On while the rung is true and through the off delay; clears when the delay ends |
Common mistakes
- Waiting for DN to come on laterA TOF turns DN on at once. The delay happens after the rung goes false.
- Using one TIMER tag in two timersEach timer writes ACC, TT and DN, so the first one in the scan changes them before the next one runs. Problems shows this as written by 2 timers. Give each timer its own tag, unless you want that order.
Learn it in a lesson
- Off-delay and retentive timersIntermediate · 25 min