Sei sulla pagina 1di 3

Timer On Delay (TON) Page 1 of 3

Timer On Delay (TON)

The TON instruction is a non-retentive timer that accumulates time when the instruction is enabled (rung-condition-in is
true).

Available Languages

Ladder Diagram

Function Block
This instruction is available in function block as TONR.

Structured Text
This instruction is available in structured text as TONR.

Operands

Ladder Diagram

Operand Type Format Description


Timer TIMER tag timer structure
Preset DINT immediate how long to delay (accumulate time)
Accum DINT immediate total msec the timer has counted
initial value is typically 0

TIMER Structure

Mnemonic Data Description


Type
.EN BOOL The enable bit indicates the TON instruction is enabled.
.TT BOOL The timing bit indicates that a timing operation is in process
.DN BOOL The done bit indicates that .ACC  .PRE.
.PRE DINT The preset value specifies the value (1 msec units) which the
accumulated value must reach before the instruction sets the .DN bit.
.ACC DINT The accumulated value specifies the number of milliseconds that have
elapsed since the TON instruction was enabled.

Description

The TON instruction accumulates time until:

 the TON instruction is disabled

 the .ACC  .PRE

The time base is always 1 msec. For example, for a 2 second timer, enter 2000 for the .PRE value.
When the TON instruction is disabled, the .ACC value is cleared.

mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 08-Mar-19
Timer On Delay (TON) Page 2 of 3

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.
Important: Be sure to scan the timer at least every 69 minutes while it runs. Otherwise, the ACC value won’t be correct.
The last_time_scanned value has a range of up to 69 minutes. The timer’s calculation rolls over if you don’t scan the timer
within 69 minutes. The ACC value won’t be correct if this happens.
While a timer runs, scan it within 69 minutes if you put it in a:

 subroutine

 section of code that is between JMP and LBL instructions

 sequential function chart (SFC)

 event or periodic task

 state routine of a phase

Arithmetic Status Flags

Not affected

Fault Conditions

A major fault will occur if: Fault Fault code


type
.PRE < 0 4 34
.ACC < 0 4 34

Execution

Ladder Diagram

Condition Action
prescan The .EN bit is cleared.
The .TT bit is cleared.

mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 08-Mar-19
Timer On Delay (TON) Page 3 of 3

The .DN bit is cleared.


The .ACC value is cleared.
The rung-condition-out is set to false.
rung-condition-in is false The .EN bit is cleared.
The .TT bit is cleared.
The .DN bit is cleared.
The .ACC value is cleared.
The rung-condition-out is set to false.
rung-condition-in is true flowchart
postscan The rung-condition-out is set to false.

Example

Ladder Diagram

Related Instructions

TOF, RTO

Related Topics
Counter Instructions

mk:@MSITStore:C:\Program%20Files%20(x86)\Rockwell%20Software\RSLogix%2050... 08-Mar-19

Potrebbero piacerti anche