LTOF

LTOF 1:

The LTOF function block implements a timer with switch-off delay with 64-bit time data type (LTIME).

If IN = TRUE, the Q output has the value TRUE and the ET output has the value zero. As soon as IN is set to FALSE, the time in nanoseconds is counted up in ET until the setpoint PT is reached. Q is FALSE, if IN = FALSE and ET = PT. Otherwise Q = TRUE.

Graph showing LTOF over time:

LTOF 2:

LTOF 3: Inputs

VAR_INPUT
    IN : BOOL; (*starts timer with falling edge, resets timer with rising edge*)
    PT : LTIME; (*time to pass before Q is reset*)
END_VAR

Name

Type

Description

IN

BOOL

Falling edge: Start timer

Rising edge: Reset timer

PT

TIME

Delay time (time that elapses before Q is reset)

LTOF 4: Outputs

VAR_OUTPUT
    Q  : BOOL; (*is FALSE, PT seconds after IN had a falling edge*)
    ET : LTIME; (*elapsed time since falling edge at IN*)
END_VAR

Name

Type

Description

Q

BOOL

TRUE if the IN input is TRUE.

FALSE if the IN input is FALSE and the time specified in PT has expired.

ET

BOOL

Elapsed time since the falling edge at the IN input.

Requirements

Development environment

Target platform

PLC library to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard