TP — Pulse timer

Pin layout

DirectionNameTypeDescription
InputINBOOLTrigger — rising edge starts a pulse
InputPTTIMEPulse duration
OutputQBOOLTRUE for PT after each rising edge of IN
OutputETTIMEElapsed since the pulse started (capped at PT)

Semantics

IN goes FALSE → TRUE  : Q := TRUE; ET starts counting from 0
ET reaches PT          : Q := FALSE
IN stays TRUE / FALSE during the pulse: irrelevant — Q is committed for PT
new rising edge while Q is still TRUE: typically ignored (depends on impl);
                                        matiec retriggers the pulse

TP differs from TON in that the pulse length is fixed at PT, regardless of how long IN stays TRUE. TP differs from TOF in that the pulse starts on the rising edge, not on the falling edge.

Common use: hardware-style monostable; a fixed-length solenoid kick; a “blink one beat” indicator.

Example

VAR
    pulseLamp : TP;
END_VAR

pulseLamp(IN := xButton, PT := T#500ms);
xLamp := pulseLamp.Q;        (* lamp on for 500 ms after each press *)

IEC reference

IEC 61131-3 third edition (2013), Annex F.7.3.

matiec conformance

Implemented per the standard. Re-trigger behaviour during an active pulse is implementation-defined; matiec restarts the elapsed counter.