Skip to main content

Timers

Timers measure elapsed time. A timer instruction references a TIMER tag, which is a structure with a preset, an accumulator, and three status bits.

Available Timer Instructions

InstructionSymbolPurpose
TON

TON

Timer

timer

(EN)

Preset

?

(DN)

Accum

?

On-delay timer. Starts timing when the rung goes true; sets .DN when .ACC reaches .PRE. Resets the moment the rung goes false.
TOF

TOF

Timer

timer

(EN)

Preset

?

(DN)

Accum

?

Off-delay timer. Starts timing when the rung goes false; holds .DN at 1 for the preset duration after the rung drops.
RTO

RTO

Timer

timer

(EN)

Preset

?

(DN)

Accum

?

Retentive on-delay timer. Like TON, but the accumulator survives rung transitions. Must be cleared explicitly with RES.

TIMER Tag Members

Every TIMER tag exposes the same fields. Access them with a dot (MyTimer.DN).

MemberTypeMeaning
.PREDINTPreset — target time in milliseconds
.ACCDINTAccumulated time in milliseconds
.ENBOOLEnable — 1 while the rung is true
.TTBOOLTiming — 1 while accumulating toward .PRE
.DNBOOLDone — each timer (TON, TOF, RTO) decides when this turns on

Reference these members as contacts:

XIC(MyTimer.DN)OTE(Light)

Setting the Preset

The preset is stored on the timer tag, not inside the instruction. There are two ways to set it:

  • From the rung: click the Preset row on the TON, TOF, or RTO block and type the value. This edits the .PRE default of the underlying TIMER tag in place — no need to leave the ladder editor.
  • From the Tag editor: expand the timer tag's row and edit the Default Value of .PRE.

Either way, the value is the target time in milliseconds: 5000 = 5 seconds. The Accum row on the block is editable the same way and sets the .ACC default, which is mainly useful for tests that start mid-count.

Units

All timer values are in milliseconds. There is no separate time base — always multiply seconds by 1000.