Timers

To use a timer in your program, place a timer function in the Ladder and assign it a Data Tag. Each Timer function has a single input which is the Data Tag name of the timer. UniLogic automatically creates a Data Tag Struct containing the Preset Value, the Current Value, and the Timer Out bit.

Note

You can set the Preset Value as a Retained Value. Other timer struct members may not be set as retained.

 

Timer Struct

Timers decrement (count down) from the Preset Value until the Current Value reaches 0; then the Timer Out bit turns ON or OFF, depending on the timer type. Timer resolution is in milliseconds.

Since UniStream devices use dynamic memory allocation, the number of Timers is virtually unlimited. UniLogic offers the following types of Timers:

TON Timer (On Delay Timer, or Delay Timer (TD))TON Timer (On Delay Timer, or Delay Timer (TD))

Use this timer to delay turning an output ON. The TD Timer Out bit turns ON when the timer has finished running.

  1. The Preset Value is initially loaded into the Current Value the first time that the TD element is seen in the program scan.

  2. When the input condition of a TON timer rises (positive RLO), the Timer begins to decrement.

  3. When the current value of the timer reaches 0, and the timer's input condition is still ON, the Timer Out bit turns ON.
    The Timer Out bit remains ON until the input condition falls (negative RLO).

  4. When the input condition of the TON timer falls (negative RLO), the Preset Value is loaded into the Current Value.

If the input condition falls while the timer is running:

 

TOF Timer (Off Delay Timer)TOF Timer (Off Delay Timer)

Use this timer to delay turning an output OFF. The TOF Timer Out bit turns OFF when the timer has finished running.

When the input condition of a TOF timer rises (positive RLO):

When the input condition falls (negative RLO):

If the timer's input condition rises while the timer is decrementing, the Timer Out bit remains ON and the timer stops running. The current value is not retained.

 

Note

The timer can be reset at any time via the Timer Reset function.

 

TA Timer (Accumulated, Retentive Timer)TA Timer (Accumulated, Retentive Timer)

The TA timer functions like a TON timer with two differences:

When the input condition of a TA timer rises (positive RLO):

 

TP Timer (Pulse Timer)TP Timer (Pulse Timer)

Use this timer to generate a pulse of specific duration. The TP Timer Out bit is ON when the timer is running and OFF at all other times.

When the input condition of a TP timer rises (positive RLO):

Once the timer is running, it continues regardless of the state of the input condition.

When the current value of the timer reaches 0:

When the input condition of a TP timer falls (negative RLO):

TON Timer diagram

Note

The timer can be reset (reloaded) at any time via the Timer Reset function

 

TE Timer (Extended Pulse Timer)TE Timer (Extended Pulse Timer)

The TE timer functions like a TP timer with this difference:

When the current value of the timer reaches 0, the Timer Done value turns OFF.

TON Timer diagram

 

Note

The timer can be reset (reloaded) at any time via the Timer Reset function.

 

In addition, there is a separate Timer Reset function. This MUST be used to reset the Current Value of a TA, but may be used to reset any timer.

Related Topics

LF: Timer Reset

HE: Timer Box

Ladder Editor

Regions and Jumps

Disable/Enable Nets

User-Defined Function Blocks (UDFBs)