LTP

The LTP function block is a pulse generator with 64-bit time data type (LTIME). This function block can be used to generate pulses with a defined pulse duration.
If IN = FALSE and Q = FALSE, the ET output has the value zero. As soon as IN is set to TRUE, Q = TRUE and remains TRUE for the pulse duration PT. As long as Q = TRUE, the time in nanoseconds is counted up in ET until the setpoint PT is reached. The Q output remains TRUE until the pulse duration has elapsed, irrespective of the state of the IN input.
Graph showing LTP over time:

Inputs
VAR_INPUT
IN : BOOL; (*Trigger for Start of the Signal*)
PT : LTIME; (*The length of the High- Signal*)
END_VARName | Type | Description |
|---|---|---|
IN | BOOL | Rising edge: Start pulse timer and set Q to TRUE |
PT | TIME | Pulse duration (length of the high signal) |
Outputs
VAR_OUTPUT
Q : BOOL; (*The pulse*)
ET : LTIME (*elapsed time since pulse start*)
END_VARName | Type | Description |
|---|---|---|
Q | BOOL | TRUE after a rising edge at the IN input for the pulse duration PT. |
ET | TIME | Elapsed time since the start of the pulse timer. |
Requirements
Development environment | Target platform | PLC library to include |
|---|---|---|
TwinCAT v3.0.0 | PC or CX (x86) | Tc2_Standard |