TP / TPR

PLCopen motion icon

 Function Block - Pulse timer.

Inputs

Input

Data Type

Range

Unit

Default

Description

IN

BOOL

FALSE, TRUE

 

 

Timer command.

PT

TIME

 

 

 

Programmed time.

RST

BOOL

FALSE, TRUE

 

 

Reset (TPR only).

Outputs

Output

Data Type

Range

Unit

Description

Q

BOOL

FALSE, TRUE

 

Timer elapsed output signal.

ET

TIME

 

 

Elapsed time.

Remarks

  • TPR is same as TP but has an extra input for resetting the timer.
  • The timer starts on a rising pulse of IN input.
    • It stops when the elapsed time is equal to the programmed time.
  • A falling pulse of IN input resets the timer to 0 (zero) but only if the programmed time is elapsed.
  • All pulses of IN while the timer is running are ignored.
  • The output signal is set to TRUE while the timer is running.

Time Diagram

Figure 1: Time Diagram

FBD Language Example

FFLD Language Example

  • In the FFLD Language, the input rung is the IN command.
    • The output rung is Q the output signal.

IL Language Example

(* MyTimer is a declared instance of TP function block *)
Op1: CAL MyTimer (IN, PT)
     FFLD  MyTimer.Q
     ST  Q
     FFLD  MyTimer.ET
     ST  ET

ST Language Example

(* MyTimer is a declared instance of TP function block *)
MyTimer (IN, PT);
Q := MyTimer.Q;
ET := MyTimer.ET;

See Also