Generates a fixed-duration pulse on the output when the input has a rising edge.
The TP (Timer Pulse) instruction generates a pulse of fixed duration, as defined in IEC 61131-3. When the input .IN transitions from FALSE to TRUE (rising edge), the output .Q becomes TRUE and remains TRUE for exactly the preset time .PT, regardless of what happens to the input.
Key behavior:
.Q becomes TRUE, timer startsTRUE even if input goes FALSE.Q becomes FALSEThis is useful for generating a fixed-duration signal, such as a brief activation of a solenoid, a timed light flash, or a measured dispensing operation.
Unlike
TON, theTPtimer is non-retriggerable. A new pulse cannot start until the current pulse finishes.
{GIF:HERE} - Adding a TP pulse timer action to a step with name "timer_name", description "Timer description", instruction set to TP, and duration of 2000 ms
from automation_machine import ActionInstruction
step.add_action("timer_name", "Timer description", instruction=ActionInstruction.TP, duration=2000)
ActionQualifier enum (default: ActionQualifier.N, keep timer running while step active)ActionInstruction.TP2000 for 2 seconds)Each TP timer instance exposes the following child variables:
| Variable | Type | Description |
|---|---|---|
.IN |
BOOL | Input signal - rising edge triggers the pulse |
.Q |
BOOL | Output signal - TRUE for the duration of the pulse |
.PT |
TIME | Preset time - the configured pulse duration |
.ET |
TIME | Elapsed time - the current time since the pulse started |