7.3.3 TOF_TIME
Function
TOF_TIME is called the standard disconnection delay timer, which is used to delay a certain period of time after IN is disconnected
LD graphics
- Disconnect delay timer timing diagram:

Parameter description
| Interface variable | Declaration | Data type | Description |
|---|---|---|---|
| IN | Var_Input | BOOL | Start input bit |
| PT | Var_Input | TIME | Set time input |
| Q | Var_Output | BOOL | Output bit |
| ET | Var_Output | TIME | Elapsed time |
Corresponding syntax
- When the IN value is "TRUE", the Q value output is "TRUE"
- When the IN value changes from "TRUE" to "FALSE", the timer starts
- At any time, as long as the IN value changes to "TRUE", ET stops timing and returns to 0
- When the ET value is equal to the PT value, the Q value output is "FALSE"
Don’t forget the definition
Function block usage requires global declaration of an instance
Example
- LD example is shown in the following animation:

- ST example is shown in the following code:
TOF_TIME_1(
IN:=IN1,
PT:=T#1s,
Q=>OUT,
ET=>ET
);
IF OUT THEN
iVar:=iVar+1;
else
iVar:=0;
END_IF;