TOF

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:

The TOF function block requires 15 bytes of data.
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_VARName | Type | Description |
|---|---|---|
IN | BOOL | Falling edge: Start timer Rising edge: Reset timer |
PT | TIME | Delay time (time that elapses before Q is reset) |
Outputs
VAR_OUTPUT
Q : BOOL; (* is FALSE, PT seconds after IN had a falling edge *)
ET : TIME; (* elapsed time *)
END_VARName | 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 |