blockRealExtractor

Extract scalar signal out of real signal vector dependent on integer input index

Information

Block that returns

    y = u[index];

where u is a vector-valued Real input signal and index is an Integer input signal. When the index is out of range,

  • then y = u[nin] if index > nin, and
  • y = u[1] if index < 1.

Parameters

TypeNameDefaultDescription
Integernin1Number of inputs

Connectors

TypeNameDefaultDescription
Buildings.Controls.OBC.CDL.Interfaces.IntegerInputindexIndex of input vector element to be extracted out
Buildings.Controls.OBC.CDL.Interfaces.RealInput[nin]uReal input signals
Buildings.Controls.OBC.CDL.Interfaces.RealOutputyReal signal extracted from input vector, u[index]

Revisions

  • April 19, 2023, by Michael Wetter:
    Converted equation section to algorithm section. This works around the issue reported in OpenModelica, #10580.
  • October 14, 2022, by Jianjun Hu:
    Changed output from a specified value to the element with the nearest valid index when the index input is out of range.
  • July 19, 2018, by Jianjun Hu:
    First implementation, based on the implementation of the Modelica Standard Library.