Initialize

Initializes the ring buffer with a specific entry and fill status. The method calculates nEntryCount based on nLastEntry and bIsFull:
- If bIsFull = FALSE: nEntryCount = nLastEntry - nMinBound + 1
- If bIsFull = TRUE: nEntryCount = nEntryCount + Size (buffer overflow)
Syntax
METHOD Initialize : BOOL
VAR_INPUT
nLastEntry : DINT;
bIsFull : BOOL;
END_VAR
Inputs
Name | Type | Description |
|---|---|---|
nLastEntry | DINT | Index position of the last entry in the ring buffer |
bIsFull | BOOL | TRUE if the buffer is completely full, FALSE otherwise |
![]() |
|
