AddEntry

AddEntry 1:

Adds one or more entries to the ring buffer and automatically updates the index of the last entry. The number of entries is increased, and the new nLastEntry is calculated using a modulo operation:

nLastEntry := nMinBound + ((nEntryCount-1) MOD Size)

Syntax

METHOD AddEntry : BOOL
VAR_INPUT
  nCount : DINT := 1;
END_VAR

AddEntry 2: Inputs

Name

Type

Description

nCount

DINT

Number of entries to be added.

AddEntry 3:
  • The method verifies that the iterator is initialized correctly.
  • nCount must be greater than 0.
  • nLastEntry is automatically calculated using ring wrapping.