RF_TRIG (Functionblock)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

1.00 / 1.00.00


RF_TRIG is a rising and falling edge detector. It will activate the "rq" output for one execution when a rising edge is detected on the "trig" input. The "fq" output will be active for one scan if a falling edge is detected on "trig" .

 

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

For a falling edge trigger, please see the F_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:

rq : BOOL (true/false)

Output from the rising edge trigger detector.

 

fq : BOOL (true/false)

Output from the falling edge trigger detector.

 

Declaration:

FUNCTION_BLOCK RF_TRIG;
VAR_INPUT
  trig : BOOL; | Falling edge on this signal triggers 'rq' and falling edge triggers 'fq' for one scan
END_VAR;
VAR_OUTPUT
  rq   : BOOL; | Will be active if trig has a rising edge
  fq   : BOOL; | Will be active if trig has a falling edge
END_VAR;

 

Example:

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