I = Input
R = Reading functions
The IR10Edge function detects the rising edge or falling is a digital signal.
IR10Edge (Input, Type, Time, Init, Result)
Parameters:
IN/OUT | VARIABLE TYPE | EXAMPLE NAME | DIM | |
---|---|---|---|---|
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. |
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