en:software:qview:qview_6:qcl_library:ir10edge

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:software:qview:qview_6:qcl_library:ir10edge [2017/01/20 11:50] – [1.2. Note] qem103en:software:qview:qview_6:qcl_library:ir10edge [2019/08/29 17:01] (current) – external edit 127.0.0.1
Line 1: Line 1:
 +====== 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/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.|
 +
 +=== Example ===
 +
 +In the example the "ofUscita" output is activated on the rising edge of the input "Input" after a check of 1 second.
 +
 +<code QCL>
 +gfInit = 0
 +
 +MAIN:
 +</code>
 +**IR10Edge ( Input, 1, 1000, gfInit, gfResult)**
 +<code QCL>
 +IF gfResult
 +     gfResult = 0
 +     SETOUT ofUscita
 +ENDIF
 +gfInit = 1
 +
 +WAIT 1
 +JUMP MAIN
 +END
 +</code>
 +
 +=== Note ===
 +
 +  * In order to be effective, the function should be placed at a point of the application that runs on every logical round.
 +  * The result flag is set to 1 only if the front condition it occurs, otherwise it remains unchanged.  
 +  * The Init flag this is useful if the unit was reactivated with TRESTART command and allows to initialize the function.