Skip to main content

7.3.2 TON_TIME

Function

TON_TIME is called the standard turn-on delay timer. Its function is to delay the turn-on of the signal and is used to time a single time interval

LD graphics

alt text

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

  • The input bit IN value changes from "FALSE" to "TRUE", and the timer starts

  • When the ET value is less than the PT value (that is, ET is timing), if the IN value is reset, the ET value immediately returns to zero. If the IN value is "TRUE", the ET value starts timing from zero

  • When the ET value is equal to the PT value, the IN value is "TRUE", the Q value output is "TRUE", the IN value is "FALSE", the Q value output is "FALSE"

  • Function block example:

    • Signal delay is 5 seconds to connect
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:
TON_TIME_1(
IN:=IN1,
PT:=T#1s,
Q=>OUT,
ET=>ET
);

IF OUT THEN
iVar:=iVar+1;
else
iVar:=0;
END_IF;