LTP

LTP 1:

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:

LTP 2:

LTP 3: Inputs

VAR_INPUT
    IN : BOOL; (*Trigger for Start of the Signal*)
    PT : LTIME; (*The length of the High- Signal*)
END_VAR

Name

Type

Description

IN

BOOL

Rising edge: Start pulse timer and set Q to TRUE

PT

TIME

Pulse duration (length of the high signal)

LTP 4: Outputs

VAR_OUTPUT
    Q  : BOOL; (*The pulse*)
    ET : LTIME (*elapsed time since pulse start*)
END_VAR

Name

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