indexValue function

Requirements.Internal.SlidingWindow.indexValue  ยท source

Icon of indexValue

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

NameTypeDescription
buffer inputBufferMemory of sliding window
index inputIntegerIndex of time value (index >= 1; index=1: first)

Outputs

NameTypeDescription
b outputBooleanValue at buffer index