TON

TON 1:

The TON function block implements a timer with a switch-on delay.

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

Graph showing TON over time:

TON 2:

The TON function block requires 15 bytes of data.

TON 3: Inputs

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

Name

Type

Description

IN

BOOL

Rising edge: Start timer

Falling edge: Reset timer

PT

TIME

Delay time (time elapsed before Q is set)

PT

TIME

Delay time (time elapsed before Q is set)

TON 4: Outputs

VAR_OUTPUT
    Q  : BOOL; (* is TRUE, PT seconds after IN had a rising edge *)
    ET : TIME; (* elapsed time *)
END_VAR

Name

Type

Description

Q

BOOL

FALSE if the IN input is FALSE.

TRUE if the IN input is TRUE and the time specified in PT has elapsed.

ET

TIME

Elapsed time since the rising edge at the IN input.

Requirements

Development environment

Target platform

PLC library to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard