R_TRIG

R_TRIG 1:

The R_TRIG function block is a rising edge detector.

As long as the CLK input variable = FALSE, the Q output = FALSE. As soon as CLK = TRUE, Q is set to TRUE for one cycle. This means that each time the function is called, Q returns FALSE until CLK has a falling edge and then a rising edge.

R_TRIG 2: Inputs

VAR_INPUT
    CLK : BOOL; (* Signal to detect *)
END_VAR

Name

Type

Description

CLK

BOOL

Boolean signal to be checked

R_TRIG 3: Outputs

VAR_OUTPUT
    Q : BOOL; (* Edge detected *)
END_VAR

Name

Type

Description

Q

BOOL

TRUE for a rising edge at the CLK input (for one cycle)

Requirements

Development environment

Target platform

PLC library to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard