indexTime function

Requirements.Internal.SlidingWindow.indexTime  ยท source

Icon of indexTime

Returns the time value at buffer index

Extends Modelica.Icons.Function

Returns the time instant of the element at position index of the buffer, counted from the newest element: index = 1 is the newest element, index = nElem the oldest one. The position is mapped to the index in the ring, wrapping around below 1 to nBuffer. It asserts 1 ≤ index ≤ nElem. The value of the same element is returned by indexValue. Used by maxDuration and accumulatedDuration to read the instants at which the signal changed.

Inputs

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

Outputs

NameTypeDescription
t outputSI.TimeTime value at index of buffer