indexValue function
Requirements.Internal.SlidingWindow.indexValue
ยท source
Returns the value at buffer index
Extends Modelica.Icons.Function
Returns the Boolean value of the element at position index of the buffer, counted from the newest
element: index = 1 is the newest element (as firstValue),
index = nElem the oldest one (as lastValue).
The position is mapped to the index in the ring, wrapping around below 1 to nBuffer. It asserts
1 ≤ index ≤ nElem. The time of the same element is returned by
indexTime. Used by
maxDuration and
accumulatedDuration to assert
that the values alternate.
Inputs
| Name | Type | Description |
|---|---|---|
buffer input | Buffer | Memory of sliding window |
index input | Integer | Index of time value (index >= 1; index=1: first) |
Outputs
| Name | Type | Description |
|---|---|---|
b output | Boolean | Value at buffer index |