Timer On Delay (TON)

The TON instruction is a non-retentive timer that accumulates time when the instruction is enabled.
The TON instruction accumulates time from the time it is enabled 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 set the .DN bit to true when the timer completes.
When enabled, timing can be paused by setting the .DN bit to true and resumed by clearing the .DN bit to false.
TON Description
Available Languages
Ladder Diagram
Ladder Diagram_Timer On Delay (TON)_v1
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 set 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 TON 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 cleared to zero.
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in
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 cleared to zero.
Rung-condition-in is true
Set Rung-condition-out to Rung-condition-in
See TON Flow Chart (True)
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 cleared to zero.
TON Flow Chart (True)
TON Flow Chart True
Example
Ladder Diagram
FTStudio-TON-LD-EX-V1
When limit_switch_10 is set to true, light_6 is on for 20000 milliseconds (Timer_4 is timing). When Timer_4.acc reaches 20000, light_6 goes off and light_7 goes on. If limit_switch_10 is cleared to false while Timer_4 is timing, light_6 goes off. When limit_switch_10 is cleared to false, Timer_4 status bits and .ACC value are reset.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.