SharedQueue (FB)ΒΆ

FUNCTION_BLOCK PUBLIC FINAL SharedQueue EXTENDS FBF.InstanceBase IMPLEMENTS ISharedQueue, ISharedAreaObserver

InOut:

Scope

Name

Type

Initial

Comment

Input Const

udiInitialCapacity

UDINT

5

The initial max number (>0) of possible nodes handled by the queue

pPool

POINTER TO BYTE

The optinonal memory space for the background pool.
pPool = 0 => Memory is allocated from Heap
pPool <> 0 => The related static Memory of size udiPoolSize is used.

udiPoolSize

UDINT

The size of the memory area referenced by pPool
Condition: udiPoolSize >= TO_UDINT(MBM.PoolGetSize(udiInitialCapacity, SIZEOF(SHD.Node));

usiExtensionFactor

USINT

50

Setting udiExtendsFactor provides the possibility to control the dynmic extension of the pool.
udiExtendsFactor = 0 => No possibility for extending the pool.
udiExtendsFactor > 0 => Extendion of the pool will be possible.
A value of e.g. prvInstPoolExtendsFactor := 50 always expands the pool by 50% of its original size.

Methods:

Structure: