en:software:qview:qview_6:qcl_library:ir10edgeinp

This translation is older than the original page and might be outdated. See what has changed.

IR10EdgeInp

I = Input

R = Reading functions

The IR10EdgeInp function detects the rising edge of a digital input.

In particular:

  • the function sets the flag on the rising edge whenever the digital input transitions from the incative (value 0) to active state (value 1);
  • the function sets the flag on the falling edge whenever the digital input transitions from the active (value 1) to inactive (value 0).

IR10EdgeInp (Input, FronteUp, FronteDn)

Parameters

IN/OUTVARIABLE TYPEEXAMPLE NAMEDIM
IN INPUT SYSTEM Input F Digital input or variable you want to “capture” the front
OUT GLOBAL FronteUp F Flag on the rising edge
OUT GLOBAL FronteDn F Flag on the falling edge

Example

In the example the “ofUscita” output is set on the rising edge of the input “Input” It is reset on the falling edge of the same input.

IR10EdgeInp ( Input, FronteUp, FronteDn)

IF FronteUp
    FronteUp = 0
    SETOUT ofUscita
ENDIF
IF FronteDw
    FronteDw = 0
    RESOUT ofUscita
ENDIF

Note

  • The function should be placed at a point of the application that runs on every round makes sense in order to be effective.
  • Front capture flags once set remain in the State to set until it is reset outside the function.
  • Last modified: 2019/08/29 17:01