FUNCTION_BLOCK WTAV_UINT

Hover on a highlighted element
to pop up its description (if any).


ECC
ALGORITHM REQ IN Java :
  final float eta
     = (float) Math.max(0.0, Math.min(1.0, ETA.value));
  ((UINT) OUT).value
      = (int) ((1.0 - eta) * ((UINT) IN1).value
                + eta * ((UINT) IN2).value);
END_ALGORITHM
			

As illustrated by the Execution Control Chart (ECC) and algorithm shown above, upon the occurrence of an event at the REQ input of an instance of this Basic Function Block type, the OUT value is set to the (truncated, not rounded) weighted average of the two UINT inputs X1 and X2, following which an event is issued at the REQ output.

As shown above, the weighting factor ETA is internally limited to the range {0.0..1.0} prior to the computation of the weighted average.

See the DSCYL_MDL FB type for an example of the use of an instance of this type.