numberOfValues function

Requirements.Internal.SlidingWindow.numberOfValues  ยท source

Icon of numberOfValues

Returns the number of values in the buffer

Extends Modelica.Icons.Function

Returns the number of elements currently stored in the buffer, buffer.nElem (0 for an empty buffer, at most nBuffer; when the buffer is full, push drops the oldest element). The counting checks of ChecksInSlidingWindow (e.g. MinRising, MaxFrequency) push one element per rising edge and remove the elements that leave the window, so this is the number of rising edges in the sliding time window.

Inputs

NameTypeDescription
buffer inputBufferMemory of sliding window

Outputs

NameTypeDescription
result outputIntegerNumber of values in the buffer