Starts timing when the input becomes TRUE and sets the output to TRUE after the preset time elapses.
The TON (Timer On-Delay) instruction implements a delay-on timer, as defined in IEC 61131-3. When the input .IN becomes TRUE, the timer starts counting. After the elapsed time .ET reaches the preset time .PT, the output .Q becomes TRUE.
If the input .IN goes FALSE before the preset time is reached, the timer resets and the elapsed time returns to zero. The output .Q remains FALSE.
Key behavior:
.Q becomes TRUE.Q becomes FALSEThis is the most commonly used timer type. It is ideal for delaying the activation of an output, such as waiting a few seconds before starting a motor or confirming a sensor signal is stable.
{GIF:HERE} - Adding a TON on-delay timer action to a step with name "timer_name", description "Timer description", instruction set to TON, and duration of 5000 ms
from automation_machine import ActionInstruction
step.add_action("timer_name", "Timer description", instruction=ActionInstruction.TON, duration=5000)
ActionQualifier enum (default: ActionQualifier.N, keep timer running while step active)ActionInstruction.TON5000 for 5 seconds)Each TON timer instance exposes the following child variables:
| Variable | Type | Description |
|---|---|---|
.IN |
BOOL | Input signal - activates the timer when TRUE |
.Q |
BOOL | Output signal - becomes TRUE when .ET >= .PT |
.PT |
TIME | Preset time - the configured delay duration |
.ET |
TIME | Elapsed time - the current accumulated time since .IN became TRUE |