Skip to main content

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

alt text

  • Disconnect delay timer timing diagram:

alt text

Parameter description

Interface variableDeclarationData typeDescription
INVar_InputBOOLStart input bit
PTVar_InputTIMESet time input
QVar_OutputBOOLOutput bit
ETVar_OutputTIMEElapsed 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:

alt text

  • 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;