SharedArea (FB)ΒΆ

FUNCTION_BLOCK FINAL SharedArea EXTENDS FBF.InstanceBase IMPLEMENTS ISharedArea, IReadableSharedArea, IWriteableSharedArea

../../../_images/SharedArea.png

A shared area allows only ONE writer at the same time, reading the shared area is always allowed

InOut:

Scope

Name

Type

Initial

Comment

Input Const

pData

__XWORD

udiDataSize

UDINT

udiInitialCapacity

UDINT

5

The initial max number (>1) of possible references of the shared data

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, udiDataSize + SIZEOF(AreaData) - SIZEOF(DWORD)));

itfObserver

ISharedAreaObserver

An optional observer implemetation registered with initilaization.

itfUtilities

ISharedAreaUtilities

An optional specialized implementations for AreaCopyData and AreaIsEqual.

Properties:

Methods:

Structure: