F_TRIG (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


F_TRIG is a falling edge detector. It will activate the "q" output when a falling edge is detected on the "trig" input.

 

For a rising edge trigger, please see the R_TRIG function block.

 

Input:

trig : BOOL (true/false)

On the falling edge of this input, the output "q" will go high for one scan.

         

Output:

q : BOOL (true/false)

Output from the falling edge trigger detector.

 

Declaration:

FUNCTION_BLOCK F_TRIG;
VAR_INPUT
  trig : BOOL F_EDGE; | Falling edge on this signal activates 'q'.
END_VAR;
VAR_OUTPUT
  q   : BOOL;       | Output from detector
END_VAR;

 

Example:

INCLUDE rtcu.inc
 
VAR_INPUT
  input1 : BOOL; | Input for the falling edge detector
END_VAR;
 
VAR_OUTPUT
  signal : BOOL; | Output that will follow the q output from the falling edge detector.
END_VAR;
 
VAR
  trigger : F_TRIG; // Declare an instance of the F_TRIG functionblock
END_VAR;
 
PROGRAM test;
 
BEGIN
  ...
  trigger(trig:= input1); // Input the input1 signal to the falling edge detector
  signal := trigger.q; // output will follow the q output from the detector
  ...
END;
END_PROGRAM;