TOF

TOF 1:

The TOF function block implements a timer with a switch-off delay.

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 milliseconds 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 TOF over time:

TOF 2:

The TOF function block requires 15 bytes of data.

TOF 3: Inputs

VAR_INPUT
    IN : BOOL; (* starts timer with falling edge, resets timer with rising edge *) 
    PT : TIME; (* 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)

TOF 4: Outputs

VAR_OUTPUT
    Q  : BOOL; (* is FALSE, PT seconds after IN had a falling edge *)
    ET : TIME; (* elapsed time *)
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