IR10Edge

I = Input

R = Reading functions

The IR10Edge function detects the rising edge or falling is a digital signal.

IMPLEMENTATION

IR10Edge (Input, Type, Time, Init, Result)

Parameters:

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN INPUT GLOBAL Input F Digital status to be analyzed
IN CONST Type F Front type to be analyzed, 0 for descent, 1 to rise.
IN CONST Time L Time signal verification. With zero value the time to check is disabled.
IN GLOBAL Init F Flag to inform if is the first execution of the function (0 for first time, 1 for subsequent)
OUT GLOBAL Result F Flag set to 1 when it encounters the front, otherwise it is left unchanged.

Example

In the example the “ofUscita” output is activated on the rising edge of the input “Input” after a check of 1 second.

gfInit = 0
 
MAIN:

IR10Edge ( Input, 1, 1000, gfInit, gfResult)

IF gfResult
     gfResult = 0
     SETOUT ofUscita
ENDIF
gfInit = 1
 
WAIT 1
JUMP MAIN
END

Note