TP

TP 1:

The TP function block, a pulse generator, can be used to generate pulses with a defined pulse duration.

If IN = FALSE and Q = FALSE, the ET output has the value zero. As soon as IN is set to TRUE, Q = TRUE and remains TRUE for the pulse duration PT. As long as Q = TRUE, the time in milliseconds is counted up in ET until the setpoint PT is reached. The Q output remains TRUE until the pulse duration has elapsed, irrespective of the state of the IN input.

Graph showing TP over time:

TP 2:

The TP function block requires 14 bytes of data.

TP 3: Inputs

VAR_INPUT
    IN : BOOL; (* Trigger for Start of the Signal *)
    PT : TIME; (* The length of the High-Signal in ms *)
END_VAR

Name

Type

Description

IN

BOOL

Rising edge: Start pulse timer and set Q to TRUE

PT

TIME

Pulse duration (length of the high signal)

TP 4: Outputs

VAR_OUTPUT
    Q  : BOOL; (* The pulse *)
    ET : TIME; (* The current phase of the High-Signal *)
END_VAR

Name

Type

Description

Q

BOOL

TRUE after a rising edge at the IN input for the pulse duration PT.

ET

TIME

Elapsed time since the start of the pulse timer.

Requirements

Development environment

Target platform

PLC library to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard