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]ifindex > nin, and -
y = u[1]ifindex < 1.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | nin | 1 | Number of inputs |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Buildings.Controls.OBC.CDL.Interfaces.IntegerInput | index | Index of input vector element to be extracted out | |
| Buildings.Controls.OBC.CDL.Interfaces.RealInput[nin] | u | Real input signals | |
| Buildings.Controls.OBC.CDL.Interfaces.RealOutput | y | Real 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.