blockCircularBufferInteger
Circular buffer e.g. for use in the ADC model
Extends from Modelica.Blocks.Icons.DiscreteBlock (Graphical layout of discrete block component icon).
Information
This block implements a circular buffer with integer values.
A new value is read from u and written to the buffer each time the trigger rises. When the buffer is full, it is written to the output and can be evaluated by the callback function.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | BufDepth | 50 | Buffer depth |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Blocks.Interfaces.BooleanOutput | cb | True when the buffer is full | |
| Modelica.Blocks.Interfaces.BooleanInput | reset | Reset the buffer | |
| Modelica.Blocks.Interfaces.IntegerInput | u | ||
| Modelica.Blocks.Interfaces.BooleanInput | trigger | Samples new value from u | |
| Modelica.Blocks.Interfaces.IntegerOutput[BufDepth] | y |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Integer[BufDepth] | buffer | ADC buffer | |
| Integer | buf_ptr | Pointer to sampled value |