Initialize

Initialize 1:

Initializes the ring buffer with a specific entry and fill status. The method calculates nEntryCount based on nLastEntry and bIsFull:

Syntax

METHOD Initialize : BOOL
VAR_INPUT
  nLastEntry : DINT;
  bIsFull    : BOOL;
END_VAR

Initialize 2: 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

Initialize 3:
  • The method checks the validity of the iterator before initialization.
  • nLastEntry must be within the valid range [nMinBound, nMaxBound].